カスタムプロンプトデータセット - Amazon Bedrock

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

カスタムプロンプトデータセット

モデル評価ジョブでは、カスタムプロンプトデータセットを使用できます。

カスタムプロンプトデータセットは Amazon S3 に保存し、JSON Lines 形式と .jsonl ファイル拡張子を使用する必要があります。Amazon S3 にデータセットをアップロードする際は、必ず S3 バケットの Cross Origin Resource Sharing (CORS) 設定を更新してください。必要な CORS アクセス許可の詳細については、「必要な S3 バケットの Cross Origin Resource Sharing (CORS) アクセス許可」を参照してください。

自動モデル評価ジョブで使用するカスタムプロンプトデータセットの要件

自動モデル評価ジョブでは、モデル評価ジョブで選択した各メトリクスにカスタムプロンプトデータセットを使用できます。カスタムデータセットは JSON Lines 形式 (.jsonl) を使用し、各行は有効な JSON オブジェクトである必要があります。自動評価ジョブ 1 件につき、データセットには最大 1,000 のプロンプトを設定できます。

カスタムデータセットでは、以下のキーを使用する必要があります。

  • prompt — 以下のタスクの入力を示すのに必要です。

    • 一般的なテキスト生成でモデルが応答すべきプロンプト。

    • 質問回答タスクタイプでモデルが回答すべき質問。

    • テキスト要約タスクでモデルが要約すべきテキスト。

    • 分類タスクでモデルが分類すべきテキスト。

  • referenceResponse — 以下のタスクタイプで、モデルを評価する基準となるグラウンドトゥルースレスポンスを示すのに必要です。

    • 質問回答タスクのすべてのプロンプトに対する回答。

    • すべての正解率と堅牢性の評価に対する答え。

  • category — (オプション) カテゴリごとに報告される評価スコアを生成します。

例えば、正解率については、質問と質問へのモデルのレスポンスをチェックするための回答の両方が必要です。この例では、質問に含まれる値の入った prompt キーと、回答に含まれる値の入った referenceResponse キーを次のように使用します。

{ "prompt": "Bobigny is the capital of", "referenceResponse": "Seine-Saint-Denis", "category": "Capitals" }

前の例は、推論リクエストとしてモデルに送信される JSON Lines 入力ファイルの 1 行です。このような JSON Lines データセット内のレコードごとにモデルが呼び出されます。以下のデータ入力例は、評価にオプションの category キーを使用する質問回答タスクのものです。

{"prompt":"Aurillac is the capital of", "category":"Capitals", "referenceResponse":"Cantal"} {"prompt":"Bamiyan city is the capital of", "category":"Capitals", "referenceResponse":"Bamiyan Province"} {"prompt":"Sokhumi is the capital of", "category":"Capitals", "referenceResponse":"Abkhazia"}

ヒューマンワーカーを使用するモデル評価ジョブのフォーマット要件の詳細については、「ヒューマンワーカーを使用するモデル評価ジョブでのカスタムプロンプトデータセットの要件」を参照してください。

ヒューマンワーカーを使用するモデル評価ジョブでのカスタムプロンプトデータセットの要件

JSON Lines 形式では、各行は有効な JSON オブジェクトです。プロンプトデータセットには、モデル評価ジョブごとに最大 1,000 のプロンプトを設定できます。

有効なプロンプトエントリには promptキーが含まれている必要があります。category と はどちらもオプションreferenceResponseです。category キーを使用してプロンプトに特定のカテゴリのラベルを付けると、モデル評価レポートカードで結果をレビューする際に結果をフィルタリングできます。referenceResponse キーを使用して、評価中にワーカーが参照できるグラウンドトゥルースレスポンスを指定します。

ワーカー UI では、指定した prompt および referenceResponse がヒューマンワーカーに表示されます。

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

{"prompt":"Provide the prompt you want the model to use during inference","category":"(Optional) Specify an optional category","referenceResponse":"(Optional) Specify a ground truth response."} {"prompt":"Provide the prompt you want the model to use during inference","category":"(Optional) Specify an optional category","referenceResponse":"(Optional) Specify a ground truth response."} {"prompt":"Provide the prompt you want the model to use during inference","category":"(Optional) Specify an optional category","referenceResponse":"(Optional) Specify a ground truth response."} {"prompt":"Provide the prompt you want the model to use during inference","category":"(Optional) Specify an optional category","referenceResponse":"(Optional) Specify a ground truth response."} {"prompt":"Provide the prompt you want the model to use during inference","category":"(Optional) Specify an optional category","referenceResponse":"(Optional) Specify a ground truth response."} {"prompt":"Provide the prompt you want the model to use during inference","category":"(Optional) Specify an optional category","referenceResponse":"(Optional) Specify a ground truth response."}

わかりやすくするため、次の例では 1 つのエントリを拡張しています。

{ "prompt": "What is high intensity interval training?", "category": "Fitness", "referenceResponse": "High-Intensity Interval Training (HIIT) is a cardiovascular exercise approach that involves short, intense bursts of exercise followed by brief recovery or rest periods." }