google-bert/bert-base-multilingual-cased
Xenova/bert-base-multilingual-cased
fill-mask (BertForMaskedLM)
## 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:
.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 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
- Upstream weights & model card: google-bert/bert-base-multilingual-cased (Apache-2.0)
-
Browser ONNX export:
Xenova/bert-base-multilingual-cased (
onnx/model_quantized.onnx, 179.58 MB q8) - Paper: Devlin et al. (2018), BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding