Basics · Uncased WordPiece Normalization & Script Fertility (171.59 MB WASM q8 · Apache-2.0)

Inside Uncased WordPiece: Case-Folding, Diacritics & Fertility

Test Mixed-Case + Accented vs Lowercased + Diacritic-Stripped prompts across FR / ES / DE / PL / VI, measure Latin vs Cyrillic/CJK/Arabic token fertility in google-bert/bert-base-multilingual-uncased (Xenova/bert-base-multilingual-uncased, 171.59 MB WASM q8, Apache-2.0), and contrast whole-word vs ## continuation splits.

Why do_lower_case: true & strip_accents: null Matter: Unlike cased mBERT, mBERT Uncased's BertNormalizer lowercases text and strips Unicode NFD combining accents before WordPiece lookup — so French élève and eleve fold to identical token IDs, while non-NFD characters such as Polish ł remain distinct from l.

1. Case-Folding & Diacritic Normalization Probe (FR / ES / DE / PL / VI)

Original #1–
Stripped #1–
Top-1 prob shift–
Entropy delta–
Token invariance–
NaN score check–

Original Mixed-Case Top-5 + WordPiece Chips

Run comparison above to inspect predictions.

Lowercased & Stripped Top-5 + WordPiece Chips

Run comparison above to inspect stripped predictions.
5-language original vs diacritic-stripped normalization invariance across FR, ES, DE, PL, and VI
Lang Original #1 (Prob) Stripped #1 (Prob) Prob Shift IDs Invariant / ## Entropy Delta
Click "Benchmark All 5 Languages" above to compare FR/ES/DE/PL/VI live.

2. Latin vs Cyrillic / CJK / Arabic Token Fertility Probe

Run the same semantic sentence across Latin (EN/FR/DE), Cyrillic (RU), Hanzi (ZH), and Arabic (AR) to inspect 105,879-vocab WordPiece fertility (tokens per word), ## continuation share, and entropy.

Scripts scored–
Latin mean fertility–
Non-Latin fertility–
Mean ## share–
Total [UNK] / NaN–
Total latency–
WordPiece token fertility, ## continuation ratio, entropy, and top-1 predictions across scripts
Script Prompt ([MASK]) Top-1 Fill Fertility (tok/word) ## Conts / UNK Entropy / ms
Initialize the model above to measure cross-script fertility.

3. Whole-Word vs Subword-Split (## Continuation) Sensitivity

Contrast a space-separated [MASK] slot against an inline prefix-attached slot (haupt[MASK], l'[MASK], coffee[MASK]) to see how uncased WordPiece switches to ## suffix candidates.

Whole-Word Top-5 (–)

Run comparison above.

Subword-Split Top-5 (–)

Run comparison above.

4. Inspect Normalization & Script Fertility Analyzers

Show the code · mbert-uncased-core.mjs — analyzeCaseDiacriticSensitivity()
Show the code · mbert-uncased-core.mjs — analyzeScriptFertility()