← All models · mT5-small

use case · multi-model

Multi-model: detect the language, then let mT5 fill

You never tell mT5 which language to work in — so how does it know? This pipeline makes it verifiable with two models. Stage 1: an XLM-RoBERTa language detector reads your sentence and names its language. Stage 2: mT5, from its single 101-language vocabulary and with no language hint, fills the <extra_id_0> blank. When the reconstructed word is in the detected language, that is the shared multilingual vocabulary doing its job. Both models run locally.

Pick a masked sentence:

The detector is a separate model, so it can disagree with your intuition (Spanish and Italian, for instance, are easy to confuse on short inputs) — that is honest model behaviour, shown, not hidden. The takeaway is the pairing: one detector to label the language, one generator that already covers it.

← Wild · Back to mT5-small · Related: Language identification →