use case · basics · token-classification · WASM q8 · 135.36 MB · AFL-3.0

Inside Multilingual WordPiece NER: Subword Fertility & Cross-Script Comparison

One 119,547-token WordPiece vocabulary serves 104 languages — so the exact same event tokenizes differently across Latin, Arabic RTL and Chinese CJK. Run 6 parallel translations side-by-side to measure subword fertility, entity consistency and BIO merging.

1 · Parallel 6-language news event lab

Choose a parallel historical/diplomatic event or edit any language card below:

Subword fertility & cross-script consistency scorecard

WordPiece fertility, continuation share, entity counts and latency across 6 parallel languages
Language · script WordPieces Units Fertility (WP/unit) ## continuations Entities Mean conf. Latency
Run the 6-language comparison to measure fertility.
What you are seeing: English and European names sit directly in the 119.5K cased WordPiece vocabulary (low fertility ~1.0–1.3 WordPieces/unit). Arabic splits roots and attached prefixes like و into ## continuations (~1.8–2.5 WP/unit), while Chinese CJK has zero spaces and emits one unprefixed WordPiece per character (~1.0 WP/char, ~2× English token count!).

2 · Cross-script WordPiece BIO merge inspector

Each dashed box is one word/character group passed to bioMerge(). A warning border highlights sub-token type disagreements (e.g. Arabic attached prefix و = O followed by ##أ = B-PER).

Run the 6-language comparison above.

Naive token-level spans

Every WordPiece treated in isolation without grouping ## pieces first.

Word + script-aware BIO spans (suite output)

Groups ## pieces into words, then merges B-/I- runs without gluing adjacent CJK entities.

3 · The 9-label schema in config.id2label

The nine id2label entries in Xenova/distilbert-base-multilingual-cased-ner-hrl config.json
idLabelStatus in 10 HRL corpora
Show the code — mner-core.mjs: computeFertility() (WordPieces per orthographic unit)
Show the code — mner-core.mjs: groupWordPieces() (first / max / average softmax folding)