|
@@ -384,10 +384,12 @@ the model definition is not supplied.
|
|
|
`inference_config`::
|
|
|
(Required, object)
|
|
|
The default configuration for inference. This can be: `regression`,
|
|
|
-`classification`, `fill_mask`, `ner`, `text_classification`, `text_embedding` or `zero_shot_classification`.
|
|
|
+`classification`, `fill_mask`, `ner`, `question_answering`,
|
|
|
+`text_classification`, `text_embedding` or `zero_shot_classification`.
|
|
|
If `regression` or `classification`, it must match the `target_type` of the
|
|
|
-underlying `definition.trained_model`. If `fill_mask`, `ner`,
|
|
|
-`text_classification`, or `text_embedding`; the `model_type` must be `pytorch`.
|
|
|
+underlying `definition.trained_model`. If `fill_mask`, `ner`,
|
|
|
+`question_answering`, `text_classification`, or `text_embedding`; the
|
|
|
+`model_type` must be `pytorch`.
|
|
|
+
|
|
|
.Properties of `inference_config`
|
|
|
[%collapsible%open]
|
|
@@ -515,9 +517,10 @@ include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-ner]
|
|
|
=====
|
|
|
`classification_labels`::::
|
|
|
(Optional, string)
|
|
|
-An array of classification labels. NER only supports Inside-Outside-Beginning labels (IOB)
|
|
|
-and only persons, organizations, locations, and miscellaneous.
|
|
|
-Example: ["O", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC", "B-MISC", "I-MISC"]
|
|
|
+An array of classification labels. NER only supports Inside-Outside-Beginning
|
|
|
+labels (IOB) and only persons, organizations, locations, and miscellaneous.
|
|
|
+Example: ["O", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC", "B-MISC",
|
|
|
+"I-MISC"]
|
|
|
|
|
|
`tokenization`::::
|
|
|
(Optional, object)
|
|
@@ -684,6 +687,111 @@ include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenizati
|
|
|
======
|
|
|
=====
|
|
|
|
|
|
+`question_answering`:::
|
|
|
+(Optional, object)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-question-answering]
|
|
|
++
|
|
|
+.Properties of question_answering inference
|
|
|
+[%collapsible%open]
|
|
|
+=====
|
|
|
+`max_answer_length`::::
|
|
|
+(Optional, integer)
|
|
|
+The maximum amount of words in the answer. Defaults to `15`.
|
|
|
+
|
|
|
+`tokenization`::::
|
|
|
+(Optional, object)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization]
|
|
|
++
|
|
|
+Recommended to set `max_sentence_length` to `386` with `128` of `span` and set
|
|
|
+`truncate` to `none`.
|
|
|
++
|
|
|
+.Properties of tokenization
|
|
|
+[%collapsible%open]
|
|
|
+======
|
|
|
+`bert`::::
|
|
|
+(Optional, object)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert]
|
|
|
++
|
|
|
+.Properties of bert
|
|
|
+[%collapsible%open]
|
|
|
+=======
|
|
|
+`do_lower_case`::::
|
|
|
+(Optional, boolean)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-do-lower-case]
|
|
|
+
|
|
|
+`max_sequence_length`::::
|
|
|
+(Optional, integer)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-max-sequence-length]
|
|
|
+
|
|
|
+`span`::::
|
|
|
+(Optional, integer)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-span]
|
|
|
+
|
|
|
+`truncate`::::
|
|
|
+(Optional, string)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-truncate]
|
|
|
+
|
|
|
+`with_special_tokens`::::
|
|
|
+(Optional, boolean)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-bert-with-special-tokens]
|
|
|
+=======
|
|
|
+`roberta`::::
|
|
|
+(Optional, object)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-roberta]
|
|
|
++
|
|
|
+.Properties of roberta
|
|
|
+[%collapsible%open]
|
|
|
+=======
|
|
|
+`add_prefix_space`::::
|
|
|
+(Optional, boolean)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-roberta-add-prefix-space]
|
|
|
+
|
|
|
+`max_sequence_length`::::
|
|
|
+(Optional, integer)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-max-sequence-length]
|
|
|
+
|
|
|
+`span`::::
|
|
|
+(Optional, integer)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-span]
|
|
|
+
|
|
|
+`truncate`::::
|
|
|
+(Optional, string)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-truncate]
|
|
|
+
|
|
|
+`with_special_tokens`::::
|
|
|
+(Optional, boolean)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-roberta-with-special-tokens]
|
|
|
+=======
|
|
|
+`mpnet`::::
|
|
|
+(Optional, object)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-mpnet]
|
|
|
++
|
|
|
+.Properties of mpnet
|
|
|
+[%collapsible%open]
|
|
|
+=======
|
|
|
+`do_lower_case`::::
|
|
|
+(Optional, boolean)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-do-lower-case]
|
|
|
+
|
|
|
+`max_sequence_length`::::
|
|
|
+(Optional, integer)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-max-sequence-length]
|
|
|
+
|
|
|
+`span`::::
|
|
|
+(Optional, integer)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-span]
|
|
|
+
|
|
|
+`truncate`::::
|
|
|
+(Optional, string)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-truncate]
|
|
|
+
|
|
|
+`with_special_tokens`::::
|
|
|
+(Optional, boolean)
|
|
|
+include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=inference-config-nlp-tokenization-mpnet-with-special-tokens]
|
|
|
+=======
|
|
|
+======
|
|
|
+=====
|
|
|
+
|
|
|
`regression`:::
|
|
|
(Optional, object)
|
|
|
Regression configuration for inference.
|