POST /_ml/trained_models/{model_id}/_infer
Console
POST _ml/trained_models/lang_ident_model_1/_infer { "docs":[{"text": "The fool doth think he is wise, but the wise man knows himself to be a fool."}] }
resp = client.ml.infer_trained_model( model_id="lang_ident_model_1", docs=[ { "text": "The fool doth think he is wise, but the wise man knows himself to be a fool." } ], )
const response = await client.ml.inferTrainedModel({ model_id: "lang_ident_model_1", docs: [ { text: "The fool doth think he is wise, but the wise man knows himself to be a fool.", }, ], });
response = client.ml.infer_trained_model( model_id: "lang_ident_model_1", body: { "docs": [ { "text": "The fool doth think he is wise, but the wise man knows himself to be a fool." } ] } )
$resp = $client->ml()->inferTrainedModel([ "model_id" => "lang_ident_model_1", "body" => [ "docs" => array( [ "text" => "The fool doth think he is wise, but the wise man knows himself to be a fool.", ], ), ], ]);
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"docs":[{"text":"The fool doth think he is wise, but the wise man knows himself to be a fool."}]}' "$ELASTICSEARCH_URL/_ml/trained_models/lang_ident_model_1/_infer"
Request example
An example body for a `POST _ml/trained_models/lang_ident_model_1/_infer` request.
{ "docs":[{"text": "The fool doth think he is wise, but the wise man knows himself to be a fool."}] }