claude-skills/

Anthropic公式スキル・プラグインの日本語ディレクトリ

last sync 22h ago
スキルOfficialdevelopment

📊dataset-evaluation

プラグイン
sagemaker-ai

説明

データセットのフォーマットと品質を、SageMakerのモデルファインチューニング(SFT、DPO、またはRLVR)向けに検証します。 次のような場合に使用: ユーザーが「データセットは問題ないか」「データを評価してほしい」「トレーニングデータを確認してほしい」「独自のデータを持っている」と言った場合、またはファインチューニングジョブを開始する前。 ファイルフォーマットを検出し、選択したモデルおよびトレーニング手法に対するスキーマの準拠状況を確認し、データがトレーニングまたは評価に使用可能な状態かどうかをレポートします。

原文を表示

Validates dataset formatting and quality for SageMaker model fine-tuning (SFT, DPO, or RLVR). Use when the user says "is my dataset okay", "evaluate my data", "check my training data", "I have my own data", or before starting any fine-tuning job. Detects file format, checks schema compliance against the selected model and technique, and reports whether the data is ready for training or evaluation.

ユースケース

  • ファインチューニング前のデータ検証
  • データセットの品質評価が必要なとき
  • トレーニングデータのスキーマ確認
  • 独自データの形式チェック

本文(日本語訳)

ワークフロー手順

以下のワークフローに従ってください。 データセットを特定し、ファイル形式を確認し、ファイルが見つからない・形式が誤っているといった問題を解決します。 ファインチューニングするモデルとファインチューニング戦略を決定し、モデルファミリーに応じた適切な検証を実行します。 最終的に「データセットはファインチューニングの準備ができているか」という観点で結果をまとめます。

前提条件

  • SDK環境が検証済みであること(SDKバージョン、リージョン、実行ロール)。 未完了の場合は、先に sdk-getting-started スキルを起動してください。

ワークフロー

  1. データセットの特定:

    • フルパスには、ローカルファイルパスまたはS3 URIのいずれかが使用されます
    • データセットファイルのフルパスを解決し、読み取り権限があることを確認してください
    • ファイルが見つからない場合はユーザーをサポートしてください
  2. 戦略とモデルの決定:

    • ファイルのフォーマットは、現在選択されているファインチューニング戦略とファインチューニングのベースモデルに依存します
    • 戦略とモデルがすでに会話コンテキストから判明している場合(例:model-selection スキルや finetuning-technique スキルで選択済みの場合)は、それらをそのまま使用してください
    • コンテキストから取得できない場合は、処理を進める前に model-selection スキルおよび/または finetuning-technique スキルを起動して決定してください
    • 例外: ユーザーがトレーニング用データセットではなく評価用データセットを検証する場合、モデルも手法も必要ありません。フォーマット検出器は評価フォーマット(クエリ/レスポンス構造)を単独で検証できます。評価用データセットの検証において、model-selection や finetuning-technique の結果を待つ必要はありません。
  3. ファイルフォーマットの確認: format_detector.py ツールを実行し、ファイルがフォーマット要件に準拠していることを確認します。

    • フルパスを引数として format_detector スクリプトに直接渡してください
    • モデルや戦略は引数として渡さないでください
    • S3からデータをダウンロードしないでください
    • データのローカルコピーを作成しないでください
  4. 結果のまとめ: データが準備できているかどうかをユーザーに伝えます。

    • format_detector の出力を確認し、判明している戦略およびモデルと照合してください
    • 重要: トレーニング用データセットと評価用データセットでは、フォーマット要件が異なります。
      • トレーニング用データセットは、references/strategy_data_requirements.md に記載されたファインチューニング戦略のフォーマットに準拠している必要があります
      • 評価用データセット(モデル評価用)は、SageMaker評価用データセットフォーマットのいずれかに準拠している必要があります
      • カスタムスコアラー評価用データセットには、スコアラー固有の要件があります。データセットがカスタムスコアラー評価(Prime Math、Prime Code、またはカスタムLambda)を目的としている場合は、references/custom-scorer-evaluation-dataset-formats.md を参照し、スコアラー固有のスキーマに対して検証してください。スコアラーの種類は、会話コンテキスト(model-evaluation スキルで決定済み)から判明しているはずです。
    • 現在のデータセットが目的の用途に対して有効かどうかをユーザーに報告してください
    • データセットが有効であっても、異なる戦略またはモデル向けである場合は警告してください
    • データセットがいかなる戦略/モデルの組み合わせにも対応していない場合は警告してください
    • ユーザーが評価済みデータセットを使用してモデルをファインチューニングする予定がある場合、そのデータセットは予定しているトレーニングジョブと同じリージョン(通常はデフォルトリージョン)のS3バケットにアップロードされている必要があります。そうなっていない場合は警告してください。
    • データセットが必要なフォーマットに準拠していない場合は、dataset-transformation スキルを使用して変換することを推奨し、ユーザーの確認を待ったうえで、その回答に基づいてプランを更新してください

ユーザーへのメッセージ

  • 導入文: 「このスキルは、モデルのファインチューニングに向けてデータセットの構造を確認します。」
  • 対象ファイル形式: このスキルは、Amazon SageMaker AI デベロッパーガイドに従ってフォーマットされたファイルに適用されます

リソース

  • scripts/format_detector.py は単独で実行可能な、自己完結型のフォーマット検証スクリプトです
  • model-selection スキルおよび finetuning-technique スキルによって、ベースモデルとファインチューニング戦略がすでに決定されているはずです
  • references/strategy_data_requirements.md には、戦略ごとのデータフォーマット要件が記載されています

スクリプトの詳細

scripts/format_detector.py は単独で実行可能な自己完結型のフォーマット検証スクリプトです:

# ワークフローのステップ1で特定したファイルパスを引数として渡す
python scripts/format_detector.py local_path/to/dataset

参考資料

  • scripts/format_detector.py — 自己完結型のフォーマット検証スクリプト
  • references/strategy_data_requirements.md — 戦略ごとのデータフォーマット要件
原文(English)を表示

Workflow Instruction

Follow the workflow shown below. Locate the dataset, check the file type, and resolve any issues with missing files or wrong file types. Determine the fine-tuning model and fine-tuning strategy. Run the appropriate validation based on the model family. Summarize the results: is the dataset ready for fine-tuning?

Prerequisites

  • The SDK environment has been verified (SDK version, region, execution role). If not done, activate the sdk-getting-started skill first.

Workflow

  1. Locate Dataset:

    • The full path may be a local file path, or an S3 URI
    • Resolve the full path to the dataset file, make sure read permissions are available, and help the user if the file is not found
  2. Determine strategy and model:

    • File formatting depends on the currently selected fine-tuning strategy and fine-tuning base model.
    • If the strategy and model are already known from the conversation context (e.g., selected via the model-selection and finetuning-technique skills), use them.
    • If not available in context, activate the model-selection and/or finetuning-technique skills to determine them before proceeding.
    • Exception: If the user is validating an evaluation dataset (not a training dataset), neither model nor technique is required — the format detector can validate eval format (query/response structure) independently. Do not block on model-selection or finetuning-technique for eval dataset validation.
  3. Check File Formatting: Run the tool format_detector.py to make sure the file conforms to formatting requirements.

    • Send the full path directly to the format_detector script as an argument
    • Do not send the model and strategy as arguments
    • Do not download data from S3
    • Do not make local copies of data
  4. Summarize Results: Tell the user if their data is ready

    • Examine the output of format_detector and compare to the known strategy and model
    • Important: training datasets and evaluation datasets have different format requirements.
      • Training datasets must match the fine-tuning strategy format per references/strategy_data_requirements.md
      • Evaluation datasets (for model evaluation) must match one of the SageMaker evaluation dataset formats.
      • Custom Scorer evaluation datasets have scorer-specific requirements. If the dataset is intended for Custom Scorer evaluation (Prime Math, Prime Code, or Custom Lambda), read references/custom-scorer-evaluation-dataset-formats.md and validate against the scorer-specific schema. The scorer type should be known from conversation context (determined in the model-evaluation skill).
    • Report back to the user if their current dataset is valid for its intended purpose
    • Warn the user if their dataset is valid, but for a different strategy or model
    • Warn the user if their dataset is not valid for any strategy/model pair
    • If the user plans to finetune a model with the evaluated dataset, it needs to be uploaded to an S3 bucket in the same region as the planned training job (usually the default region). Warn the user if this is NOT the case.
    • If the dataset is NOT in the necessary format, recommend transforming it using the dataset-transformation skill, wait for user confirmation, and update the plan based on their response

Messages to the User

  • Introduction: "This skill checks the structure of your dataset for model fine-tuning."
  • File types: This skill applies to files that are formatted according to the Amazon SageMaker AI Developer Guide

Resources

  • scripts/format_detector.py is self-contained format validation script that can be run independently
  • model-selection and finetuning-technique skills should have already determined the base model and fine-tuning strategy
  • references/strategy_data_requirements.md contains data format requirements per strategy

Script Details

  • scripts/format_detector.py is self-contained format validation script that can be run independently:
# With the file path argument identified in workflow step 1
python scripts/format_detector.py local_path/to/dataset

References

  • scripts/format_detector.py — Self-contained format validation script
  • references/strategy_data_requirements.md — Data format requirements per strategy

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。