โ† All models

token-classification ยท text ยท WASM ยท ~110 MB

BERT NER โ€” name the people, places & things

Named-entity recognition reads a sentence and labels each span: who (PersonPER), what organization (OrgORG), where (LocationLOC), and other proper nouns (MiscMISC). Type below and watch the entities light up โ€” then look inside at the per-token tags. All on your device.

At a glance

ModelXenova/bert-base-NER (ONNX build of dslim/bert-base-NER)
Task / pipelinetoken-classification
LabelsBIO tags over 4 classes: PER, ORG, LOC, MISC (CoNLL-2003)
ArchitectureBERT-base cased (12 layers, 108M params) fine-tuned for NER
Quantizationq8 (8-bit) ONNX
BackendWebAssembly (runs anywhere; no WebGPU needed)
Download~110 MB, cached after first load
LicenseMIT
Web APIsWebAssembly, Web Workers โ€” all Baseline widely available

Run it

Type or paste text. Entities are highlighted inline a moment after you stop typing; hover a highlight for its confidence.

See inside โ€” the per-token BIO tags

The model doesn't see "Angela Merkel" as one thing โ€” it tags each WordPiece 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 โ€” including the occasional wobble (watch a stray I-ORG on a preposition), which is exactly why the confidence matters.

Why it matters

NER turns free text into structured data โ€” the names and places a downstream system can actually act on. Doing it in the browser means you can index, redact, or link entities without a single byte of the source text leaving the device.

Use cases

Basics

Type text and see people, orgs and places highlighted inline with confidences.

Practical

Redact PII on-device, and extract entities into a structured, grouped list.

Wild

Build a co-occurrence graph โ€” who and what appear together across a paragraph.

Multi-model

Link entity mentions across sentences by meaning with MiniLM embeddings.

How the API works

Token classification is one pipeline call:

import { pipeline } from "@huggingface/transformers";

const ner = await pipeline("token-classification", "Xenova/bert-base-NER");
const out = await ner("Tim Cook runs Apple in California");
// โ†’ [{ entity: "B-PER", word: "Tim", score: 0.999, index: 1 },
//    { entity: "I-PER", word: "Cook", score: 0.999, index: 2 },
//    { entity: "B-ORG", word: "Apple", score: 0.998, index: 4 },
//    { entity: "B-LOC", word: "California", score: 0.994, index: 6 }]

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, 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