← All models

token-classification Β· text Β· WASM Β· ~178 MB

Multilingual NER β€” name the people, places & dates in ten languages

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.

At a glance

ModelXenova/bert-base-multilingual-cased-ner-hrl (ONNX build of Davlan/bert-base-multilingual-cased-ner-hrl)
Task / pipelinetoken-classification
LabelsBIO tags over 4 classes: PER, ORG, LOC, DATE
Languages10 high-resource languages (HRL): Arabic, German, English, Spanish, French, Italian, Latvian, Dutch, Portuguese, Chinese
Architecturemultilingual BERT-base cased (104-language WordPiece vocab, 12 layers, ~178M params) fine-tuned for NER
Quantizationq8 (8-bit) ONNX
BackendWebAssembly (runs anywhere; no WebGPU needed)
Download~178 MB, cached after first load
LicenseModel weights: AFL-3.0 (Davlan HRL NER); Transformers.js runtime: Apache-2.0
Web APIsWebAssembly, Web Workers β€” all Baseline widely available

Run it

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.

See inside β€” the per-token BIO tags

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.

Why it matters

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.

Use cases

Basics

Switch between ten languages and watch the same model tag people, orgs, places and dates.

Practical

Redact PII across languages, and extract entities into a structured, grouped list.

Wild

Code-switched text β€” one sentence that flips between languages mid-way.

Multi-model

Link the same real-world entity named in different languages with a cross-lingual embedder.

How the API works

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.

References