Cookie の設定を選択する

当社は、当社のサイトおよびサービスを提供するために必要な必須 Cookie および類似のツールを使用しています。当社は、パフォーマンス Cookie を使用して匿名の統計情報を収集することで、お客様が当社のサイトをどのように利用しているかを把握し、改善に役立てています。必須 Cookie は無効化できませんが、[カスタマイズ] または [拒否] をクリックしてパフォーマンス Cookie を拒否することはできます。

お客様が同意した場合、AWS および承認された第三者は、Cookie を使用して便利なサイト機能を提供したり、お客様の選択を記憶したり、関連する広告を含む関連コンテンツを表示したりします。すべての必須ではない Cookie を受け入れるか拒否するには、[受け入れる] または [拒否] をクリックしてください。より詳細な選択を行うには、[カスタマイズ] をクリックしてください。

RAG 評価ジョブretrieve-and-generateのためのプロンプトデータセットの作成

フォーカスモード
RAG 評価ジョブretrieve-and-generateのためのプロンプトデータセットの作成 - Amazon Bedrock

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

retrieve-and-generate評価ジョブには、JSON 行形式を使用したプロンプトデータセットが必要です。データセットには最大 1000 個のプロンプトを含めることができます

Amazon Bedrock がナレッジベースをretrieve-and-generate評価ジョブ用のデータセットを準備する

Amazon Bedrock がナレッジベースを呼び出す取得専用評価ジョブを作成するには、プロンプトデータセットに次のキーと値のペアが含まれている必要があります。

  • referenceResponses – この親キーは、 が返RetrieveAndGenerateすと予想されるグラウンドトゥルースレスポンスを指定するために使用されます。text キーにグラウンドトゥルースを指定します。 referenceResponsesは、評価ジョブでコンテキストカバレッジメトリクスを選択した場合に必要です。

  • prompt – この親キーは、評価ジョブの実行中にモデルが応答するプロンプト (ユーザークエリ) を指定するために使用されます。

以下は、6 つの入力を含み、JSON Lines 形式を使用するカスタムデータセットの例です。

{"conversationTurns":[{"prompt":{"content":[{"text":"Provide the prompt you want to use during inference"}]},"referenceResponses":[{"content":[{"text":"Specify a ground-truth response"}]}]}]} {"conversationTurns":[{"prompt":{"content":[{"text":"Provide the prompt you want to use during inference"}]},"referenceResponses":[{"content":[{"text":"Specify a ground-truth response"}]}]}]} {"conversationTurns":[{"prompt":{"content":[{"text":"Provide the prompt you want to use during inference"}]},"referenceResponses":[{"content":[{"text":"Specify a ground-truth response"}]}]}]} {"conversationTurns":[{"prompt":{"content":[{"text":"Provide the prompt you want to use during inference"}]},"referenceResponses":[{"content":[{"text":"Specify a ground-truth response"}]}]}]} {"conversationTurns":[{"prompt":{"content":[{"text":"Provide the prompt you want to use during inference"}]},"referenceResponses":[{"content":[{"text":"Specify a ground-truth response"}]}]}]} {"conversationTurns":[{"prompt":{"content":[{"text":"Provide the prompt you want to use during inference"}]},"referenceResponses":[{"content":[{"text":"Specify a ground-truth response"}]}]}]}

次のプロンプトが展開され、わかりやすくなりました。実際のプロンプトデータセットでは、各行 (プロンプト) は有効な JSON オブジェクトである必要があります。

{ "conversationTurns": [ { "prompt": { "content": [ { "text": "What is the recommended service interval for your product?" } ] }, "referenceResponses": [ { "content": [ { "text": "The recommended service interval for our product is two years." } ] } ] } ] }

独自の推論レスポンスデータを使用して、評価ジョブretrieve-and-generateのためのデータセットを準備する

独自の推論レスポンスデータを提供するretrieve-and-generate評価ジョブを作成するには、プロンプトデータセットは会話ターンのリストであり、ターンごとに以下が含まれます。ジョブごとに評価できる RAG ソースは 1 つだけです。

  • prompt – 結果を生成するためにモデルに指定したプロンプト。

  • referenceResponses – この親キーは、取得結果と入力クエリを取り込んだ後に LLM からの最終出力に予想される Ground-truth レスポンスを指定するために使用されます。

  • referenceContexts (オプション) – このオプションの親キーは、RAG ソースから取得される予定のグラウンドトゥルースパッセージを指定するために使用されます。このキーは、独自のカスタム評価メトリクスで使用する場合にのみ含める必要があります。Amazon Bedrock が提供する組み込みメトリクスは、このプロパティを使用しません。

  • output – 以下で構成される RAG ソースからの出力。

    • text – RAG システムの LLM からの最終出力。

    • retrievedPassages – この親キーは、RAG ソースが取得したコンテンツを指定するために使用されます。

output データには、推論レスポンスの生成に使用した RAG ソースknowledgeBaseIdentifierを定義する文字列も含める必要があります。使用した LLM を識別するオプションのmodelIdentifier文字列を含めることもできます。retrievalResults および にはretrievedReferences、オプションの名前とメタデータを指定できます。

以下は、6 つの入力を含み、JSON Lines 形式を使用するカスタムデータセットの例です。

{"conversationTurns":[{"prompt":{"content":[{"text":"Provide the prompt you used to generate the response"}]},"referenceResponses":[{"content":[{"text":"A ground truth for the final response generated by the LLM"}]}],"referenceContexts":[{"content":[{"text":"A ground truth for a received passage"}]}],"output":{"text":"The output of the LLM","modelIdentifier":"(Optional) a string identifying your model","knowledgeBaseIdentifier":"A string identifying your RAG source","retrievedPassages":{"retrievalResults":[{"name":"(Optional) a name for your retrieval","content":{"text":"The retrieved content"},"metadata":{"(Optional) a key for your metadata":"(Optional) a value for your metadata"}}]}}}]} {"conversationTurns":[{"prompt":{"content":[{"text":"Provide the prompt you used to generate the response"}]},"referenceResponses":[{"content":[{"text":"A ground truth for the final response generated by the LLM"}]}],"referenceContexts":[{"content":[{"text":"A ground truth for a received passage"}]}],"output":{"text":"The output of the LLM","modelIdentifier":"(Optional) a string identifying your model","knowledgeBaseIdentifier":"A string identifying your RAG source","retrievedPassages":{"retrievalResults":[{"name":"(Optional) a name for your retrieval","content":{"text":"The retrieved content"},"metadata":{"(Optional) a key for your metadata":"(Optional) a value for your metadata"}}]}}}]} {"conversationTurns":[{"prompt":{"content":[{"text":"Provide the prompt you used to generate the response"}]},"referenceResponses":[{"content":[{"text":"A ground truth for the final response generated by the LLM"}]}],"referenceContexts":[{"content":[{"text":"A ground truth for a received passage"}]}],"output":{"text":"The output of the LLM","modelIdentifier":"(Optional) a string identifying your model","knowledgeBaseIdentifier":"A string identifying your RAG source","retrievedPassages":{"retrievalResults":[{"name":"(Optional) a name for your retrieval","content":{"text":"The retrieved content"},"metadata":{"(Optional) a key for your metadata":"(Optional) a value for your metadata"}}]}}}]} {"conversationTurns":[{"prompt":{"content":[{"text":"Provide the prompt you used to generate the response"}]},"referenceResponses":[{"content":[{"text":"A ground truth for the final response generated by the LLM"}]}],"referenceContexts":[{"content":[{"text":"A ground truth for a received passage"}]}],"output":{"text":"The output of the LLM","modelIdentifier":"(Optional) a string identifying your model","knowledgeBaseIdentifier":"A string identifying your RAG source","retrievedPassages":{"retrievalResults":[{"name":"(Optional) a name for your retrieval","content":{"text":"The retrieved content"},"metadata":{"(Optional) a key for your metadata":"(Optional) a value for your metadata"}}]}}}]} {"conversationTurns":[{"prompt":{"content":[{"text":"Provide the prompt you used to generate the response"}]},"referenceResponses":[{"content":[{"text":"A ground truth for the final response generated by the LLM"}]}],"referenceContexts":[{"content":[{"text":"A ground truth for a received passage"}]}],"output":{"text":"The output of the LLM","modelIdentifier":"(Optional) a string identifying your model","knowledgeBaseIdentifier":"A string identifying your RAG source","retrievedPassages":{"retrievalResults":[{"name":"(Optional) a name for your retrieval","content":{"text":"The retrieved content"},"metadata":{"(Optional) a key for your metadata":"(Optional) a value for your metadata"}}]}}}]} {"conversationTurns":[{"prompt":{"content":[{"text":"Provide the prompt you used to generate the response"}]},"referenceResponses":[{"content":[{"text":"A ground truth for the final response generated by the LLM"}]}],"referenceContexts":[{"content":[{"text":"A ground truth for a received passage"}]}],"output":{"text":"The output of the LLM","modelIdentifier":"(Optional) a string identifying your model","knowledgeBaseIdentifier":"A string identifying your RAG source","retrievedPassages":{"retrievalResults":[{"name":"(Optional) a name for your retrieval","content":{"text":"The retrieved content"},"metadata":{"(Optional) a key for your metadata":"(Optional) a value for your metadata"}}]}}}]}

以下は、わかりやすくするために展開されたプロンプトデータセット形式を示しています。実際のプロンプトデータセットでは、各行 (プロンプト) は有効な JSON オブジェクトである必要があります。

{ "conversationTurns": [ { "prompt": { "content": [ { "text": "Provide the prompt you used to generate the responses" } ] }, "referenceResponses": [ { "content": [ { "text": "A ground truth for the final response generated by the LLM" } ] } ], "referenceContexts": [ { "content": [ { "text": "A ground truth for a received passage" } ] } ], "output": { "text": "The output of the LLM", "modelIdentifier": "(Optional) a string identifying your model", "knowledgeBaseIdentifier": "A string identifying your RAG source", "retrievedPassages": { "retrievalResults": [ { "name": "(Optional) a name for your retrieval", "content": { "text": "The retrieved content" }, "metadata": { "(Optional) a key for your metadata": "(Optional) a value for your metadata" } } ] } } } ] }
プライバシーサイト規約Cookie の設定
© 2025, Amazon Web Services, Inc. or its affiliates.All rights reserved.