← All models

fill-mask Β· text Β· WASM Β· ~92 MB

German DistilBERT β€” predict the missing German word

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.

At a glance

Modelonnx-community/distilbert-base-german-cased-ONNX (ONNX build of distilbert-base-german-cased)
Task / pipelinefill-mask β€” masked language modelling, loaded via AutoModelForMaskedLM for raw logits
OutputA probability over the whole 31,102-token German vocabulary at each [MASK]
ArchitectureDistilBERT (6 layers, ~66M params), German-cased WordPiece tokenizer (splits compounds into ## pieces)
LanguageGerman only β€” mask token is [MASK] (BERT/WordPiece style), not <mask>
Quantizationq8 (8-bit) ONNX
BackendWebAssembly (runs anywhere; no WebGPU needed)
Download~92 MB, cached after first load
LicenseApache-2.0
Web APIsWebAssembly, Web Workers β€” all Baseline widely available

Run it

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.

German-native vs multilingual β€” on the same sentence

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.

See inside β€” logits + how German splits into subwords

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.

WordPiece tokenisation β€” dashed = a ## continuation of a split German word

German 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.

Why it matters

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.

Use cases

Basics

One German mask, ranked predictions with probabilities and the raw logits behind them.

Practical

A German writing aid β€” word-by-word completion and formal-vs-colloquial register comparison.

Wild

German compound words & idioms β€” does it know "die Katze im [MASK] kaufen"?

Multi-model

German-native vs multilingual β€” run the same mask through both models and measure where they disagree.

How the API works

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.

References