diff --git a/docs/reference/ingest/processors/inference.asciidoc b/docs/reference/ingest/processors/inference.asciidoc index c424e37b70b91..f0c029d99e14a 100644 --- a/docs/reference/ingest/processors/inference.asciidoc +++ b/docs/reference/ingest/processors/inference.asciidoc @@ -17,26 +17,65 @@ ingested in the pipeline. |====== | Name | Required | Default | Description | `model_id` . | yes | - | (String) The ID or alias for the trained model, or the ID of the deployment. +| `input_output` | no | (List) Input fields for inference and output (destination) fields for the inference results. This options is incompatible with the `target_field` and `field_map` options. | `target_field` | no | `ml.inference.` | (String) Field added to incoming documents to contain results objects. | `field_map` | no | If defined the model's default field map | (Object) Maps the document field names to the known field names of the model. This mapping takes precedence over any default mappings provided in the model configuration. -| `input_field` | no | | `inference_config` | no | The default settings defined in the model | (Object) Contains the inference type and its options. include::common-options.asciidoc[] |====== +[discrete] +[[inference-input-output-example]] +==== Configuring input and output fields +Select the `content` field for inference and write the result to `content_embedding`. + [source,js] -------------------------------------------------- { "inference": { "model_id": "model_deployment_for_inference", - "target_field": "FlightDelayMin_prediction_infer", - "input_field": "" - "inference_config": { "regression": {} } + "input_output": [ + { + "input_field": "content", + "output_field": "content_embedding" + } + ] + } +} +-------------------------------------------------- +// NOTCONSOLE + +==== Configuring multiple inputs +The `content` and `title` fields will be read from the incoming document +and sent to the model for the inference. The inference output is written +to `content_embedding` and `title_embedding` respectively. +[source,js] +-------------------------------------------------- +{ + "inference": { + "model_id": "model_deployment_for_inference", + "input_output": [ + { + "input_field": "content", + "output_field": "content_embedding" + }, + { + "input_field": "title", + "output_field": "title_embedding" + } + ] } } -------------------------------------------------- // NOTCONSOLE +Selecting the input fields with `input_output` is incompatible with +the `target_field` and `field_map` options. + +Data frame analytics models must use the `target_field` to specify the +root location results are written to and optionally a `field_map` to map +field names in the input document to the model input fields. + [source,js] -------------------------------------------------- {