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

Prediction - Get Version Prediction GET

获取应用程序版本的预测。

GET {Endpoint}/luis/prediction/v3.0/apps/{appId}/versions/{versionId}/predict?query={query}
GET {Endpoint}/luis/prediction/v3.0/apps/{appId}/versions/{versionId}/predict?query={query}&verbose={verbose}&show-all-intents={show-all-intents}&log={log}

URI 参数

名称 必需 类型 说明
appId
path True

string (uuid)

应用程序 ID。

Endpoint
path True

string

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

versionId
path True

string

应用程序版本 ID。

query
query True

string

要预测的查询。

log
query

boolean

指示是否记录终结点查询。

show-all-intents
query

boolean

指示是返回响应中的所有意向还是仅返回顶级意向。

verbose
query

boolean

指示是否获取实体预测的额外元数据。

请求头

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

string

响应

名称 类型 说明
200 OK

PredictionResponse

提供的查询的预测。

Other Status Codes

Error

意外错误。

安全性

Ocp-Apim-Subscription-Key

类型: apiKey
在: header

示例

Successful Get Version Predictions From Endpoint Via Get request

示例请求

GET {Endpoint}/luis/prediction/v3.0/apps/{Application Id}/versions/{Version Id}/predict?query=forward to frank 30 dollars through HSBC

示例响应

{
  "query": "forward to frank 30 dollars through HSBC",
  "prediction": {
    "topIntent": "give",
    "intents": {
      "give": {
        "score": 0.943442
      }
    },
    "entities": {
      "Employees": [
        [
          "frank"
        ]
      ],
      "number": [
        30
      ],
      "money": [
        {
          "units": "Dollar",
          "value": 30
        }
      ],
      "Bank": [
        {
          "text": "International Bank"
        }
      ]
    },
    "sentiment": {
      "label": "positive",
      "score": 0.9163064
    }
  }
}

定义

名称 说明
Error

表示发生的错误。

ErrorBody

表示发生的错误的定义。

Intent

表示意向预测。

Prediction

表示查询的预测。

PredictionResponse

表示预测响应。

Sentiment

情绪分析的结果。

Error

表示发生的错误。

名称 类型 说明
error

ErrorBody

表示发生的错误的定义。

ErrorBody

表示发生的错误的定义。

名称 类型 说明
code

string

错误代码。

message

string

错误消息。

Intent

表示意向预测。

名称 类型 说明
childApp

Prediction

调度应用程序的预测。

score

number (float)

激发的意向的分数。

Prediction

表示查询的预测。

名称 类型 说明
alteredQuery

string

拼写检查后的查询。 仅当启用拼写检查并且发现拼写错误时设置。

entities

一个字典,表示触发的实体。

intents

<string,  Intent>

一个字典,表示触发的意向。

sentiment

Sentiment

情绪分析的结果。

topIntent

string

最高评分意向的名称。

PredictionResponse

表示预测响应。

名称 类型 说明
prediction

Prediction

所请求查询的预测。

query

string

预测中使用的查询。

Sentiment

情绪分析的结果。

名称 类型 说明
label

string

情绪分析结果的标签。

score

number (float)

查询的情绪评分。