你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Train - Get Status

获取指定 LUIS 应用的所有模型(意向和实体)的训练状态。 在调用此 API 以获取训练状态之前,必须调用训练 API 来训练 LUIS 应用。 “appID”指定 LUIS 应用 ID。 “versionId”指定 LUIS 应用的版本号。 例如,“0.1”。

GET {Endpoint}/luis/api/v2.0/apps/{appId}/versions/{versionId}/train

URI 参数

名称 必需 类型 说明
appId
path True

string (uuid)

应用程序 ID。

Endpoint
path True

string

支持的认知服务终结点(协议和主机名,例如:https://westus.api.cognitive.microsoft.com)。

versionId
path True

string

版本 ID。

请求头

名称 必需 类型 说明
Ocp-Apim-Subscription-Key True

string

响应

名称 类型 说明
200 OK

ModelTrainingInfo[]

成功的响应为为为训练提交的 LUIS 应用提供一系列训练状态详细信息。 响应数组中的每个元素都为 LUIS 应用中的模型(意向或实体)提供训练状态。 注意:未为预生成实体提供训练状态,因为它们已预先训练。 “modelId”属性标识训练状态对应的意向或实体。 若要获取每个模型的名称和类型,请使用具有以下格式的请求 URL 的模型 API:https://westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/{appId}/versions/{versionId}/models 每个模型的详细信息属性可以包含以下字段:“statusId”:对应于状态字段值的 0 到 3 的整数。 “status”:具有以下值之一的字符串:“Success”、“UpToDate”、“InProgress”、“Fail”。 如果状态为“Fail”,则“failureReason”属性提供失败的原因。 “exampleCount”:用于训练的示例数。 对于 None 意向或预生成的域意向和实体,此数字包括系统内部提供的示例以及添加到 LUIS 应用的示例。 “failureReason”:一个字符串,指示训练失败的原因。 值“FewLabels”表示没有为训练提供标记的示例话语。 “trainingDateTime”:一个字符串,指示模型上次训练的时间。 该值使用 ISO 8601 格式来表示 UTC(协调世界时)中的时间(“Z”),例如:“2017-08-10T01:08:34Z”。

Media Types: "application/json", "JSON"

Other Status Codes

ErrorResponse

错误响应。

Media Types: "application/json", "JSON"

安全性

Ocp-Apim-Subscription-Key

类型: apiKey
在: header

示例

Successful Get Application Version Training Status request

示例请求

GET {Endpoint}/luis/api/v2.0/apps/86226c53-b7a6-416f-876b-226b2b5ab07b/versions/0.1/train

示例响应

[
  {
    "modelId": "f9b00d5b-1f2d-421e-bc99-5ff192d0b998",
    "details": {
      "statusId": 3,
      "status": "InProgress",
      "exampleCount": 0
    }
  },
  {
    "modelId": "51403af3-5342-4926-abaa-91172a42e075",
    "details": {
      "statusId": 2,
      "status": "UpToDate",
      "exampleCount": 12,
      "trainingDateTime": "2017-01-31T21:42:02Z"
    }
  },
  {
    "modelId": "b4cf6402-dc79-4ca3-8666-b0007337e92b",
    "details": {
      "statusId": 1,
      "status": "Fail",
      "exampleCount": 12,
      "failureReason": "FewLabels"
    }
  },
  {
    "modelId": "e8e3135a-acd9-4164-a65c-e2fedbe78cfa",
    "details": {
      "statusId": 3,
      "status": "InProgress",
      "exampleCount": 0
    }
  },
  {
    "modelId": "3291fac9-6368-4c87-9562-e78cae0fa7c6",
    "details": {
      "statusId": 0,
      "status": "Success",
      "exampleCount": 12,
      "trainingDateTime": "2017-01-31T21:42:02Z"
    }
  },
  {
    "modelId": "a193efac-ab02-49d7-b005-ee717d45c4f1",
    "details": {
      "statusId": 3,
      "status": "InProgress",
      "exampleCount": 0
    }
  }
]

定义

名称 说明
ErrorResponse

调用 API 上的作时出现错误响应。

ModelTrainingDetails

模型训练详细信息。

ModelTrainingInfo

模型训练信息。

TrainingStatus

训练状态。

ErrorResponse

调用 API 上的作时出现错误响应。

名称 类型 说明
errorType

string

ModelTrainingDetails

模型训练详细信息。

名称 类型 说明
exampleCount

integer

用于训练模型的示例计数。

failureReason

string

训练失败的原因。

status

TrainingStatus

训练状态。

statusId

integer

训练请求状态 ID。

trainingDateTime

string (date-time)

训练模型时。

ModelTrainingInfo

模型训练信息。

名称 类型 说明
details

ModelTrainingDetails

模型训练详细信息。

modelId

string (uuid)

模型的 ID (GUID)。

TrainingStatus

训练状态。

说明
Fail
InProgress
Queued
Success
UpToDate