This API is supported only for natural language processing (NLP) models.
The vocabulary is stored in the index as described in inference_config.*.vocabulary of the trained model definition.
##Required authorization
- Cluster privileges:
manage_ml
PUT
/_ml/trained_models/{model_id}/vocabulary
Console
PUT _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/vocabulary
{
"vocabulary": [
"[PAD]",
"[unused0]",
...
]
}
curl \
--request PUT 'http://api.example.com/_ml/trained_models/{model_id}/vocabulary' \
--header "Content-Type: application/json" \
--data '"{\n \"vocabulary\": [\n \"[PAD]\",\n \"[unused0]\",\n ...\n ]\n}"'
Request example
An example body for a `PUT _ml/trained_models/elastic__distilbert-base-uncased-finetuned-conll03-english/vocabulary` request.
{
"vocabulary": [
"[PAD]",
"[unused0]",
...
]
}