At a glance
token-classificationRun it — 10-language live entity & script tagger
Pick any of the 10 training languages (including Arabic RTL and Chinese CJK), edit the text, or load a local .txt / .md file:
Show entity types:
Merged entities
| # | Type | Entity | Confidence | Char span | Units · pieces |
|---|---|---|---|---|---|
| Run the tagger to list entities. | |||||
See inside — multilingual WordPiece BIO tags & 9-way softmax
Every token below comes from the live token-classification pipeline (with ignore_labels: []
so O tokens stay visible) paired with a forward pass exposing all 9 logits from config.id2label
(O, B-/I-DATE, B-/I-PER, B-/I-ORG, B-/I-LOC). Notice how
Arabic conjunctions like و (and) attach to the next word (و + ##جن + ##يف) while
Chinese characters emit one unprefixed WordPiece per character.
| Index | WordPiece | BIO label | Score | Char span | Top-3 of 9 labels |
|---|---|---|---|---|---|
| No tokens yet. | |||||
Why it matters — 10-language coverage in one 135 MB checkpoint
- Single-model global newsroom & compliance: tag European, Arabic (RTL) and Chinese (CJK) names in one worker without juggling 10 per-language downloads.
- Zero-server multilingual triage: keep sensitive international correspondence, invoices and field briefings inside the visitor's tab.
- Script-agnostic search facets: extract PER, ORG and LOC indices across mixed-language notes or uploaded CSVs (see Practical).
- Cross-lingual entity linking: pair extracted entities with multilingual MiniLM embeddings to connect
Paris↔باريس↔巴黎(see Multi-model).
B-DATE / I-DATE in slots 1–2 of
config.id2label, but the 10 aggregated HRL datasets only annotate PER, ORG and LOC —
dates are tagged O. Like English DistilBERT-NER, the cased mBERT vocabulary relies on capitalisation in Latin scripts, and
attached Arabic prefixes (e.g. وجنيف) can cause subword disagreements between first and average.
Use-case ladder
Basics
Run the same event in 6 languages side-by-side to measure WordPiece fertility across Latin, Arabic RTL and Chinese CJK.
Open Basics →Practical
Process mixed-language briefings or uploaded .txt/.md/.csv/.json files with language tags and CSV / CoNLL / JSON exports.
Wild
Code-switching (EN+ZH, EN+AR, FR+DE) + diacritic-stripping stress lab, 2-pass collision-free co-occurrence graph and selective redaction.
Open Wild →Multi-model
Stage 1 extracts entities across scripts; Stage 2 (paraphrase-multilingual-MiniLM-L12-v2) clusters cross-lingual mentions of the same entity.
How the API works
import { TRANSFORMERS_URL } from "/lib/webai.js"; // shared Transformers.js 3.7.5 pin
const { pipeline } = await import(TRANSFORMERS_URL);
const ner = await pipeline("token-classification", "Xenova/distilbert-base-multilingual-cased-ner-hrl", {
device: "wasm",
dtype: "q8", // onnx/model_quantized.onnx, 135.36 MB
});
const tokens = await ner("التقى أنطونيو غوتيريش بممثلين عن الأمم المتحدة في باريس.", { ignore_labels: [] });
// → [{ entity: "B-PER", score: 0.999, index: 4, word: "أن" }, …, { entity: "B-LOC", word: "باريس" }]
// mner-core.mjs aligns Latin, accented, Arabic RTL and CJK tokens to exact offsets and merges BIO spans.