v1

latestSwagger 2.0raw.githubusercontent.com2022-07-014922.4 KB
Intent

Predict an intent for a phrase given a dataset

Predicts an intent for a phrase given a dataset ID. The Intent API uses machine learning to generalize from the intents and phrases in the dataset that was created in the datasets overview to infer the intent of the given phrase. Requires the active model for the dataset to be trained.

Training a model usually takes around 1 after a dataset is created or updated. This endpoint yields an error if the model has not been trained yet.

post/api/v1/datasets/{datasetId}/predict

Path parameters

datasetIdstring required

The unique ID that identifies the dataset for which a prediction should be made.

Request body

phrasestring

The phrase that might contain an intent.

Example request

{
  "phrase": "I'd like to order something"
}

Response

A successful response.

intentstring

The intent that is predicted for the given phrase.

intentPredictedboolean

Boolean indicating an intent was predicted. If false the phrase could not be matched with an intent.

Example response

{
  "intent": "order",
  "intentPredicted": true
}