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

Examples - Add

在应用程序的版本中添加标记的示例话语。

POST {Endpoint}/luis/authoring/v3.0-preview/apps/{appId}/versions/{versionId}/example
POST {Endpoint}/luis/authoring/v3.0-preview/apps/{appId}/versions/{versionId}/example?enableNestedChildren={enableNestedChildren}

URI 参数

名称 必需 类型 说明
appId
path True

string (uuid)

应用程序 ID。

Endpoint
path True

string

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

versionId
path True

string

版本 ID。

enableNestedChildren
query

boolean

切换嵌套/平面格式

请求头

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

string

请求正文

名称 类型 说明
entityLabels

EntityLabelObject[]

示例话语中的标识实体。

intentName

string

表示示例话语的已标识意向。

text

string

示例话语。

响应

名称 类型 说明
201 Created

LabelExampleResponse

创建的示例话语的 ID。

Other Status Codes

ErrorResponse

错误响应。

安全性

Ocp-Apim-Subscription-Key

类型: apiKey
在: header

示例

Successful Add Label request

示例请求

POST {Endpoint}/luis/authoring/v3.0-preview/apps/86226c53-b7a6-416f-876b-226b2b5ab07b/versions/0.1/example?enableNestedChildren=False


{
  "text": "whats the weather in buenos aires?",
  "intentName": "WeatherInPlace",
  "entityLabels": [
    {
      "entityName": "Place",
      "startCharIndex": 21,
      "endCharIndex": 34
    }
  ]
}

示例响应

{
  "UtteranceText": "whats the weather in buenos aires?",
  "ExampleId": -11
}

定义

名称 说明
EntityLabelObject

定义提取实体在示例中的实体类型和位置。

ErrorResponse

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

ExampleLabelObject

标记的示例话语。

LabelExampleResponse

添加标记的示例话语时的响应。

EntityLabelObject

定义提取实体在示例中的实体类型和位置。

名称 类型 说明
children

EntityLabelObject[]

示例话语中的标识实体。

endCharIndex

integer

提取的实体结束的话语中的索引。

entityName

string

实体类型。

role

string

实体在话语中扮演的角色。

startCharIndex

integer

提取的实体启动的话语中的索引。

ErrorResponse

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

名称 类型 说明
errorType

string

ExampleLabelObject

标记的示例话语。

名称 类型 说明
entityLabels

EntityLabelObject[]

示例话语中的标识实体。

intentName

string

表示示例话语的已标识意向。

text

string

示例话语。

LabelExampleResponse

添加标记的示例话语时的响应。

名称 类型 说明
ExampleId

integer (int64)

新建的示例 ID。

UtteranceText

string

示例话语。