← All models

token-classification · text · WASM · ~111 MB

French NER — find the names hiding in a sentence

Where POS tagging labels every word's grammatical role, named-entity recognition (NER) hunts a narrower quarry: the proper names. Who is this text about? Which companies, which places? This model reads French and hands back each person, organisation, location and miscellaneous name it finds, with a confidence. Type below and watch the entities light up inline, then look inside at the raw per-token labels. All on your device.

Honest note on language: this runs Xenova/camembert-ner, the ONNX export of Jean-Baptiste/camembert-ner — a French NER model (CamemBERT fine-tuned on WikiNER-fr). The showcase already has English and multilingual BERT NER; this is the French CamemBERT family, so the examples are in French with an English gloss. The capability — finding typed names in running text — is the same in any language.

At a glance

ModelXenova/camembert-ner (ONNX q8 of Jean-Baptiste/camembert-ner)
Task / pipelinetoken-classification
LabelsWikiNER tag set — O, I-PER, I-ORG, I-LOC, I-MISC — aggregated here into typed entity spans
ArchitectureCamemBERT (RoBERTa-based, SentencePiece, ~110M params) fine-tuned for NER on ~170k French WikiNER sentences
LanguageFrench (validated on emails/chat; handles lower-case entity starts well)
Quantizationq8 (8-bit) ONNX
BackendWebAssembly (runs anywhere; no WebGPU needed)
Download~111 MB, cached after first load
LicenseMIT
Web APIsWebAssembly, Web Workers — all Baseline widely available

Run it

Type or paste a French sentence. Each detected entity is coloured by its type a moment after you stop typing; hover an entity for its raw label and confidence.

“Marie Curie joined the Sorbonne in Paris for her research on radium.”

See inside — raw labels & detected entities

The model doesn't see whole words — it labels each SentencePiece sub-token independently (the ▁, shown here as ·, marks where a new word begins) with one of O, I-PER, I-ORG, I-LOC, I-MISC. We merge the pieces back into words, then group consecutive same-type words into entity spans — so Los · Al · tos becomes one location "Los Altos". Below are the raw per-token labels straight from the model, and the spans they aggregate into.

Detected entities

Raw sub-token labels

Why it matters

Named entities are the skeleton of meaning in news, mail, documents and chat. Once you know who and where a text talks about, you can index it, redact it, link it or summarise around it — and doing it in the browser means the text never leaves the device.

Use cases

Basics

Tag any French sentence and see every person, place, organisation and misc name colour-coded inline, with confidences.

Practical

Build an entity index of a long text (with JSON export) and redact names for privacy — two runnable workflows.

Wild

Recast the story: swap every detected name with your own cast and rebuild the text.

Multi-model

NER finds the entities; CamemBERT fill-mask reimagines each one in context into a fresh sentence.

How the API works

Token classification is one pipeline call:

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

const ner = await pipeline("token-classification", "Xenova/camembert-ner");
const out = await ner("Apple est créée par Steve Jobs à Los Altos.");
// → [{ entity: "I-ORG", word: "▁Apple", score: 0.85, index: 1 },
//    { entity: "I-PER", word: "▁Steve", score: 0.96, index: 5 },
//    { entity: "I-PER", word: "▁Job",  score: 0.99, index: 6 },
//    { entity: "I-PER", word: "s",     score: 0.99, index: 7 },
//    { entity: "I-LOC", word: "▁Los",  score: 0.75, index: 9 },
//    { entity: "I-LOC", word: "▁Al",   score: 0.99, index: 10 },
//    { entity: "I-LOC", word: "tos",   score: 0.97, index: 11 }, …]

The pipeline returns one label per SentencePiece sub-token — with a ▁ marking each word start but no character offsets. We merge sub-word pieces into whole words (taking the word-initial label), map each word back to its span in the original text so highlights land exactly, and aggregate consecutive same-type words into entity spans. It all runs in a Web Worker so typing stays smooth.

References