fill-mask Β· text Β· WASM Β· ~92 MB
This is a DistilBERT trained only on German text. Its one job here is
masked language modelling: hide a word behind [MASK] and it ranks
what belongs there β with a German-native vocabulary, German casing and German
compound words baked in. Type a sentence with a mask and see its guesses, the exact
logits it computed, and how it chops German words into subword pieces. Everything runs on
your device.
| Model | onnx-community/distilbert-base-german-cased-ONNX (ONNX build of distilbert-base-german-cased) |
|---|---|
| Task / pipeline | fill-mask β masked language modelling, loaded via AutoModelForMaskedLM for raw logits |
| Output | A probability over the whole 31,102-token German vocabulary at each [MASK] |
| Architecture | DistilBERT (6 layers, ~66M params), German-cased WordPiece tokenizer (splits compounds into ## pieces) |
| Language | German only β mask token is [MASK] (BERT/WordPiece style), not <mask> |
| Quantization | q8 (8-bit) ONNX |
| Backend | WebAssembly (runs anywhere; no WebGPU needed) |
| Download | ~92 MB, cached after first load |
| License | Apache-2.0 |
| Web APIs | WebAssembly, Web Workers β all Baseline widely available |
Write a German sentence containing [MASK] (use a sample if you're not
sure). The model predicts the missing word. You can use more than one mask.
The German DistilBERT spent its whole 31k-token budget on German. mBERT
(bert-base-multilingual-cased) spread a 119k-token vocabulary across ~104 languages. Load the
multilingual model (an extra ~180 MB, on demand) and compare what each one predicts for the
same German [MASK] β the specialist usually offers cleaner, more idiomatic
German words, and you can see it in the logits. Both use [MASK], so the comparison is
apples-to-apples.
The comparison uses whatever sentence is in the box above. Both runs are real, off-thread forward passes β nothing is cached or faked.
A language model doesn't output words β it outputs a logit (a raw, unbounded
score) for every one of its 31,102 German vocabulary tokens at the masked position. We
softmax those into probabilities. The bars above show the probability; the
logit beside each is the actual number the network produced. The
β below is the entropy of the top-k β low means the model is sure, high means
it's hedging.
top-k entropy: β bits Β· top-1 carries β of the shown mass
## continuation of a split German wordGerman loves long compound nouns (Geschwindigkeitsbegrenzung, Krankenversicherung). Watch a German-only vocabulary break them into a handful of German subwords instead of spelling them out letter by letter.
A model trained only on German reads German the way a multilingual model can't afford to β every token in its vocabulary is a German subword, so umlauts, the Γ, capitalised nouns and famously long compound words come out cleaner. Because it scores every word in context, you can ask it what fits, how strongly, and compare alternatives β all locally, with no prompt engineering and no API bill.
One German mask, ranked predictions with probabilities and the raw logits behind them.
A German writing aid β word-by-word completion and formal-vs-colloquial register comparison.
German compound words & idioms β does it know "die Katze im [MASK] kaufen"?
German-native vs multilingual β run the same mask through both models and measure where they disagree.
The one-liner uses the fill-mask pipeline:
import { pipeline } from "@huggingface/transformers";
const unmask = await pipeline("fill-mask", "onnx-community/distilbert-base-german-cased-ONNX");
const out = await unmask("Die Hauptstadt von Deutschland ist [MASK].");
// β [{ token_str: "Berlin", score: 0.61, sequence: "β¦" }, { token_str: "Deutschland", β¦ }]
For the "see inside" surface we go one level lower β AutoModelForMaskedLM β so we can
read the exact logits tensor ([1, sequence, 31102]), slice the row at the
[MASK] position, and softmax it ourselves. That's the only way to show the real logit
values, not just the pipeline's rounded scores. All of it runs in a Web Worker so the page never
janks.