Train - Train Version
发送指定 LUIS 应用的版本的训练请求。 此 POST 请求以异步方式启动请求。 若要确定训练请求是否成功,请提交 GET 请求以获取训练状态。 注意:除非所有模型(意向和实体)都已成功训练或处于最新状态,否则不会完全训练应用程序版本。 若要验证训练是否成功,请在训练完成后至少获取一次训练状态。
POST {Endpoint}/luis/api/v2.0/apps/{appId}/versions/{versionId}/train
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 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 202 Accepted |
此响应指示初始训练状态。 |
|
| Other Status Codes |
错误响应。 |
安全性
Ocp-Apim-Subscription-Key
类型:
apiKey
在:
header
示例
Successful Train Application Version request
示例请求
POST {Endpoint}/luis/api/v2.0/apps/86226c53-b7a6-416f-876b-226b2b5ab07b/versions/0.1/train
示例响应
{
"statusId": 9,
"status": "Queued"
}
定义
| 名称 | 说明 |
|---|---|
|
Enqueue |
请求训练模型时响应模型。 |
|
Error |
调用 API 上的作时出现错误响应。 |
|
Training |
训练状态。 |
EnqueueTrainingResponse
请求训练模型时响应模型。
| 名称 | 类型 | 说明 |
|---|---|---|
| status |
训练状态。 |
|
| statusId |
integer |
训练请求状态 ID。 |
ErrorResponse
调用 API 上的作时出现错误响应。
| 名称 | 类型 | 说明 |
|---|---|---|
| errorType |
string |
TrainingStatus
训练状态。
| 值 | 说明 |
|---|---|
| Queued | |
| InProgress | |
| UpToDate | |
| Fail | |
| Success |