Skip to content

Latest commit

 

History

History
63 lines (41 loc) · 3.35 KB

fill-mask.md

File metadata and controls

63 lines (41 loc) · 3.35 KB

Fill-mask

Mask filling is the task of predicting the right word (token to be precise) in the middle of a sequence.

For more details about the fill-mask task, check out its dedicated page! You will find examples and related materials.

Recommended models

Explore all available models and find the one that suits you best here.

Using the API

No snippet available for this task.

API specification

Request

Headers
authorization string Authentication header in the form 'Bearer: hf_****' when hf_**** is a personal user access token with "Inference Providers" permission. You can generate one from your settings page.
Payload
inputs* string The text with masked tokens
parameters object
        top_k integer When passed, overrides the number of predictions to return.
        targets string[] When passed, the model will limit the scores to the passed targets instead of looking up in the whole vocabulary. If the provided targets are not in the model vocab, they will be tokenized and the first resulting token will be used (with a warning, and that might be slower).

Response

| Body | | | :--- | :--- | :--- | | (array) | object[] | Output is an array of objects. | |         sequence | string | The corresponding input with the mask token prediction. | |         score | number | The corresponding probability | |         token | integer | The predicted token id (to replace the masked one). | |         token_str | string | The predicted token (to replace the masked one). |