Named Entity Recognition (NER) finds the proper names in text and says what kind they are. It scans a sentence and pulls out spans like people, places, organisations and dates — turning free prose into something a database can hold.
Where you meet it
- Search and question answering — knowing "Apple" is a company, not a fruit, changes the results.
- Redacting PII, routing support tickets, and feeding knowledge graphs.
- Resumé and invoice parsing — names, employers, amounts, dates.
- RAG pipelines that index documents by the entities they mention.
What it does
NER does two jobs at once: detection (where does an entity start and end?) and classification (is it a PER, LOC, ORG, DATE…?). The output is a set of typed spans over the original text, not just a bag of keywords.
An entity is a span, not a word — and Apple is a company or a fruit only by the words around it.
How it works
NER is a sequence-labeling task: split the text into tokens, then give every token a tag. To mark spans that cover more than one word, the standard trick is the BIO scheme — B- begins an entity, I- stays inside the same one, and O is outside any entity:
Tim B-PER
Cook I-PER
met O
Sarah B-PER
at O
Apple B-ORG
in O
Berlin B-LOC
. O
Reading the tags back gives the spans: Tim Cook and Sarah are people, Apple an organisation, Berlin a place. Modern systems frame this as token classification: a Transformer (e.g. BERT) produces one vector per token, and a linear layer predicts its tag — often with a softmax confidence per prediction.
Watch out
- Entities are spans, not words. A multi-word name like
Tim Cookis one entity; boundaries are where models slip most. - It's context-dependent.
Appleis a company in one sentence and a fruit in another — only the surrounding words decide. - Domain and language matter. A model trained on news handles biomedical or legal text poorly; tag sets differ across languages.
- Score at the span level (entity F1), not per token. Getting
B-PER I-PERhalf-right still misses the entity — token accuracy flatters the model.
Go deeper
Named Entity Recognition (NER) findet die Eigennamen in einem Text und sagt, von welcher Art sie sind. Sie durchsucht einen Satz und zieht Spans heraus — Personen, Orte, Organisationen, Daten — und macht aus freier Prosa etwas, das eine Datenbank halten kann.
Wo es vorkommt
- Suche und Question Answering — zu wissen, dass "Apple" eine Firma ist und keine Frucht, ändert die Treffer.
- PII schwärzen, Support-Tickets routen, Knowledge Graphs speisen.
- Lebenslauf- und Rechnungs-Parsing — Namen, Arbeitgeber, Beträge, Daten.
- RAG-Pipelines, die Dokumente nach den genannten Entitäten indexieren.
Was es tut
NER erledigt zwei Dinge zugleich: Erkennung (wo beginnt und endet eine Entität?) und Klassifikation (ist es eine PER, LOC, ORG, DATE…?). Das Ergebnis sind typisierte Spans über dem Originaltext, nicht bloß eine Stichwortliste.
Eine Entität ist ein Span, kein Wort — und Apple ist Firma oder Frucht nur durch die Wörter drumherum.
Wie es funktioniert
NER ist eine Sequence-Labeling-Aufgabe: Text in Tokens zerlegen und jedem Token ein Tag geben. Um Spans über mehrere Wörter zu markieren, dient das BIO-Schema — B- beginnt eine Entität, I- bleibt innerhalb derselben, O steht außerhalb:
Tim B-PER
Cook I-PER
met O
Sarah B-PER
at O
Apple B-ORG
in O
Berlin B-LOC
. O
Liest man die Tags zurück, ergeben sich die Spans: Tim Cook und Sarah sind Personen, Apple eine Organisation, Berlin ein Ort. Moderne Systeme behandeln das als Token-Classification: Ein Transformer (z. B. BERT) erzeugt einen Vektor pro Token, und ein lineares Layer sagt dessen Tag vorher — oft mit einer Softmax-Konfidenz je Vorhersage.
Worauf achten
- Entitäten sind Spans, keine Wörter. Ein mehrwortiger Name wie
Tim Cookist eine Entität; an den Grenzen patzen Modelle am häufigsten. - Es ist kontextabhängig.
Appleist im einen Satz eine Firma, im anderen eine Frucht — nur die umgebenden Wörter entscheiden. - Domäne und Sprache zählen. Ein auf News trainiertes Modell versagt bei Biomedizin oder Recht; Tag-Sets unterscheiden sich je Sprache.
- Auf Span-Ebene messen (Entity-F1), nicht je Token. Ein halb richtiges
B-PER I-PERverfehlt die Entität trotzdem — Token-Accuracy schmeichelt dem Modell.