Partager via


Prediction - Get Version Prediction GET

Gets the predictions for an application version.

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 Parameters

Name In Required Type Description
appId
path True

string

uuid

The application ID.

Endpoint
path True

string

Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).

versionId
path True

string

The application version ID.

query
query True

string

The query to predict.

log
query

boolean

Indicates whether to log the endpoint query or not.

show-all-intents
query

boolean

Indicates whether to return all the intents in the response or just the top intent.

verbose
query

boolean

Indicates whether to get extra metadata for the entities predictions or not.

Request Header

Name Required Type Description
Ocp-Apim-Subscription-Key True

string

Responses

Name Type Description
200 OK

PredictionResponse

The prediction for the supplied query.

Other Status Codes

Error

Unexpected error.

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

Examples

Successful Get Version Predictions From Endpoint Via Get request

Sample request

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

Sample response

{
  "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
    }
  }
}

Definitions

Name Description
Error

Represents the error that occurred.

ErrorBody

Represents the definition of the error that occurred.

Intent

Represents an intent prediction.

Prediction

Represents the prediction of a query.

PredictionResponse

Represents the prediction response.

Sentiment

The result of the sentiment analysis.

Error

Represents the error that occurred.

Name Type Description
error

ErrorBody

Represents the definition of the error that occurred.

ErrorBody

Represents the definition of the error that occurred.

Name Type Description
code

string

The error code.

message

string

The error message.

Intent

Represents an intent prediction.

Name Type Description
childApp

Prediction

The prediction of the dispatched application.

score

number

The score of the fired intent.

Prediction

Represents the prediction of a query.

Name Type Description
alteredQuery

string

The query after spell checking. Only set if spell check was enabled and a spelling mistake was found.

entities

A dictionary representing the entities that fired.

intents

<string,  Intent>

A dictionary representing the intents that fired.

sentiment

Sentiment

The result of the sentiment analysis.

topIntent

string

The name of the top scoring intent.

PredictionResponse

Represents the prediction response.

Name Type Description
prediction

Prediction

The prediction of the requested query.

query

string

The query used in the prediction.

Sentiment

The result of the sentiment analysis.

Name Type Description
label

string

The label of the sentiment analysis result.

score

number

The sentiment score of the query.