Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Deprecate deployment infer API #2123

Merged
merged 7 commits into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/en/stack/ml/nlp/ml-nlp-apis.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ All the trained models endpoints have the following base:
* {ref}/get-trained-models.html[Get trained models]
* {ref}/get-trained-models-stats.html[Get trained models statistics]
// INFER
* {ref}/infer-trained-model-deployment.html[Infer trained model deployment]
* {ref}/infer-trained-model.html[Infer trained model]
// START
* {ref}//start-trained-model-deployment.html[Start trained model deployment]
// STOP
Expand Down
40 changes: 21 additions & 19 deletions docs/en/stack/ml/nlp/ml-nlp-deploy-models.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,14 @@ NOTE: This {kib} functionality is currently available only for the
<<ml-nlp-model-ref-ner,third party named entity recognition models>>.

Alternatively, you can use the
{ref}/infer-trained-model-deployment.html[infer trained model deployment API].
{ref}/infer-trained-model.html[infer trained model API].
For example, to try a named entity recognition task, provide some sample text:

[source,console]
--------------------------------------------------
POST /_ml/trained_models/elastic__distilbert-base-cased-finetuned-conll03-english/deployment/_infer
POST /_ml/trained_models/elastic__distilbert-base-cased-finetuned-conll03-english/_infer
{
"docs":{
"text_field":"Sasha bought 300 shares of Acme Corp in 2022."
}
"docs":[{"text_field": "Sasha bought 300 shares of Acme Corp in 2022."}]
}
--------------------------------------------------
// TEST[skip:TBD]
Expand All @@ -184,21 +182,25 @@ recognized entities:
[source,console-result]
----
{
"predicted_value" : "[Sasha](PER&Sasha) bought 300 shares of [Acme Corp](ORG&Acme+Corp) in 2022.",
"entities" : [
{
"entity" : "Sasha",
"class_name" : "PER",
"class_probability" : 0.9953193611298665,
"start_pos" : 0,
"end_pos" : 5
},
"inference_results" : [
{
"entity" : "Acme Corp",
"class_name" : "ORG",
"class_probability" : 0.9996392201598554,
"start_pos" : 27,
"end_pos" : 36
"predicted_value" : "[Sasha](PER&Sasha) bought 300 shares of [Acme Corp](ORG&Acme+Corp) in 2022.",
"entities" : [
{
"entity" : "Sasha",
"class_name" : "PER",
"class_probability" : 0.9953193407987492,
"start_pos" : 0,
"end_pos" : 5
},
{
"entity" : "Acme Corp",
"class_name" : "ORG",
"class_probability" : 0.9996392198381716,
"start_pos" : 27,
"end_pos" : 36
}
]
}
]
}
Expand Down