-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOCS] Drafts trained model deployment APIs (#75497)
- Loading branch information
Showing
8 changed files
with
254 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 116 additions & 0 deletions
116
docs/reference/ml/df-analytics/apis/infer-trained-model-deployment.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
[role="xpack"] | ||
[testenv="basic"] | ||
[[infer-trained-model-deployment]] | ||
= Infer trained model deployment API | ||
[subs="attributes"] | ||
++++ | ||
<titleabbrev>Infer trained model deployment</titleabbrev> | ||
++++ | ||
|
||
Evaluates a trained model. | ||
|
||
[[infer-trained-model-deployment-request]] | ||
== {api-request-title} | ||
|
||
`POST _ml/trained_models/<model_id>/deployment/_infer` | ||
|
||
//// | ||
[[infer-trained-model-deployment-prereq]] | ||
== {api-prereq-title} | ||
//// | ||
//// | ||
[[infer-trained-model-deployment-desc]] | ||
== {api-description-title} | ||
//// | ||
|
||
[[infer-trained-model-deployment-path-params]] | ||
== {api-path-parms-title} | ||
|
||
`<model_id>`:: | ||
(Required, string) | ||
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-id] | ||
|
||
[[infer-trained-model-deployment-query-params]] | ||
== {api-query-parms-title} | ||
|
||
`timeout`:: | ||
(Optional, time) | ||
Controls the amount of time to wait for {infer} results. Defaults to 10 seconds. | ||
|
||
[[infer-trained-model-request-body]] | ||
== {api-request-body-title} | ||
|
||
`input`:: | ||
(Required,string) | ||
The input text for evaluation. | ||
|
||
//// | ||
[[infer-trained-model-deployment-results]] | ||
== {api-response-body-title} | ||
//// | ||
//// | ||
[[ml-get-trained-models-response-codes]] | ||
== {api-response-codes-title} | ||
//// | ||
|
||
[[infer-trained-model-deployment-example]] | ||
== {api-examples-title} | ||
|
||
The response depends on the task the model is trained for. If it is a | ||
sentiment analysis task, the response is the score. For example: | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
POST _ml/trained_models/model2/deployment/_infer | ||
{ | ||
"input": "The movie was awesome!!" | ||
} | ||
-------------------------------------------------- | ||
// TEST[skip:TBD] | ||
|
||
The API returns scores in this case, for example: | ||
|
||
[source,console-result] | ||
---- | ||
{ | ||
"positive" : 0.9998062667902223, | ||
"negative" : 1.9373320977752957E-4 | ||
} | ||
---- | ||
// NOTCONSOLE | ||
|
||
For named entity recognition (NER) tasks, the response contains the recognized | ||
entities and their type. For example: | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
POST _ml/trained_models/model2/deployment/_infer | ||
{ | ||
"input": "Hi my name is Josh and I live in Berlin" | ||
} | ||
-------------------------------------------------- | ||
// TEST[skip:TBD] | ||
|
||
The API returns scores in this case, for example: | ||
|
||
[source,console-result] | ||
---- | ||
{ | ||
"entities" : [ | ||
{ | ||
"label" : "person", | ||
"score" : 0.9988716330253505, | ||
"word" : "Josh" | ||
}, | ||
{ | ||
"label" : "location", | ||
"score" : 0.9980872542990656, | ||
"word" : "Berlin" | ||
} | ||
] | ||
} | ||
---- | ||
// NOTCONSOLE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
docs/reference/ml/df-analytics/apis/start-trained-model-deployment.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
[role="xpack"] | ||
[testenv="basic"] | ||
[[start-trained-model-deployment]] | ||
= Start trained model deployment API | ||
[subs="attributes"] | ||
++++ | ||
<titleabbrev>Start trained model deployment</titleabbrev> | ||
++++ | ||
|
||
[[start-trained-model-deployment-request]] | ||
== {api-request-title} | ||
|
||
`POST _ml/trained_models/<model_id>/deployent/_start` | ||
//// | ||
[[start-trained-model-deployment-prereq]] | ||
== {api-prereq-title} | ||
//// | ||
//// | ||
[[start-trained-model-deployment-desc]] | ||
== {api-description-title} | ||
//// | ||
|
||
[[start-trained-model-deployment-path-params]] | ||
== {api-path-parms-title} | ||
|
||
`<model_id>`:: | ||
(Required, string) | ||
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-id] | ||
|
||
[[start-trained-model-deployment-query-params]] | ||
== {api-query-parms-title} | ||
|
||
`timeout`:: | ||
(Optional, time) | ||
Controls the amount of time to wait for the model to deploy. Defaults | ||
to 20 seconds. | ||
//// | ||
[role="child_attributes"] | ||
[[start-trained-model-deployment-results]] | ||
== {api-response-body-title} | ||
//// | ||
//// | ||
[[ml-get-trained-models-response-codes]] | ||
== {api-response-codes-title} | ||
//// | ||
//// | ||
[[start-trained-model-deployment-example]] | ||
== {api-examples-title} | ||
//// |
49 changes: 49 additions & 0 deletions
49
docs/reference/ml/df-analytics/apis/stop-trained-model-deployment.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
[role="xpack"] | ||
[testenv="basic"] | ||
[[stop-trained-model-deployment]] | ||
= Stop trained model deployment API | ||
[subs="attributes"] | ||
++++ | ||
<titleabbrev>Stop trained model deployment</titleabbrev> | ||
++++ | ||
|
||
[[stop-trained-model-deployment-request]] | ||
== {api-request-title} | ||
|
||
`POST _ml/trained_models/<model_id>/deployment/_stop` | ||
|
||
//// | ||
[[stop-trained-model-deployment-prereq]] | ||
== {api-prereq-title} | ||
//// | ||
//// | ||
[[stop-trained-model-deployment-desc]] | ||
== {api-description-title} | ||
//// | ||
[[stop-trained-model-deployment-path-params]] | ||
== {api-path-parms-title} | ||
|
||
`<model_id>`:: | ||
(Required, string) | ||
include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-id] | ||
|
||
//// | ||
[[stop-trained-model-deployment-query-params]] | ||
== {api-query-parms-title} | ||
//// | ||
//// | ||
[role="child_attributes"] | ||
[[stop-trained-model-deployment-results]] | ||
== {api-response-body-title} | ||
//// | ||
//// | ||
[[ml-get-trained-models-response-codes]] | ||
== {api-response-codes-title} | ||
//// | ||
|
||
//// | ||
[[stop-trained-model-deployment-example]] | ||
== {api-examples-title} | ||
//// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters