2-Stage Multilingual Audit: Cloze Fill × 201-Language Shift
Chain two multilingual BERT-family models locally in your browser (165.15 MB
combined WASM q8): Stage 1
(distilbert/distilbert-base-multilingual-cased via
onnx-community/distilbert-base-multilingual-cased-ONNX, 139.32 MB, Apache-2.0)
generates top-K [MASK] completions, then Stage 2
(onnx-community/language_detection-ONNX, 25.83 MB, MIT, reusing
../mbert-language-detection/worker.js) classifies every completed sentence across all
201 FLORES-200 languages to catch code-switching flips or cross-script leakage.
Why Pair Cloze Fill with 201-Language Identification? A shared 119,547-piece
multilingual vocabulary can rank cross-script or second-language tokens at code-switch seams or
high-entropy slots. Stage 2 scores each candidate's full 201-way FLORES-200 softmax distribution
(eng_Latn, fra_Latn, spa_Latn, deu_Latn,
arb_Arab, …) to reveal whether a candidate stays in-language or flips language identity.
1. Two Independent On-Device Models (165.15 MB Combined)