Type to search.

Evaluate a trained model

Auth The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Generally available since 8.3 This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

Path parameters

model_id string required

The unique identifier of the trained model.

Query parameters

timeout union oneOf · default: 10s

Controls the amount of time to wait for inference results.

Values: -1 0

Request body

docs string to object[] required

An array of objects to pass to the model for inference. The objects should contain a fields matching your configured trained model input. Typically, for NLP models, the field name is text_field. Currently, for NLP models, only a single value is allowed.

Response

application/json
inference_results object[] required
is_truncated boolean

Indicates whether the input text was truncated to meet the model's maximum sequence length limit. This property is present only when it is true.

predicted_value union oneOf nullable

If the model is trained for a text classification or zero shot classification task, the response is the predicted class. For named entity recognition (NER) tasks, it contains the annotated text output. For fill mask tasks, it contains the top prediction for replacing the mask token. For text embedding tasks, it contains the raw numerical text embedding values. For regression models, its a numerical value For classification models, it may be an integer, double, boolean or string depending on prediction type

One of: union[] or union
predicted_value_sequence string

For fill mask tasks, the response contains the input text sequence with the mask token replaced by the predicted value. Additionally

prediction_probability number

Specifies a probability for the predicted value.

prediction_score number

Specifies a confidence score for the predicted value.

warning string

If the request failed, the response contains the reason for the failure.