

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

# 管理测试集
<a name="manage-test-sets"></a>

您可以从测试集窗口下载、更新和删除测试集，也可以使用可用测试集列表来编辑或手动注释您的测试集文件。然后，由于错误或其他输入问题，请再次上传以重试验证。

**要从测试集记录下载测试集文件，请执行以下操作：**

1. 从测试集列表中选择测试集的名称。

1. 在测试集记录窗口中，请在屏幕右侧**测试输入**部分中点击**下载**按钮。

1. 如果窗口顶部有关于测试集的任何验证错误详细信息，请点击**下载**按钮。该文件将保存到“下载”文件夹中。您可以通过测试集 CSV 文件中的错误消息来修复测试集中的验证错误。找到在验证步骤中发现的错误，修复该行或将其删除，然后上传文件以重试验证步骤。

1. 如果您成功下载了测试集，则会显示一条绿色横幅消息。

**要从测试集列表中下载测试集，请执行以下操作：**

1. 在测试集列表中选中要下载的测试集项目旁边的单选按钮。

1. 在右上角的“操作”菜单中选择**下载**。

1. 如果您成功下载了测试集，则会显示一条绿色横幅消息。该文件将保存到“下载”文件夹中。

# 测试工作台支持的测试集列
<a name="file-input-test-sets"></a>

以下是测试工作台支持的测试集列的完整列表以及如何在 Amazon Lex V2 中使用这些列的说明。


| 列名称 | 测试集类型 | 值类型 | 多列支持 | 说明 | 
| --- | --- | --- | --- | --- | 
|  行号  |  文本和音频  | 数字 | 否 | 这是一个 Amazon Lex V2 会忽略的用户列。测试集编写者可以通过此列对测试集行进行排序和筛选。“行号”可用作备用列名。 | 
|  对话编号  |  文本和音频  | 数字 | 否 | 此列可以让您将对话中的行放在一起。“Conversation \$1”可用作备用列名。 | 
|  来源  |  文本和音频  | 枚举（“用户”、“代理”） | 否 | 此列中的值表示该行是针对用户还是代理。“Conversation Participant”可用作备用列名。 | 
|  Input  |  文本  | 字符串 | 否 | 此列用于添加文本测试集的转录文本。应在用户行中使用文本输入。应在代理行中使用代理提示。 | 
|  预期转录文本  |  音频  | 字符串 | 否 | 此列用于添加音频测试集的转录文本。应在带有音频输入的用户行中使用音频文件的预期转录文本。可以在带有 DTMF 输入的用户行中使用 DTMF 输入。应在代理行中使用代理提示。 | 
|  S3 音频位置  |  音频  | 字符串 | 否 | 此列用于添加音频文件位置，并且仅适用于音频测试集。应在带有音频输入的用户行中使用 S3 路径。在带有 DTMF 输入的用户行中，此字段应留空。在代理行中，此字段应留空。 | 
|  输入上下文标签  |  文本和音频  | 字符串 | 是 | 此列用于提供输入上下文的名称，该上下文将在执行测试集中的行时用于 Lex 的输入。这指的是[为 Lex V2 机器人设置意图上下文](https://docs.aws.amazon.com/lexv2/latest/dg/context-mgmt-active-context.html)中的输入上下文。请注意，测试工作台仅支持上下文的名称。它不支持上下文中的参数。可以使用多个列，分别名为“输入上下文标签 1”、“输入上下文标签 2”等。 | 
|  请求属性  |  文本和音频  | 字符串 | 是 | 此列用于提供请求属性，该属性将在执行测试集中的行时用于 Lex 的输入。列中的值应以 `< request-attribute-name > = < request-attribute-value >` 的格式提供。为了增加可读性，可以在“=”两边添加空格。例如： request-attribute-foo= 这是一个虚拟响应 request-attribute-foo = '这是 “虚拟响应” ' request-attribute-foo= “这是'虚拟响应'”。可以使用多个列，分别名为“请求属性 1”、“请求属性 2”等。 | 
|  会话属性  |  文本和音频  | 字符串 | 是 | 此列用于提供会话属性，该属性将在执行测试集中的行时用于 Lex 的输入。 [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/lexv2/latest/dg/file-input-test-sets.html)  | 
|  RunTime 提示  |  文本和音频  | 字符串 | 是 | 此列用于为意图内的插槽提供运行时提示，该上下文将在执行测试集中的行时用于 Lex 的输入。下面是示例： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/lexv2/latest/dg/file-input-test-sets.html)  | 
|  插入  |  音频  | 布尔值 | 否 | 此列用于指定在将测试集中该行的音频文件发送到 Lex 运行时的时候，测试工作台是否应插入。 [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/lexv2/latest/dg/file-input-test-sets.html)  | 
|  预期输出意图  |  文本和音频  | 字符串 | 否 | 此列用于为测试集中的行指定 Lex 输出中预期的意图名称。 | 
|  预期输出插槽  |  文本和音频  | 字符串 | 是 | 此列用于提供在执行测试集中的行时 Lex 输出中预期的插槽值。 [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/lexv2/latest/dg/file-input-test-sets.html)  | 
|  预期输出上下文标签  |  文本和音频  | 字符串 | 是 | 此列用于为测试集中的行指定 Lex 输出中预期的输出上下文名称。 [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/lexv2/latest/dg/file-input-test-sets.html)  | 

# 在 Test Workbench 中查看测试验证错误
<a name="view-errors-test-sets"></a>

您可以对报告验证错误的测试集进行更正。如果测试集尚未准备好进行测试，就会生成这些验证错误。Test Workbench 可以显示测试集输入 CSV 文件中哪些必填列不存在预期格式的值。

**要查看测试验证错误，请执行以下操作：**

1. 在测试集列表中选择要查看的报告状态为**验证错误**的测试集的名称。测试集的名称是有效链接，点击该链接可跳转至相关页面以查看有关测试集的详细信息。

1. 测试集记录在屏幕顶部显示验证错误的详细信息。选择**查看详细信息**以查看验证错误报告。

1. 在错误报告窗口中，依据行号和错误类型来确定发生错误的位置。对于一长串错误，您可以选择**下载**错误报告。

1. 将测试集输入 CSV 文件中列出的错误与原始测试文件进行比较，以更正所有问题并重新上传测试集。

下表列出了输入 CSV 验证错误消息及对应场景。


| 场景 | 错误消息 | 注意 | 
| --- | --- | --- | 
|  超出测试集文件大小限制  |  测试集文件大于 200 MB. Provide smaller file and try your request again.  |  | 
| 测试集超过最大记录数 | Input file had records more than supported maximum number of 200,000. |  | 
| 上传的测试集为空 | Imported test set is empty. Provide non-empty test set and try your request again. |  | 
| 列标题名称为空 | Column Headers Row: found empty column name in column number 5. |  | 
| 列标题名称无法识别 | Column Headers Row: could not recognize column name 'dummy' in column number 2. |  | 
| 列标题名称重复 | Column Headers Row: found multiple columns 'S3 audio link' and 'S3 audio link' that are same or equivalent. Remove or rename one of those columns. |  | 
| 多值列名超出限制 | Column Headers Row: count of columns for 'Expected Output Slot' exceeded maximum supported count: 6. Remove some columns for 'Expected Output Slot' and try again. | 多值列支持的最大列数为 6。  | 
| 文本或音频相关的列标题不存在 | Could not find columns for text or audio conversations. For text conversations, use \$1'Text input'\$1 columns. For audio conversations, use \$1'S3 audio link', 'Expected transcription'\$1 columns. | 必填音频列：\$1'S3 audio link', 'Expected transcription'\$1，必填文本列：\$1'Text input'\$1 | 
| 存在与文本和音频均相关的列标题  | Found columns for both text and audio conversations. You can either use \$1'Text input'\$1 columns for text conversations, or \$1'S3 audio link', 'Expected transcription'\$1 columns for audio conversations. | 必填音频列：\$1'S3 audio link', 'Expected transcription'\$1，必填文本列：\$1'Text input'\$1 | 
| 缺少必填列 | Could not find mandatory columns ["Expected Output Intent"]. | 必填列：\$1"Line \$1", "Source", "Expected Output Intent"\$1 | 
| 存在有数据但无标题的列 | Found data in column number 8 for row number 6, but corresponding column did not have a column header. |  | 
| 必填列无数据 | Row=12: no values found for mandatory columns: \$1"Source", "Expected Output Intent"\$1 |  | 
| 对话 ID 重复 | conversation number '19' was seen for previous conversation at row number 39." Make sure that same conversation number has not been provided for two conversations, you can do this by ensuring that all rows for a conversation number are grouped together. |  | 
| 提供的对话 ID 无效 | Found invalid value 'test\$1conversation' in 'Conversation \$1' column. 对于用户行，此列的值必须为数字或 N/A （即 “不适用”）。 |  | 
| 行号列的值为非数字 | Found non-numeric value 'test\$1line' in 'Line \$1' column. Its value must be numeric. |  | 
| 代理行中无会话 ID | No value found for 'Conversation \$1' column. It must be provided for an agent row. |  | 
| 代理行中无数值会话 ID | Found non-numeric value 'test\$1conversation' in 'Conversation \$1' column. Its value must be numeric for an agent row. |  | 
| S3 位置无效 | Invalid value 'bucket/folder' was provided. Valid format is S3://<bucketName>/<keyName>. |  | 
| S3 存储桶名称无效 | Invalid s3 bucket name 'test\$1bucket' was provided. Check the bucket name. |  | 
| S3 音频位置为文件夹 | Provided audio location 'S3://bucket/folder' is invalid. It points to an S3 folder. |  | 
| 意图名称无效 | Invalid characters were present in intent 'intent@name'. Check the intent name. | 正则表达式检查：^（[0-9a-zA-Z][\$1-]?）\$1\$1 | 
| 槽名称无效 | Invalid characters were present in slot 'Slot@Name'. Check the slot name. | 正则表达式：^（[0-9a-zA-Z][\$1-]?）\$1\$1，开头或结尾不得为点（.） | 
| 槽位值被赋予父槽位 | Slot values were provided for subslot 'Address.City' as well as parent slot 'Address'. Values should be only provided for the subslot. | CST 中的父槽位不得有槽位值 | 
| 上下文名称中的字符无效 | Invalid characters were present in context name 'context@1'. Check the context name. | 正则表达式：^（[A-Za-z]\$1?）\$1\$1 | 
| 槽位拼写样式无效 | Invalid value 'test' was provided. Make sure that they are all upper case. 有效值为 ["默认”、SpellByLetter “”、SpellByWord “]。 | 支持的值 ["默认”、SpellByLetter “”、“SpellByWord” | 
| 参与者或来源必须是代理或用户 | Invalid value 'bot' was provided. Valid values are ["Agent", "User"]. | 支持的枚举：“代理”、“用户” | 
| 行号不得为小数 | Invalid value '10.1' was provided. It should be a valid number without any fractions. |  | 
| 对话编号不得为小数 | Invalid value '10.1' was provided. It should be a valid number without any fractions. |  | 
| 行号应在限定范围内 | Invalid value '92233720368547758071' was provided. It should be greater than or equal to 1 and less than or equal to 9223372036854775807. |  | 
| 插入列只能为布尔值 | Invalid value 'test' was provided. It should be a valid boolean value such as 'true' or 'false'. Alternatively 'yes' and 'no' can be used. | 可能的值：“True”、“true”、“T”、“Yes”、“yEs”、“Y”、“1”、“1.0”、“False”、“false”、“F”、“No”、“no”、“N”、“0”、“0.0” | 
| 预期槽位、会话属性、请求属性应以等于号（=）隔开 | Value 'slotName:slotValue' does not have '='. Such value should be provided as a key-value pair in format '<key>=<value>'. | 例如：slotName = slotType | 
| 预期槽位、会话属性、请求属性应为密钥值对 | '=slotValue' does not have a key before '='. Such value should be provided as a key-value pair in format '<key>=<value>'. | 例如：slotName = slotType | 
| 结尾处的引号无效  | 在 'Foo's item'“ 中发现了不正确的引号使用。It starts with quote character `"` but does not end with same quote character. | 例如：`"Foo's item", KFC` | 
| 中间的引号无效 | 在 `"Foo's" Burger, etc.` 中发现了不正确的引号使用。It contains quote character `"` inside its content. Values containing single quotes should be wrapped within double quotes and vice-versa. | 例如，正确格式应为：`"Foo's item", KFC` | 
| 缺少引号 | `key = Foo's item` 包含单引号或双引号，但未用引号括起来。Values containing single quotes should be wrapped inside double quotes and vice-versa. |  | 
| 列中多处存在重复密钥  | Key `key1` was repeated in two columns: `Session Attribute 3` and `Session Attribute 1`. |  | 
| 运行时提示中的格式无效 | 密钥无效 `BookFlight.Car。 “`为运行时提示提供。对于运行时提示，密钥应采用格式 <intentName>.<slotName>。 | 如果 '.' 必须出现在密钥中间，则无法从该密钥中提取意图名称和插槽名称。格式错误的示例：BookFlight“，”。 BookFlight.Car”、“BookFlight.Car。” | 
| 运行时提示键中的意图名称无效 | Found invalid intent `intent@name` for Runtime Hints. Check intent name. | 正则表达式检查：^（[0-9a-zA-Z][\$1-]?）\$1\$1 | 
| 运行时提示键中的槽位名称无效 | Found invalid slot name in `Slot@Name` for Runtime Hints. Check slot name. | 正则表达式：^（[0-9a-zA-Z][\$1-]?）\$1\$1，开头或结尾不得为点（.） | 

# 在 Test Workbench 中删除测试集
<a name="delete-test-sets"></a>

您可以轻松地从测试集列表中删除测试集。

**要删除测试集，请执行以下操作：**

1. 从左侧菜单转到**测试集**列表以查看测试集。

1. 在测试集列表中选择要删除的测试集。

1. 点击右上角的**操作**下拉菜单，然后选择**删除**。

1. 系统将显示一条消息，确认测试集已删除。

# 编辑测试集详细信息
<a name="edit-details-test-sets"></a>

您可以在测试集列表中编辑测试集名称和详细信息。测试集的名称或详细信息可以在后期添加或更新。但是，在使用机器人或转录数据运行测试之前，必须更新测试集。

**要编辑测试集详细信息，请执行以下操作：**

1. 从左侧菜单转到测试集列表以查看测试集。

1. 在测试集列表中，选中要编辑测试集的复选框。

1. 点击右上角的**操作**下拉菜单，然后选择**编辑详细信息**。

1. 系统将显示一条消息，确认测试集的编辑已成功保存。

# 更新测试集
<a name="update-test-sets"></a>

您可以更新、更正、修改或删除测试集中的项目，以优化基准结果，或者更正测试集中可能出现的其他错误

您可以先下载测试集并修复验证错误，然后再上传更正后的测试集。请参见[查看测试验证错误](https://docs.aws.amazon.com/lexv2/latest/dg/view-errors-test-sets.html)。

**要更新测试集，请执行以下操作：**

1. 在测试集记录中，点击右上角的**更新测试集**按钮。

1. 选择要从您的 Amazon S3 账户上传的文件，或者从您的计算机上传 CSV 测试文件。注意：更新测试集将覆盖现有数据。

1. 点击**更新**按钮。

1. 系统将显示一条消息，确认测试集已成功更新。注意：该操作可能需要几分钟完成，具体取决于测试集的复杂性和大小。

1. 系统将显示一条消息，确认测试集已成功更新，同时**状态**将变为**准备进行测试**。