fill-mask · 182.5 MB WASM q8 · 12-Layer BertForMaskedLM (179M) · 104 Languages · Apache-2.0

mBERT Cased — 104-Language Cased WordPiece Cloze

google-bert/bert-base-multilingual-cased (served via Xenova/bert-base-multilingual-cased , Apache-2.0) is a 12-layer cased multilingual BERT encoder (179M params, 179.58 MB q8 ONNX + 2.92 MB WordPiece tokenizer = 182.5 MB WASM download) sharing a 119,547-token cased WordPiece vocabulary (do_lower_case: false, [MASK] ID 103) across 104 Wikipedia languages right in your browser.

Upstream Model google-bert/bert-base-multilingual-cased
ONNX Artifact Xenova/bert-base-multilingual-cased
Pipeline Task fill-mask (BertForMaskedLM)
Size & Quant 182.5 MB · WASM q8 (179.58 MB ONNX + 2.92 MB tok)
Vocab & Mask 119,547 Cased WordPiece · [MASK] (103)
License & Depth Apache-2.0 · 12 layers · 512 tokens · 104 langs
Cased WordPiece with ## Continuations: Unlike uncased BERT or SentencePiece models, mBERT preserves capitalization and accents (do_lower_case: false), splits CJK characters individually (tokenize_chinese_chars: true), and marks continuation subwords with ## while ranking all 119,547 tokens via one [MASK] (ID 103) softmax head.

1. 104-Language [MASK] Cloze Completion Workbench

Pick a preset across 9 languages & 4 scripts, drag & drop or paste (Ctrl/Cmd+V) a sentence, or type your own single-[MASK] prompt:

Drop a .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).
Initialize the model above to fill [MASK] locally.
Inference latency–
Top-1 prediction–
Full-vocab entropy–
Top-K mass / Share–
WordPiece / ## / UNK–
NaN score check–
Backend / dtypeWASM · q8

Top-K Candidates & Raw Logits (Click to Preview)

Awaiting live inference…

Cased WordPiece ## Subword Chip Breakdown

Solid border = word-initial token; dashed = ## continuation subword; highlighted = [MASK] (103); red = [UNK] (100).

Run inference to inspect cased WordPiece tokens.

2. Why mBERT Cased Matters & How It Runs

google-bert/bert-base-multilingual-cased pretrains a 12-layer BERT encoder on cased Wikipedia text in 104 languages using a shared 119,547-piece WordPiece vocabulary. It powers zero-shot cross-lingual transfer, cased copyediting, and downstream students like distilbert-base-multilingual-cased-sentiments-student without sending text off-device.

import { pipeline } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.5";

const unmask = await pipeline("fill-mask", "Xenova/bert-base-multilingual-cased", {
  device: "wasm",
  dtype: "q8",
});
const out = await unmask("L'élève a acheté du [MASK] à la boulangerie.", { top_k: 8 });
Show the code · worker.js — runSingleFill() (182.5 MB q8 WASM worker)
Show the code · mbert-core.mjs — computeDistributionMetrics() (entropy & NaN check)

3. References & Model Provenance