你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Prediction - Get Slot Prediction
获取应用程序槽的预测。
POST {Endpoint}/luis/prediction/v3.0/apps/{appId}/slots/{slotName}/predict
POST {Endpoint}/luis/prediction/v3.0/apps/{appId}/slots/{slotName}/predict?verbose={verbose}&show-all-intents={show-all-intents}&log={log}
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
app
|
path | True |
string (uuid) |
应用程序 ID。 |
Endpoint
|
path | True |
string |
支持的认知服务终结点(协议和主机名,例如:https://westus.api.cognitive.microsoft.com)。 |
slot
|
path | True |
string |
应用程序槽名称。 |
log
|
query |
boolean |
指示是否记录终结点查询。 |
|
show-all-intents
|
query |
boolean |
指示是返回响应中的所有意向还是仅返回顶级意向。 |
|
verbose
|
query |
boolean |
指示是否获取实体预测的额外元数据。 |
请求头
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
Ocp-Apim-Subscription-Key | True |
string |
请求正文
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
query | True |
string |
要预测的查询。 |
dynamicLists |
为此请求动态创建的列表实体。 |
||
externalEntities |
此请求的外部预测实体。 |
||
options |
为此请求定义的自定义选项。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
提供的查询的预测。 |
|
Other Status Codes |
意外错误。 |
安全性
Ocp-Apim-Subscription-Key
类型:
apiKey
在:
header
示例
Successful Get Slot Predictions From Endpoint Via Post request
示例请求
POST {Endpoint}/luis/prediction/v3.0/apps/{Application Id}/slots/{Slot Name}/predict
{
"query": "forward to frank 30 dollars through HSBC",
"options": {
"datetimeReference": "2015-02-13T13:15:00.000Z"
},
"externalEntities": [
{
"entityName": "Bank",
"startIndex": 36,
"entityLength": 4,
"resolution": {
"text": "International Bank"
}
}
],
"dynamicLists": [
{
"listEntityName": "Employees",
"requestLists": [
{
"name": "Management",
"canonicalForm": "Frank",
"synonyms": []
}
]
}
]
}
示例响应
{
"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
}
}
}
定义
名称 | 说明 |
---|---|
Dynamic |
定义列表实体的扩展。 |
Error |
表示发生的错误。 |
Error |
表示发生的错误的定义。 |
External |
定义扩展已存在的实体的用户预测实体。 |
Intent |
表示意向预测。 |
Prediction |
表示查询的预测。 |
Prediction |
表示预测请求参数。 |
Prediction |
预测请求的自定义选项。 |
Prediction |
表示预测响应。 |
Request |
定义要追加到现有列表实体的子列表。 |
Sentiment |
情绪分析的结果。 |
DynamicList
定义列表实体的扩展。
名称 | 类型 | 说明 |
---|---|---|
listEntityName |
string |
要扩展的列表实体的名称。 |
requestLists |
要追加到扩展列表实体上的列表。 |
Error
表示发生的错误。
名称 | 类型 | 说明 |
---|---|---|
error |
表示发生的错误的定义。 |
ErrorBody
表示发生的错误的定义。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
错误代码。 |
message |
string |
错误消息。 |
ExternalEntity
定义扩展已存在的实体的用户预测实体。
名称 | 类型 | 说明 |
---|---|---|
entityLength |
integer (int32) |
预测实体的长度。 |
entityName |
string |
要扩展的实体的名称。 |
resolution |
用户提供了自定义分辨率,以作为实体的预测返回。 |
|
score |
number (float) |
用户提供的评分作为实体的预测分数返回。 |
startIndex |
integer (int32) |
预测实体的起始字符索引。 |
Intent
表示意向预测。
名称 | 类型 | 说明 |
---|---|---|
childApp |
调度应用程序的预测。 |
|
score |
number (float) |
激发的意向的分数。 |
Prediction
表示查询的预测。
名称 | 类型 | 说明 |
---|---|---|
alteredQuery |
string |
拼写检查后的查询。 仅当启用拼写检查并且发现拼写错误时设置。 |
entities |
一个字典,表示触发的实体。 |
|
intents |
<string, Intent> |
一个字典,表示触发的意向。 |
sentiment |
情绪分析的结果。 |
|
topIntent |
string |
最高评分意向的名称。 |
PredictionRequest
表示预测请求参数。
名称 | 类型 | 说明 |
---|---|---|
dynamicLists |
为此请求动态创建的列表实体。 |
|
externalEntities |
此请求的外部预测实体。 |
|
options |
为此请求定义的自定义选项。 |
|
query |
string |
要预测的查询。 |
PredictionRequestOptions
预测请求的自定义选项。
名称 | 类型 | 说明 |
---|---|---|
datetimeReference |
string (date-time) |
用于预测日期时间实体的引用 DateTime。 |
preferExternalEntities |
boolean |
是否使外部实体解析覆盖预测(如果发生重叠)。 |
PredictionResponse
表示预测响应。
名称 | 类型 | 说明 |
---|---|---|
prediction |
所请求查询的预测。 |
|
query |
string |
预测中使用的查询。 |
RequestList
定义要追加到现有列表实体的子列表。
名称 | 类型 | 说明 |
---|---|---|
canonicalForm |
string |
子列表的规范形式。 |
name |
string |
子列表的名称。 |
synonyms |
string[] |
规范形式的同义词。 |
Sentiment
情绪分析的结果。
名称 | 类型 | 说明 |
---|---|---|
label |
string |
情绪分析结果的标签。 |
score |
number (float) |
查询的情绪评分。 |