distilbert/distilbert-base-cased
Xenova/distilbert-base-cased
fill-mask (DistilBertForMaskedLM)
## Continuations: Unlike
distilbert-base-uncased, this checkpoint sets do_lower_case: false and keeps
capitalized proper nouns, calendar months, and acronyms distinct across all 28,996 entries,
marking continuation subwords with ## and mapping unseen symbols to [UNK]
(ID 100) — in 67.20 MB (39% smaller than 12-layer BERT Base Cased).
1. Cased English [MASK] Cloze Completion Workbench
Pick a preset, drag & drop or paste (Ctrl/Cmd+V) an English sentence, or write your own
single-[MASK] prompt:
.txt, .md, .csv, or .json file here, or
press Ctrl/Cmd+V outside editable inputs. Use [MASK] exactly once on this
workbench (use the Wild Lab tab above for multi-mask sentences).
[MASK] locally.
Top-K Candidates & Raw Logits (Click to Preview)
Cased WordPiece ## Subword Chip Breakdown
Solid border = word-initial token; dashed = ## continuation subword; highlighted =
[MASK] (103); red = [UNK] (100).
2. Why DistilBERT Base Cased Matters & How It Runs
distilbert/distilbert-base-cased distills 12-layer BERT Base Cased into a compact 6-layer bidirectional Transformer on cased English BookCorpus and Wikipedia prose using the exact same 28,996-piece cased WordPiece vocabulary. Because case cues distinguish proper organizations, months, and people from lowercase common nouns (such as Apple vs apple, Amazon vs amazon, or March vs march), it powers fast in-browser copyediting, redacted-text completion, and cased entity pipelines at 67.20 MB.
import { pipeline } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.5";
const unmask = await pipeline("fill-mask", "Xenova/distilbert-base-cased", {
device: "wasm",
dtype: "q8",
});
const out = await unmask("Apple unveiled its newest [MASK] at the keynote in Cupertino.", { top_k: 8 });
Show the code · worker.js — runSingleFill() (67.20 MB q8 WASM worker)
Show the code · distilbert-cased-core.mjs — computeDistributionMetrics() (entropy & NaN check)
3. References & Model Provenance
- Upstream weights & model card: distilbert/distilbert-base-cased (Apache-2.0)
-
Browser ONNX export:
Xenova/distilbert-base-cased (
onnx/model_quantized.onnx, 66.53 MB q8 · 67.20 MB total) - Paper: Sanh et al. (2019), DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter