

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

# ヒューマンワーカーを使用するモデル評価ジョブのカスタムプロンプトデータセットを作成する
<a name="model-evaluation-prompt-datasets-custom-human"></a>

ヒューマンワーカーを使用するモデル評価ジョブを作成するには、カスタムプロンプトデータセットを指定する必要があります。これらのプロンプトは、評価対象として選択したモデルによる推論中に使用されます。

既に生成した応答を使用して Amazon Bedrock 以外のモデルを評価する場合は、「[独自の推論レスポンスデータを使用して評価ジョブを実行する](#model-evaluation-prompt-datasets-custom-human-byoir)」の説明に従って、それらの応答をプロンプトデータセットに含めます。独自の推論レスポンスデータを指定すると、Amazon Bedrock はモデル呼び出しステップをスキップし、指定したデータを使用して評価ジョブを実行します。

カスタムプロンプトデータセットは Amazon S3 に保存し、JSON Lines 形式と `.jsonl` ファイル拡張子を使用する必要があります。各行が有効な JSON オブジェクトである必要があります。自動評価ジョブ 1 件につき、データセットには最大 1,000 のプロンプトを設定できます。

コンソールを使用して作成されたジョブの場合、S3 バケットのクロスオリジンリソース共有 (CORS) 設定を更新する必要があります。必要な CORS アクセス許可の詳細については、「[S3 バケットに必要なクロスオリジンリソース共有 (CORS) のアクセス許可](model-evaluation-security-cors.md)」を参照してください。

## Amazon Bedrock がモデルを呼び出す評価ジョブを実行する
<a name="model-evaluation-prompt-datasets-custom-human-invoke"></a>

Amazon Bedrock がモデルを呼び出す評価ジョブを実行するには、次のキーと値のペアを含むプロンプトデータセットを指定します。
+ `prompt` – モデルが応答するプロンプト。
+ `referenceResponse` – (オプション) ワーカーが評価中に参照できるグラウンドトゥルース応答。
+ `category` – (オプション) モデル評価レポートカードで結果を確認するときに結果をフィルタリングするために使用できるキー。

ワーカー 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 つのエントリを展開したものです。実際のプロンプトデータセットでは、各行が有効な JSON オブジェクトである必要があります。

```
{
  "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."
}
```

## 独自の推論レスポンスデータを使用して評価ジョブを実行する
<a name="model-evaluation-prompt-datasets-custom-human-byoir"></a>

既に生成した応答を使用して評価ジョブを実行するには、次のキーと値のペアを含むプロンプトデータセットを指定します。
+ `prompt` – モデルが応答の生成に使用したプロンプト。
+ `referenceResponse` – (オプション) ワーカーが評価中に参照できるグラウンドトゥルース応答。
+ `category` – (オプション) モデル評価レポートカードで結果を確認するときに結果をフィルタリングするために使用できるキー。
+ `modelResponses` – 評価する独自の推論からの応答。`modelResponses` リスト内の次のプロパティを使用して、1 つまたは 2 つのエントリを指定できます。
  + `response` – モデル推論からの応答を含む文字列。
  + `modelIdentifier` – 応答を生成したモデルを識別する文字列。

プロンプトデータセットのすべての行には、同じ数の応答 (1 つまたは 2 つ) が含まれている必要があります。さらに、各行に同じモデル識別子を指定する必要があり、1 つのデータセット内の `modelIdentifier` で 2 つ以上の一意の値を使用することはできません。

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

```
{"prompt":"The prompt you used to generate the model responses","referenceResponse":"(Optional) a ground truth response","category":"(Optional) a category for the prompt","modelResponses":[{"response":"The response your first model generated","modelIdentifier":"A string identifying your first model"},{"response":"The response your second model generated","modelIdentifier":"A string identifying your second model"}]}
{"prompt":"The prompt you used to generate the model responses","referenceResponse":"(Optional) a ground truth response","category":"(Optional) a category for the prompt","modelResponses":[{"response":"The response your first model generated","modelIdentifier":"A string identifying your first model"},{"response":"The response your second model generated","modelIdentifier":"A string identifying your second model"}]}
{"prompt":"The prompt you used to generate the model responses","referenceResponse":"(Optional) a ground truth response","category":"(Optional) a category for the prompt","modelResponses":[{"response":"The response your first model generated","modelIdentifier":"A string identifying your first model"},{"response":"The response your second model generated","modelIdentifier":"A string identifying your second model"}]}
{"prompt":"The prompt you used to generate the model responses","referenceResponse":"(Optional) a ground truth response","category":"(Optional) a category for the prompt","modelResponses":[{"response":"The response your first model generated","modelIdentifier":"A string identifying your first model"},{"response":"The response your second model generated","modelIdentifier":"A string identifying your second model"}]}
{"prompt":"The prompt you used to generate the model responses","referenceResponse":"(Optional) a ground truth response","category":"(Optional) a category for the prompt","modelResponses":[{"response":"The response your first model generated","modelIdentifier":"A string identifying your first model"},{"response":"The response your second model generated","modelIdentifier":"A string identifying your second model"}]}
{"prompt":"The prompt you used to generate the model responses","referenceResponse":"(Optional) a ground truth response","category":"(Optional) a category for the prompt","modelResponses":[{"response":"The response your first model generated","modelIdentifier":"A string identifying your first model"},{"response":"The response your second model generated","modelIdentifier":"A string identifying your second model"}]}
```

次の例では、プロンプトデータセット内の 1 つのエントリをわかりやすいように展開して示しています。

```
{
    "prompt": "What is high intensity interval training?",
    "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.",
    "category": "Fitness",
     "modelResponses": [
        {
            "response": "High intensity interval training (HIIT) is a workout strategy that alternates between short bursts of intense, maximum-effort exercise and brief recovery periods, designed to maximize calorie burn and improve cardiovascular fitness.",
            "modelIdentifier": "Model1"
        },
        {
            "response": "High-intensity interval training (HIIT) is a cardiovascular exercise strategy that alternates short bursts of intense, anaerobic exercise with less intense recovery periods, designed to maximize calorie burn, improve fitness, and boost metabolic rate.",
            "modelIdentifier": "Model2"
        }
    ]
}
```