选择您的 Cookie 首选项

我们使用必要 Cookie 和类似工具提供我们的网站和服务。我们使用性能 Cookie 收集匿名统计数据,以便我们可以了解客户如何使用我们的网站并进行改进。必要 Cookie 无法停用,但您可以单击“自定义”或“拒绝”来拒绝性能 Cookie。

如果您同意,AWS 和经批准的第三方还将使用 Cookie 提供有用的网站功能、记住您的首选项并显示相关内容,包括相关广告。要接受或拒绝所有非必要 Cookie,请单击“接受”或“拒绝”。要做出更详细的选择,请单击“自定义”。

为使用模型作为判断的模型评估作业创建提示数据集

聚焦模式
为使用模型作为判断的模型评估作业创建提示数据集 - Amazon Bedrock

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

要创建使用模型作为判断的模型评估作业,必须指定提示数据集。此提示数据集使用与自动模型评估任务相同的格式,并且在推理期间使用您选择评估的模型。

如果您想使用已经生成的响应来评估非 Amazon Bedrock 模型,请按中所述将其包含在提示数据集中。使用您自己的推理响应数据为评估任务准备数据集当您提供自己的推理响应数据时,Amazon Bedrock 会跳过模型调用步骤,并使用您提供的数据执行评估任务。

自定义提示数据集必须存储在 Amazon S3 中,并使用 JSON 行格式和.jsonl文件扩展名。每行都必须是有效的 JSON 对象。每个评估任务的数据集中最多可以有 1000 条提示。

对于使用控制台创建的任务,您必须更新 S3 存储桶上的跨源资源共享 (CORS) 配置。要了解有关所需 CORS 权限的更多信息,请参阅 S3 存储桶所需的跨源资源共享 (CORS) 权限

为 Amazon Bedrock 为您调用模型的评估工作准备数据集

要运行 Amazon Bedrock 为您调用模型的评估任务,请创建一个包含以下键值对的提示数据集:

  • prompt— 您希望模特响应的提示。

  • referenceResponse—(可选)基本真相响应。

  • category–(可选)生成每个类别报告的评估分数。

注意

如果您选择提供基本真相响应 (referenceResponse),Amazon Bedrock 将在计算完整性 (Builtin.Completeness) 和正确性 () 指标时使用此参数。Builtin.Correctness您也可以在不提供真实情况响应的情况下使用这些指标。要查看这两种场景的裁判提示,请参阅中您选择的评委模型部分内置指标评估器提示 model-as-a-judge评估作业

下面是一个包含 6 个输入并使用了 JSON 行格式的自定义数据集示例。

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

为了清晰起见,以下示例是一个扩展的条目。在实际的提示数据集中,每行都必须是有效的 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." }

使用您自己的推理响应数据为评估任务准备数据集

要使用已生成的响应运行评估作业,请创建一个包含以下键值对的提示数据集:

  • prompt— 您的模型用来生成响应的提示。

  • referenceResponse—(可选)基本真相响应。

  • category–(可选)生成每个类别报告的评估分数。

  • modelResponses— 你希望 Amazon Bedrock 评估的你自己推断的回应。使用模型作为评判的评估作业仅支持每个提示的一个模型响应,使用以下键定义:

    • response— 包含模型推断响应的字符串。

    • modelIdentifier— 标识生成响应的模型的字符串。在评估作业modelIdentifier中,您只能使用一个唯一标识符,并且数据集中的每个提示都必须使用此标识符。

注意

如果您选择提供基本真相响应 (referenceResponse),Amazon Bedrock 将在计算完整性 (Builtin.Completeness) 和正确性 () 指标时使用此参数。Builtin.Correctness您也可以在不提供真实情况响应的情况下使用这些指标。要查看这两种场景的裁判提示,请参阅中您选择的评委模型部分内置指标评估器提示 model-as-a-judge评估作业

以下是一个自定义示例数据集,包含 6 个输入,采用 JSON 行格式。

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

以下示例显示了为清晰起见展开的提示数据集中的单个条目。

{ "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": "my_model" } ] }
隐私网站条款Cookie 首选项
© 2025, Amazon Web Services, Inc. 或其附属公司。保留所有权利。