token-classification Β· text Β· WASM Β· ~178 MB
Named-entity recognition reads a sentence and labels each span: who (PersonPER), what organization (OrgORG), where (LocationLOC), and when (DateDATE). Unlike the English BERT-NER page, this one runs on a multilingual BERT backbone and tags the same four classes across Arabic, German, English, Spanish, French, Italian, Latvian, Dutch, Portuguese and Chinese β one model, no language flag. Pick a language below and watch the entities light up. All on your device.
| Model | Xenova/bert-base-multilingual-cased-ner-hrl (ONNX build of Davlan/bert-base-multilingual-cased-ner-hrl) |
|---|---|
| Task / pipeline | token-classification |
| Labels | BIO tags over 4 classes: PER, ORG, LOC, DATE |
| Languages | 10 high-resource languages (HRL): Arabic, German, English, Spanish, French, Italian, Latvian, Dutch, Portuguese, Chinese |
| Architecture | multilingual BERT-base cased (104-language WordPiece vocab, 12 layers, ~178M params) fine-tuned for NER |
| Quantization | q8 (8-bit) ONNX |
| Backend | WebAssembly (runs anywhere; no WebGPU needed) |
| Download | ~178 MB, cached after first load |
| License | Model weights: AFL-3.0 (Davlan HRL NER); Transformers.js runtime: Apache-2.0 |
| Web APIs | WebAssembly, Web Workers β all Baseline widely available |
Pick a language sample or paste your own text. Entities are highlighted inline a moment after you stop typing; hover a highlight for its confidence. Right-to-left scripts (Arabic) lay out correctly.
Multilingual BERT breaks every language into WordPiece tokens (whole words, sub-word fragments
marked ##, or single CJK characters), and tags each token independently:
B-PER (begin person), I-PER (inside person), and so on. We then stitch
consecutive B-/I- runs into whole entities. Below are the raw tags and confidences
straight from the model β the same machinery, whether the input is French, Chinese or Arabic.
Most NER models are English-only. A single model that structures text in ten languages means you can index, redact, or link entities across a multilingual corpus without a translation step and without a per-language pipeline β and, because it runs in the browser, without a byte of the source text leaving the device.
Switch between ten languages and watch the same model tag people, orgs, places and dates.
Redact PII across languages, and extract entities into a structured, grouped list.
Code-switched text β one sentence that flips between languages mid-way.
Link the same real-world entity named in different languages with a cross-lingual embedder.
Token classification is one pipeline call β the multilingual model is a drop-in for the English one:
import { pipeline } from "@huggingface/transformers";
const ner = await pipeline(
"token-classification",
"Xenova/bert-base-multilingual-cased-ner-hrl",
);
const out = await ner("Angela Merkel a rencontrΓ© Barack Obama Γ Berlin en 2015.");
// β [{ entity: "B-PER", word: "Angela", score: 0.99, index: 1 },
// { entity: "I-PER", word: "Merkel", score: 0.99, index: 2 },
// { entity: "B-PER", word: "Barack", score: 0.99, index: 5 },
// { entity: "I-PER", word: "Obama", score: 0.99, index: 6 },
// { entity: "B-LOC", word: "Berlin", score: 0.99, index: 8 },
// { entity: "B-DATE", word: "2015", score: 0.98, index: 10 }]
The pipeline returns one BIO-tagged row per WordPiece token, but no character offsets. We map each
token back to its span in the original text (a cursor-walk) so highlights land exactly β across
Latin, CJK and RTL scripts β then merge B-/I- runs (and ## sub-word
pieces) into whole entities with a pooled confidence. It all runs in a Web Worker so typing stays
smooth.