ファクトチェックのできる Jina Reader の Grounding API を試す
tl;dr
Jina AI の Jina Reader に Grounding API が追加されたよ
ハルシネーションの軽減や自分の文章の整合性を確認するのに使えるよ
g.jina.ai というエンドポイントが追加されたよ
ファクトチェックの指標の F1 において、GPT-4 や o1-mini、検索機能つきの Gemini 1.5 Flash & Pro を超えるスコアを達成したよ
g.jina.ai は s.jina.ai と r.jina.ai をラップし、Chain of Thought を通じてマルチホップ推論を追加しているよ
r.jina.ai はウェブページを LLM-friendly な Markdown 形式に変換
s.jina.ai はクエリに対する検索結果を Markdown 形式で集約
一回の呼び出しにつき、検索、ページの読み込み、LLM によるマルチホップ推論を行なうため、レスポンスには 30 秒程度(実際はもっとかかった)、最大 300K トークンを使用するよ
おおよそ tl;dr にてまとめ終えたので、これ以上内容については詳しく触れません。実際に動かしてきましょう。
動かすにあたってまずは API Key が必要ですので発行しましょう。なぜかアカウント作成・ログイン不要で API Key が使える仕様です。太っ腹。
こちらのページの下の方より API Key を取得してください。
では API Key を指定して curl でリクエストを投げてみましょう。
export JINA_API_KEY=jana_xxxxxxxxxx
curl -X POST https://g.jina.ai \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $JINA_API_KEY" \
-d '{
"statement":"Claude 3.5 Opus はいつリリースされますか?"
}'
手元では 1 分 14 秒かかりました。なかなかかかるね!
{
"code": 200,
"status": 20000,
"data": {
"factuality": 0.8,
"result": true,
"reason": "The statement 'Claude 3.5 Opus はいつリリースされますか?' is a question about the release date of Claude 3.5 Opus. The references indicate that the release of Claude 3.5 Opus is anticipated later in 2024, with some predictions suggesting dates like November 2, 2024. However, there is no official confirmation of the exact release date. Therefore, the statement is supported by the references as it reflects ongoing discussions and predictions about the release timeframe.",
"references": [
{
"url": "https://forest.watch.impress.co.jp/docs/news/1602260.html",
"keyQuote": "米Anthropicは6月21日(日本時間)、「Claude 3.5 Opus」の2倍の速度で動作する大規模言語モデル(LLM)「Claude 3.5 Sonnet」を発表した。",
"isSupportive": false
},
{
"url": "https://gigazine.net/gsc_news/en/20240621-anthropic-claude-3-5-sonnet/",
"keyQuote": "Anthropic, the developer of the chatbot AI 'Claude,' announced a new model, 'Claude 3.5 Sonnet,' on June 21, 2024.",
"isSupportive": false
},
{
"url": "https://highreso.jp/edgehub/wordgenerationai/howclaude3.html",
"keyQuote": "Claude3.5 Sonnet Artifacts(クロード 3.5 ソネット アーティファクト)が、2024年6月21日にAnthropic社からリリースされました。",
"isSupportive": true
},
{
"url": "https://medium.com/@lisakim01/when-will-claude-3-5-opus-be-released-watch-this-interview-e145bf60ebb5",
"keyQuote": "While an exact release date has not been officially announced, recent statements from Anthropic’s leadership provide valuable insights into the company’s plans and timeline.",
"isSupportive": true
},
{
"url": "https://medium.com/@lisakim01/when-will-claude-3-5-opus-be-released-watch-this-interview-e145bf60ebb5",
"keyQuote": "Amodei stated, 'To complete the Claude 3.5 model family, we’ll be releasing Claude 3.5 Haiku and Claude 3.5 Opus later this year.'",
"isSupportive": true
},
{
"url": "https://no1s.biz/blog/6458/",
"keyQuote": "さらに進化した「Haiku」「Opus」も年内にリリース?",
"isSupportive": true
},
{
"url": "https://note.com/itella/n/n527639b4da73",
"keyQuote": "Claude 3.5 Sonnetがリリースされました。中間に位置づけられているモデルでしたが、多くの評価基準において競合モデル(GPT-4o)やClaude 3 Opusを上回る性能を示しています。",
"isSupportive": false
},
{
"url": "https://note.com/ludens5591/n/n55d74a374bd0",
"keyQuote": "そのうち3.5 Opusもリリースされるのでしょうか。",
"isSupportive": true
},
{
"url": "https://www.anthropic.com/news/claude-3-5-sonnet",
"keyQuote": "To complete the Claude 3.5 model family, we’ll be releasing Claude 3.5 Haiku and Claude 3.5 Opus later this year.",
"isSupportive": true
},
{
"url": "https://www.itmedia.co.jp/news/articles/2406/21/news087.html",
"keyQuote": "Claude 3.5 SonnetClaude 3 Opus",
"isSupportive": true
},
{
"url": "https://www.metaculus.com/questions/27442/claude-35-opus-release-date/",
"keyQuote": "When will Claude 3.5 Opus be released?",
"isSupportive": true
},
{
"url": "https://www.metaculus.com/questions/27442/claude-35-opus-release-date/",
"keyQuote": "Community Prediction2024-11-02",
"isSupportive": true
},
{
"url": "https://www.reddit.com/r/ClaudeAI/comments/1dtlel9/when_should_we_expect_claude_35_opus/",
"keyQuote": "When should we expect Claude 3.5 Opus?",
"isSupportive": true
},
{
"url": "https://www.reddit.com/r/ClaudeAI/comments/1dtlel9/when_should_we_expect_claude_35_opus/",
"keyQuote": "There is a chance that we get Haiku and Opus 3.5 in August after the Google IO when they drop Gemini 2.0 or Gemini 1.5 Ultra.",
"isSupportive": true
},
{
"url": "https://www.sbbit.jp/article/cont1/145948",
"keyQuote": "OpenAIの競合、アンソロピックは2024年3月、大規模言語モデル(LLM)のGPT-4を超えるClaude 3 Opusを発表し、大きな話題となった。",
"isSupportive": true
}
]
}
}
お!良い感じですね!内容についてはこの後触れるとして、構造を見てみましょう。
{
"code": "",
"status": "",
"data": {
"factuality": "",
"result": "",
"reason": "",
"references": [
{
"url": "",
"keyQuote": "",
"isSupportive": ""
},
{
"url": "",
"keyQuote": "",
"isSupportive": ""
}
]
}
}
factuality というのがどれだけ確証があるかということ。今回の場合 80% ということになります。result に推論できたかどうかの真偽と、reason にマルチホップ推論の結果が格納されています。references に参照したページの URL と引用、使える引用であるかどうかが含まれています。
ではレスポンスの詳細を見てみましょう。
夏頃に中の人が Later this year と発言があったので、遅れる可能性は無きにしも非ずではありますが、おそらく年内には公開されるでしょう。ただ、日付の予想までは追えていませんでした。
ではせっかくなのでレスポンスを Claude に貼り付けて聞いてみます。
引き続き聞いてみる。
Jina Reader API おすすめです!RAG 代わりにこれを前段に差し込めば普通に使えるのではと思いました!簡単に使えるのでぜひ!
よかったら↓から X と note フォローしてね!いま絶賛仕込んでいるものがいくつかあるのでお楽しみに!
直近だと↓このあたりに出没します!もしご都合の合う方がいらしたら遊びに来てください!