你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Examples - Batch
Adds a batch of labeled example utterances to a version of the application.
POST {Endpoint}/luis/authoring/v3.0-preview/apps/{appId}/versions/{versionId}/examples
POST {Endpoint}/luis/authoring/v3.0-preview/apps/{appId}/versions/{versionId}/examples?enableNestedChildren={enableNestedChildren}
Name | In | Required | Type | Description |
---|---|---|---|---|
app
|
path | True |
string uuid |
The application ID. |
Endpoint
|
path | True |
string |
Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). |
version
|
path | True |
string |
The version ID. |
enable
|
query |
boolean |
Toggles nested/flat format |
Name | Required | Type | Description |
---|---|---|---|
Ocp-Apim-Subscription-Key | True |
string |
Name | Type | Description |
---|---|---|
exampleLabelObjectArray |
Array of example utterances. |
Name | Type | Description |
---|---|---|
201 Created |
A string array determining which labeled example utterances were added successfully. |
|
Other Status Codes |
Indicates that the request was partially successful. The response contains a string array indicating the status of each of the added labeled example utterances. |
|
Other Status Codes |
Error Response. |
Type:
apiKey
In:
header
Sample request
POST {Endpoint}/luis/authoring/v3.0-preview/apps/2370fb9d-7dbc-4898-a361-a742cf290766/versions/0.1/examples?enableNestedChildren=False
[
{
"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"
}
]
Sample response
[
{
"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
}
]
Name | Description |
---|---|
Batch |
Response when adding a batch of labeled example utterances. |
Entity |
Defines the entity type and position of the extracted entity within the example. |
Error |
Error response when invoking an operation on the API. |
Example |
A labeled example utterance. |
Label |
Response when adding a labeled example utterance. |
Operation |
Response of an Operation status. |
Operation |
Status Code. |
Response when adding a batch of labeled example utterances.
Name | Type | Description |
---|---|---|
error |
Response of an Operation status. |
|
hasError |
boolean |
|
value |
Response when adding a labeled example utterance. |
Defines the entity type and position of the extracted entity within the example.
Name | Type | Description |
---|---|---|
children |
The identified entities within the example utterance. |
|
endCharIndex |
integer |
The index within the utterance where the extracted entity ends. |
entityName |
string |
The entity type. |
role |
string |
The role the entity plays in the utterance. |
startCharIndex |
integer |
The index within the utterance where the extracted entity starts. |
Error response when invoking an operation on the API.
Name | Type | Description |
---|---|---|
errorType |
string |
A labeled example utterance.
Name | Type | Description |
---|---|---|
entityLabels |
The identified entities within the example utterance. |
|
intentName |
string |
The identified intent representing the example utterance. |
text |
string |
The example utterance. |
Response when adding a labeled example utterance.
Name | Type | Description |
---|---|---|
ExampleId |
integer |
The newly created example ID. |
UtteranceText |
string |
The example utterance. |
Response of an Operation status.
Name | Type | Description |
---|---|---|
code |
Status Code. |
|
message |
string |
Status details. |
Status Code.
Name | Type | Description |
---|---|---|
FAILED |
string |
|
Failed |
string |
|
Success |
string |