Fill-Mask
Fill-mask models predict the missing word hidden behind a mask token in a sentence.
Inputs
Input
Paris is the [MASK] of France.
Fill-Mask Model
Output
Output
- capital0.97
- heart0.01
- center0.01
About Fill-Mask
Fill-mask models predict the missing word hidden behind a mask token in a sentence. Browse fill-mask models on HubClone to compare checkpoints, or open a Space to try one in the browser.
Use Cases
Pretraining
Masked language modeling is how encoders like BERT learn language.
Spelling help
Suggest the most likely word for a gap.
Inference
The Transformers pipeline API runs fill-mask models in a few lines. Replace <model-id> with any model listed on this page.
from transformers import pipeline
pipe = pipeline("fill-mask", model="<model-id>")
pipe("Paris is the [MASK] of France.")Useful Resources
Want to dig deeper into the topic? Great! Here is a hand-picked list of resources we found helpful.
Documentation
- Fill-Mask task guide
- Pipelines reference
Notebooks
- Fine-tuning a fill-mask model