← CS Lab AI & Machine Learning / Named Entity Recognition Open standalone ↗

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

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 schemeB- 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 Cook is one entity; boundaries are where models slip most.
  • It's context-dependent. Apple is 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-PER half-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

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-SchemaB- 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 Cook ist eine Entität; an den Grenzen patzen Modelle am häufigsten.
  • Es ist kontextabhängig. Apple ist 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-PER verfehlt die Entität trotzdem — Token-Accuracy schmeichelt dem Modell.

Mehr dazu

Next up
AI & Machine LearningConvolution & CNNs AI & Machine LearningPooling All concepts →