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 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
app
|
path | True |
string (uuid) |
應用程式識別碼。 |
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 |
指出是否要取得實體預測的額外元數據。 |
要求標頭
名稱 | 必要 | 類型 | Description |
---|---|---|---|
Ocp-Apim-Subscription-Key | True |
string |
要求本文
名稱 | 必要 | 類型 | Description |
---|---|---|---|
query | True |
string |
要預測的查詢。 |
dynamicLists |
此要求的動態建立清單實體。 |
||
externalEntities |
此要求的外部預測實體。 |
||
options |
為此要求定義的自定義選項。 |
回應
名稱 | 類型 | Description |
---|---|---|
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
}
}
}
定義
名稱 | Description |
---|---|
Dynamic |
定義清單實體的延伸模組。 |
Error |
表示發生的錯誤。 |
Error |
表示所發生錯誤的定義。 |
External |
定義使用者預測實體,以擴充已經存在的實體。 |
Intent |
表示意圖預測。 |
Prediction |
表示查詢的預測。 |
Prediction |
表示預測要求參數。 |
Prediction |
預測要求的自定義選項。 |
Prediction |
表示預測回應。 |
Request |
定義要附加至現有清單實體的子清單。 |
Sentiment |
情感分析的結果。 |
DynamicList
定義清單實體的延伸模組。
名稱 | 類型 | Description |
---|---|---|
listEntityName |
string |
要擴充的清單實體名稱。 |
requestLists |
要附加在擴充清單實體上的清單。 |
Error
表示發生的錯誤。
名稱 | 類型 | Description |
---|---|---|
error |
表示所發生錯誤的定義。 |
ErrorBody
表示所發生錯誤的定義。
名稱 | 類型 | Description |
---|---|---|
code |
string |
錯誤碼。 |
message |
string |
錯誤訊息。 |
ExternalEntity
定義使用者預測實體,以擴充已經存在的實體。
名稱 | 類型 | Description |
---|---|---|
entityLength |
integer (int32) |
預測實體的長度。 |
entityName |
string |
要擴充的實體名稱。 |
resolution |
使用者提供自定義解析度,以作為實體的預測傳回。 |
|
score |
number (float) |
使用者提供的分數會傳回為實體的預測分數。 |
startIndex |
integer (int32) |
預測實體的起始字元索引。 |
Intent
表示意圖預測。
名稱 | 類型 | Description |
---|---|---|
childApp |
分派應用程式的預測。 |
|
score |
number (float) |
引發意圖的分數。 |
Prediction
表示查詢的預測。
名稱 | 類型 | Description |
---|---|---|
alteredQuery |
string |
拼字檢查之後的查詢。 只有在啟用拼字檢查且發現拼字錯誤時才設定。 |
entities |
字典,表示引發的實體。 |
|
intents |
<string, Intent> |
字典,表示引發的意圖。 |
sentiment |
情感分析的結果。 |
|
topIntent |
string |
最高評分意圖的名稱。 |
PredictionRequest
表示預測要求參數。
名稱 | 類型 | Description |
---|---|---|
dynamicLists |
此要求的動態建立清單實體。 |
|
externalEntities |
此要求的外部預測實體。 |
|
options |
為此要求定義的自定義選項。 |
|
query |
string |
要預測的查詢。 |
PredictionRequestOptions
預測要求的自定義選項。
名稱 | 類型 | Description |
---|---|---|
datetimeReference |
string (date-time) |
用於預測 datetime 實體的參考 DateTime。 |
preferExternalEntities |
boolean |
如果發生重疊,是否要讓外部實體解析覆寫預測。 |
PredictionResponse
表示預測回應。
名稱 | 類型 | Description |
---|---|---|
prediction |
所要求查詢的預測。 |
|
query |
string |
預測中使用的查詢。 |
RequestList
定義要附加至現有清單實體的子清單。
名稱 | 類型 | Description |
---|---|---|
canonicalForm |
string |
子清單的正式形式。 |
name |
string |
子清單的名稱。 |
synonyms |
string[] |
標準形式的同義字。 |
Sentiment
情感分析的結果。
名稱 | 類型 | Description |
---|---|---|
label |
string |
情感分析結果的標籤。 |
score |
number (float) |
查詢的情感分數。 |