Bring-Your-Own-Dataset (BYOD) タスクでサポートされているデータセット形式 - Amazon SageMaker AI

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

Bring-Your-Own-Dataset (BYOD) タスクでサポートされているデータセット形式

Custom Scorer および LLM-as-judge 評価タイプには、 AWS S3 にあるカスタムデータセット JSONL ファイルが必要です。ファイルを、次のいずれかのサポートされている形式に準拠した JSON Lines ファイルとして指定する必要があります。このドキュメントの例は、わかりやすくするために展開されています。

各形式には独自のニュアンスがありますが、少なくともすべてユーザープロンプトが必要です。

必須フィールド
フィールド 必要
ユーザープロンプト はい
システムプロンプト いいえ
グラウンドトゥルース カスタムスコアラーのみ
Category いいえ

1. OpenAI 形式

{ "messages": [ { "role": "system", # System prompt (looks for system role) "content": "You are a helpful assistant." }, { "role": "user", # Query (looks for user role) "content": "Hello!" }, { "role": "assistant", # Ground truth (looks for assistant role) "content": "Hello to you!" } ] }

2. SageMaker の評価

{ "system":"You are an English major with top marks in class who likes to give minimal word responses: ", "query":"What is the symbol that ends the sentence as a question", "response":"?", # Ground truth "category": "Grammar" }

3. HuggingFace プロンプトの完了

標準形式と会話形式の両方がサポートされています。

# Standard { "prompt" : "What is the symbol that ends the sentence as a question", # Query "completion" : "?" # Ground truth } # Conversational { "prompt": [ { "role": "user", # Query (looks for user role) "content": "What is the symbol that ends the sentence as a question" } ], "completion": [ { "role": "assistant", # Ground truth (looks for assistant role) "content": "?" } ] }

4。HuggingFace の設定

標準形式 (文字列) と会話形式 (メッセージ配列) の両方がサポートされています。

# Standard: {"prompt": "text", "chosen": "text", "rejected": "text"} { "prompt" : "The sky is", # Query "chosen" : "blue", # Ground truth "rejected" : "green" } # Conversational: { "prompt": [ { "role": "user", # Query (looks for user role) "content": "What color is the sky?" } ], "chosen": [ { "role": "assistant", # Ground truth (looks for assistant role) "content": "It is blue." } ], "rejected": [ { "role": "assistant", "content": "It is green." } ] }

5。Verl 形式

Verl 形式 (現在の形式とレガシー形式の両方) は、強化学習のユースケースでサポートされています。参照用の Verl ドキュメント: https://verl.readthedocs.io/en/latest/preparation/prepare_data.html

VERL 形式のユーザーは通常、グラウンドトゥルースレスポンスを提供しません。いずれかを指定する場合は、 フィールドextra_info.answerまたは のいずれかを使用しますreward_model.ground_truthextra_infoが優先されます。

SageMaker は、存在する場合、次の VERL 固有のフィールドをメタデータとして保持します。

  • id

  • data_source

  • ability

  • reward_model

  • extra_info

  • attributes

  • difficulty

# Newest VERL format where `prompt` is an array of messages. { "data_source": "openai/gsm8k", "prompt": [ { "content": "You are a helpful math tutor who explains solutions to questions step-by-step.", "role": "system" }, { "content": "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May? Let's think step by step and output the final answer after \"####\".", "role": "user" } ], "ability": "math", "extra_info": { "answer": "Natalia sold 48/2 = <<48/2=24>>24 clips in May.\nNatalia sold 48+24 = <<48+24=72>>72 clips altogether in April and May.\n#### 72", "index": 0, "question": "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?", "split": "train" }, "reward_model": { "ground_truth": "72" # Ignored in favor of extra_info.answer } } # Legacy VERL format where `prompt` is a string. Also supported. { "data_source": "openai/gsm8k", "prompt": "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May? Let's think step by step and output the final answer after \"####\".", "extra_info": { "answer": "Natalia sold 48/2 = <<48/2=24>>24 clips in May.\nNatalia sold 48+24 = <<48+24=72>>72 clips altogether in April and May.\n#### 72", "index": 0, "question": "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?", "split": "train" } }