モデル評価ジョブの結果が Amazon S3 にどのように保存されるかを理解する - Amazon Bedrock

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

モデル評価ジョブの結果が Amazon S3 にどのように保存されるかを理解する

モデル評価ジョブの出力は、モデル評価ジョブの作成時に指定した Amazon S3 バケットに保存されます。モデル評価ジョブの結果は JSON Lines ファイル (.jsonl) として保存されます。

モデル評価ジョブの結果は、指定した S3 バケットに次のように保存されます。

  • ヒューマンワーカーによるモデル評価ジョブの場合:

    s3://user-specified-S3-output-path/job-name/job-uuid/datasets/dataset-name/file-uuid_output.jsonl

  • 自動モデル評価ジョブの場合:

    s3://user-specified-S3-output-path/job-name/job-uuid/models/model-id/taskTypes/task-type/datasets/dataset/file-uuid_output.jsonl

以下のトピックでは、自動モデル評価ジョブおよびヒューマンワーカーベースのモデル評価ジョブの結果を Amazon S3 に保存する方法について説明します。

自動モデル評価ジョブからの出力データ

自動評価ジョブの結果は、ジョブのステータスが [完了] に変わると datasets ディレクトリに保存されます。

モデル評価ジョブの作成時に選択したメトリクスとそれに対応するプロンプトデータセットごとに、JSON Lines ファイルが datasets ディレクトリに生成されます。このファイルには、命名規則 metric_input-dataset.jsonl が使用されます。

モデル評価ジョブの各結果は automatedEvaluationResult キーで始まります。最初の子キー scores には、Amazon Bedrock コンソールで選択したメトリクスが含まれます。この例では、1 つのメトリクス (Accuracy) のみが選択されています。また、選択したメトリクスの計算済みの値である result も含まれています。計算される具体的な値の詳細については、「自動モデル評価ジョブのレポートカード (コンソール)」を参照してください。

2 番目のキー (inputRecord) は、入力プロンプトデータセットに入力した内容のコピーです。

3 番目のキー (modelResponses) には、モデル評価ジョブの作成時に選択したモデルの ARN を含む JSON オブジェクトのリストが含まれます。また、提供されたプロンプトに基づくモデルからの完全な応答も含まれています。

以下は、「正解率」というメトリクスを 1 つだけ選択した場合のテキスト要約タスクタイプの出力例です。

{ "automatedEvaluationResult": { "scores": [{ "metricName": "Accuracy", "result": 0.31920555233955383 }] }, "inputRecord": { "prompt": "Human: two bodies have been recovered from a flooded coal mine in yiyang city , central china 's henan province , as of #:## thursday morning , rescuers said . Assistant:", "referenceResponse": "two bodies recovered from flooded coal mine in c. china" }, "modelResponses": [{ "modelIdentifier": "arn:aws:bedrock:us-west-2::foundation-model/anthropic.claude-v2", "response": " Here are the key points I gathered from your news summary:\n\n- Two bodies have been recovered from a flooded coal mine in Yiyang City, in China's Henan province.\n\n- This happened as of Thursday morning, according to rescuers.\n\n- The location is central China's Henan province. \n\n- Yiyang City is where the flooded coal mine is located.\n\n- The coal mine was flooded, leading to the two deaths and need for rescue/recovery efforts.\n\n- This news is developing as of Thursday morning, so the death toll and rescue details may still be unfolding.\n\nPlease let me know if I have accurately summarized the key information or if you would like me to expand on any part of it." }] }

ヒューマンワーカーによるモデル評価ジョブからの出力データ。

モデル評価ジョブが完了すると、人間によるレビュータスクから返される出力データに次のパラメータが表示されます。

パラメータ 値の型 値の例 説明
flowDefinitionArn

文字列

arn:aws:sagemaker:us-west-2:111122223333:flow-definition/flow-definition-name

ヒューマンループの作成に使用される人間によるレビューワークフロー (フロー定義) の Amazon リソースナンバー (ARN)。

humanAnswers

JSON オブジェクトのリスト

"answerContent": { "evaluationResults": { "thumbsUpDown": [{ "metricName": "Relevance", "modelResponseId": "0", "result": false }] } }

answerContent にワーカーのレスポンスを含む JSON オブジェクトのリスト。

humanLoopName

文字列 system-generated-hash システムは 40 文字の 16 進数文字列を生成。
inputRecord JSON オブジェクト
"inputRecord": { "prompt": "What does vitamin C serum do for skin?", "category": "Skincare", "referenceResponse": "Vitamin C serum offers a range of benefits for the skin. Firstly, it acts.... }
入力データセットからのエントリプロンプトを含む JSON オブジェクト。
modelResponses JSON オブジェクトのリスト
"modelResponses": [{ "modelIdentifier": "arn:aws:bedrock:us-west-2::foundation-model/model-id", "response": "the-models-response-to-the-prompt" }]
モデルからの個々のレスポンス。
inputContent

オブジェクト

{ "additionalDataS3Uri":"s3://user-specified-S3-URI-path/datasets/dataset-name/records/record-number/human-loop-additional-data.json", "evaluationMetrics":[ { "description":"testing", "metricName":"IndividualLikertScale", "ratingMethod":"IndividualLikertScale" } ], "instructions":"example instructions" }

S3 バケットでヒューマンループを開始するために必要なヒューマンループ入力コンテンツ。

modelResponseIdMap

オブジェクト

{ "0":"arn:aws:bedrock:us-west-2::foundation-model/model-id" }

humanAnswers.answerContent.evaluationResultsmodelResponseIds が含まれます。modelResponseIdMapmodelResponseIdはをモデル名に接続します。

以下は、モデル評価ジョブからの出力データの例です。

{ "humanEvaluationResult": [{ "flowDefinitionArn": "arn:aws:sagemaker:us-west-2:111122223333:flow-definition/flow-definition-name", "humanAnswers": [{ "acceptanceTime": "2023-11-09T19:17:43.107Z", "answerContent": { "evaluationResults": { "thumbsUpDown": [{ "metricName": "Coherence", "modelResponseId": "0", "result": false }, { "metricName": "Accuracy", "modelResponseId": "0", "result": true }], "individualLikertScale": [{ "metricName": "Toxicity", "modelResponseId": "0", "result": 1 }] } }, "submissionTime": "2023-11-09T19:17:52.101Z", "timeSpentInSeconds": 8.994, "workerId": "444455556666", "workerMetadata": { "identityData": { "identityProviderType": "Cognito", "issuer": "https://cognito-idp.AWS リージョン.amazonaws.com/AWS リージョン_111222", "sub": "c6aa8eb7-9944-42e9-a6b9-" } } }], ...Additional response have been truncated for clarity... }], "humanLoopName": "b3b1c64a2166e001e094123456789012", "inputContent":{ "additionalDataS3Uri":"s3://user-specified-S3-output-path/datasets/dataset-name/records/record-number/human-loop-additional-data.json", "evaluationMetrics":[ { "description":"testing", "metricName":"IndividualLikertScale", "ratingMethod":"IndividualLikertScale" } ], "instructions":"some dummy instructions" }, "modelResponseIdMap":{ "0":"arn:aws:bedrock:AWS リージョン::foundation-model/model-id" } }, "inputRecord": { "category": "Fitness", "prompt": "Human: What is High-Intensity Interval Training ? \\n\\nAssistant:", "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. In HIIT, you perform exercises at near-maximum effort during the high-intensity intervals, which can include activities like sprinting, cycling, jumping, or body weight exercises such as burpees or push-ups. These intense intervals are interspersed with short recovery periods to lower your heart rate before the next high-intensity bout. HIIT workouts usually consist of multiple cycles of these intervals, and the number of cycles and the length of intervals can vary. HIIT is known for its time efficiency, making it an excellent choice for those with busy schedules. It offers both aerobic and anaerobic benefits, improving cardiovascular fitness, burning calories, and promoting fat loss, all while boosting metabolism for continued calorie burning post-workout." }, "modelResponses": [{ "modelIdentifier": "arn:aws:bedrock:AWS リージョン::foundation-model/model-id", "response": " High-intensity interval training (HIIT) is a form of exercise that involves short bursts of intense activity alternated with recovery periods. Here are some key features of HIIT:\n\n- Alternates short periods of intense anaerobic exercise with less intense recovery periods. The high-intensity periods are typically done at 80-95% of maximum heart rate.\n\n- The duration of the intense periods can range from 5 seconds to 8 minutes, but typically are in the range of 30 seconds to 4 minutes.\n\n- The total HIIT session typically lasts between 10-30 minutes, including warm-up, recovery periods, and cool down. \n\n- Uses exercises like sprints, cycling, rowing, jumping rope, stair climbing, swimming, etc. Movements that get your heart rate up quickly.\n\n- The short, intense intervals help improve cardiovascular fitness by increasing heart rate and oxygen consumption.\n\n- HIIT burns more calories and fat than steady-state cardio in a shorter time period. It also helps build muscle strength and endurance.\n\n- Considered an efficient and effective form of exercise for fat loss and improving aerobic power. But it requires motivation to push yourself during the intense intervals.\n\n- Not suitable for beginners due to the high-intensity. Start with steady-state cardio and build up endurance before trying HIIT.\n\nIn summary, HIIT intersperses intense bursts of" }] } }

次の表では、Amazon Bedrock コンソールで各メトリクスに対して選択した [評価方法] が Amazon S3 バケットでどのように返されるかについて説明しています。evaluationResults の下の最初の子キーは、選択した [評価方法] が返される方法を示します。

Amazon Bedrock コンソールで選択した評価方法が Amazon S3 に保存される仕組み
選択された評価方法 Amazon S3 に保存
リッカート尺度 - 個別 IndividualLikertScale
リッカート尺度 - 比較 ComparisonLikertScale
選択ボタン ComparisonChoice
序数ランク ComparisonRank
高く評価/低く評価 ThumbsUpDown