你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Examples - Batch
将一批标记的示例话语添加到应用程序的某个版本。
POST {Endpoint}/luis/api/v2.0/apps/{appId}/versions/{versionId}/examples
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
app
|
path | True |
string (uuid) |
应用程序 ID。 |
Endpoint
|
path | True |
string |
支持的认知服务终结点(协议和主机名,例如:https://westus.api.cognitive.microsoft.com)。 |
version
|
path | True |
string |
版本 ID。 |
请求头
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
Ocp-Apim-Subscription-Key | True |
string |
请求正文
名称 | 类型 | 说明 |
---|---|---|
exampleLabelObjectArray |
示例话语的数组。 |
响应
名称 | 类型 | 说明 |
---|---|---|
201 Created |
一个字符串数组,用于确定已成功添加哪些标记的示例话语。 |
|
Other Status Codes |
指示请求部分成功。 响应包含一个字符串数组,指示添加的每个已添加的示例话语的状态。 |
|
Other Status Codes |
错误响应。 |
安全性
Ocp-Apim-Subscription-Key
类型:
apiKey
在:
header
示例
Successful Batch Add Labels request
示例请求
POST {Endpoint}/luis/api/v2.0/apps/2370fb9d-7dbc-4898-a361-a742cf290766/versions/0.1/examples
[
{
"text": "whats the weather in seattle?",
"entityLabels": [
{
"entityName": "Place",
"startCharIndex": 21,
"endCharIndex": 29
}
],
"intentName": "WeatherInPlace"
},
{
"text": "whats the weather in buenos aires?",
"entityLabels": [
{
"entityName": "Place",
"startCharIndex": 21,
"endCharIndex": 34
}
],
"intentName": "WeatherInPlace"
}
]
示例响应
[
{
"value": {
"UtteranceText": "whats the weather in seattle?",
"ExampleId": -728104
},
"hasError": false
},
{
"value": {
"UtteranceText": "whats the weather in buenos aires?",
"ExampleId": -5313943
},
"hasError": false
}
]
[
{
"hasError": true,
"error": {
"code": "FAILED",
"message": "whats the weather in seattle?. Error: The intent classifier InvalidIntent does not exist in the selected application"
}
},
{
"value": {
"UtteranceText": "whats the weather in buenos aires?",
"ExampleId": -5313943
},
"hasError": false
}
]
定义
名称 | 说明 |
---|---|
Batch |
添加一批标记的示例话语时的响应。 |
Entity |
定义提取实体在示例中的实体类型和位置。 |
Error |
调用 API 上的作时出现错误响应。 |
Example |
标记的示例话语。 |
Label |
添加标记的示例话语时的响应。 |
Operation |
作状态的响应。 |
Operation |
状态代码。 |
BatchLabelExample
添加一批标记的示例话语时的响应。
名称 | 类型 | 说明 |
---|---|---|
error |
作状态的响应。 |
|
hasError |
boolean |
|
value |
添加标记的示例话语时的响应。 |
EntityLabelObject
定义提取实体在示例中的实体类型和位置。
名称 | 类型 | 说明 |
---|---|---|
endCharIndex |
integer |
提取的实体结束的话语中的索引。 |
entityName |
string |
实体类型。 |
role |
string |
陈述中实体的角色。 |
startCharIndex |
integer |
提取的实体启动的话语中的索引。 |
ErrorResponse
调用 API 上的作时出现错误响应。
名称 | 类型 | 说明 |
---|---|---|
errorType |
string |
ExampleLabelObject
标记的示例话语。
名称 | 类型 | 说明 |
---|---|---|
entityLabels |
示例话语中的标识实体。 |
|
intentName |
string |
表示示例话语的已标识意向。 |
text |
string |
示例话语。 |
LabelExampleResponse
添加标记的示例话语时的响应。
名称 | 类型 | 说明 |
---|---|---|
ExampleId |
integer (int64) |
新建的示例 ID。 |
UtteranceText |
string |
示例话语。 |
OperationStatus
作状态的响应。
名称 | 类型 | 说明 |
---|---|---|
code |
状态代码。 |
|
message |
string |
状态详细信息。 |
OperationStatusType
状态代码。
值 | 说明 |
---|---|
FAILED | |
Failed | |
Success |