翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
マニフェストファイルの形式
以下のセクションでは、入力、出力、評価ファイルの、マニフェストファイル形式の例について説明します。
入力マニフェスト
マニフェストファイルは JSON 行で区切られたファイルであり、各行には、1 つのイメージに関する情報を含んだ JSON が含まれています。
入力マニフェストの各エントリには、Amazon S3 バケット内のイメージへのパスを含む source-ref フィールドと、カスタムモデレーションの場合は、グラウンド注釈の付いた content-moderation-groundtruth フィールドが含まれている必要があります。1 つのデータセット内のイメージはすべて、同じバケットに入れるようにします。この構造は、トレーニングマニフェストファイルとテストマニフェストファイルの両方に共通です。
カスタムモデレーションの CreateProjectVersion オペレーションでは、入力マニフェストで提供される情報を使用してアダプターをトレーニングします。
以下の例は、安全でないクラスが 1 つ含まれる 1 つのイメージの、マニフェストファイルに含まれる 1 行です。
{ "source-ref": "s3://foo/bar/1.jpg", "content-moderation-groundtruth": { "ModerationLabels": [ { "Name": "Rude Gesture" } ] } }
次の例は、複数の安全でないクラス (特に「ヌード」や「失礼なジェスチャー」) を含む、1 つの安全でないイメージの、マニフェストファイルに含まれる 1 行です。
{ "source-ref": "s3://foo/bar/1.jpg", "content-moderation-groundtruth": { "ModerationLabels": [ { "Name": "Rude Gesture" }, { "Name": "Nudity" } ] } }
以下の例は、安全でないクラスを含まない 1 つのイメージの、マニフェストファイルに含まれる 1 行です。
{ "source-ref": "s3://foo/bar/1.jpg", "content-moderation-groundtruth": { "ModerationLabels": [] } }
サポートされているラベルの完全なリストについては、「Moderating content」を参照してください。
出力マニフェスト
トレーニングジョブが完了すると、出力マニフェストファイルが返されます。出力マニフェストファイルは JSON 行で区切られたファイルであり、各行には、1 つのイメージに関する情報を含んだ JSON が含まれています。OutputManifest への Amazon S3 パスは、DescribeProjectVersion レスポンスから取得できます。
-
TrainingDataResult.Output.Assets[0].GroundTruthManifest.S3Object、トレーニングデータセット用 -
TestingDataResult.Output.Assets[0].GroundTruthManifest.S3Object、テストデータセット用
次の情報が、出力マニフェストの各エントリについて返されます。
| Key Name | Description |
source-ref
|
Reference to an image in s3 that was provided in the input maniefst |
content-moderation-groundtruth
|
Ground truth annotations that were provided in the input manifest |
detect-moderation-labels
|
Adapter predictions, part of the testing dataset only |
detect-moderation-labels-base-model
|
Base model predictions, part of the testing dataset only |
アダプターとベースモデルの予測は、DetectModerationLabels レスポンスと同様の形式で、ConfidenceTrehsold 5.0 で返されます。
以下の例は、アダプターとベースモデルの予測の構造を示しています。
{ "ModerationLabels": [ { "Confidence": number, "Name": "string", "ParentName": "string" } ], "ModerationModelVersion": "string", "ProjectVersion": "string" }
返されるラベルの完全なリストについては、「Moderating content」を参照してください。
評価結果マニフェスト
トレーニングジョブが完了すると、評価結果マニフェストファイルが返されます。評価結果マニフェストはトレーニングジョブによって出力される JSON ファイルであり、アダプターがテストデータに対してどの程度うまく機能したかを示す情報が含まれています。
評価結果マニフェストへの Amazon S3 のパスは、DescribeProejctVersion レスポンスの EvaluationResult.Summary.S3Object フィールドから取得できます。
次の例は、評価結果マニフェストの構造を示したものです。
{ "AggregatedEvaluationResults": { "F1Score": number }, "EvaluationDetails": { "EvaluationEndTimestamp": "datetime", "Labels": [ "string" ], "NumberOfTestingImages": number, "NumberOfTrainingImages": number, "ProjectVersionArn": "string" }, "ContentModeration": { "InputConfidenceThresholdEvalResults": { "ConfidenceThreshold": float, "AggregatedEvaluationResults": { "BaseModel": { "TruePositive": int, "TrueNegative": int, "FalsePositive": int, "FalseNegative": int }, "Adapter": { "TruePositive": int, "TrueNegative": int, "FalsePositive": int, "FalseNegative": int } }, "LabelEvaluationResults": [ { "Label": "string", "BaseModel": { "TruePositive": int, "TrueNegative": int, "FalsePositive": int, "FalseNegative": int }, "Adapter": { "TruePositive": int, "TrueNegative": int, "FalsePositive": int, "FalseNegative": int } } ] } "AllConfidenceThresholdsEvalResults": [ { "ConfidenceThreshold": float, "AggregatedEvaluationResults": { "BaseModel": { "TruePositive": int, "TrueNegative": int, "FalsePositive": int, "FalseNegative": int }, "Adapter": { "TruePositive": int, "TrueNegative": int, "FalsePositive": int, "FalseNegative": int } }, "LabelEvaluationResults": [ { "Label": "string", "BaseModel": { "TruePositive": int, "TrueNegative": int, "FalsePositive": int, "FalseNegative": int }, "Adapter": { "TruePositive": int, "TrueNegative": int, "FalsePositive": int, "FalseNegative": int } } ] } ] } }
評価マニフェストファイルには以下が含まれます。
-
F1Scoreにより定義された集計された結果。 -
ProjectVersionArn、トレーニングイメージの数、テストイメージの数、アダプターのトレーニングに使用されたラベルなど、評価ジョブの詳細。
-
ベースモデルとアダプターのパフォーマンスの両方に関する TruePositive、TrueNegative、FalsePositive、FalseNegative の集計結果。
-
ベースモデルとアダプターのパフォーマンスの両方に関する、入力信頼度しきい値で計算された TruePositive、TrueNegative、FalsePositive、FalseNegative のラベルごとの結果。
-
ベースモデルとアダプターのパフォーマンスの両方に関する、入力信頼度しきい値で計算された TruePositive、TrueNegative、FalsePositive、FalseNegative の集計結果およびラベルごとの結果。信頼度しきい値は 5~100 の範囲の 5 の倍数。