Contents
- What is named entity recognition (NER)?
- How does NER work?
- What are the main NER approaches?
- How is a NER model evaluated?
- What is named entity recognition used for?
- Which tools and libraries can you use for NER?
- What limits NER accuracy?
- From entity recognition to document data extraction
- Frequently asked questions
- How we updated this guide
What is named entity recognition (NER)?
Named entity recognition (NER) is the natural language processing task that finds the names of real things in a text, such as people, companies, places, dates and amounts, and labels each one with a type. NER stands for named entity recognition; it is also called entity extraction or entity chunking. It is the step that turns free text into fields a machine can store.
On supporting documents, NER is also a building block of document fraud detection: once the employer, the pay and the dates are tagged, they can be compared with the rest of the file. That comparison is the core of pay stub verification, where a name or a total that does not match is the first warning sign.
Take the sentence "Acme Corp. paid $12,400 to Northwind Traders in Chicago on March 3, 2026." A NER model returns five entities: Acme Corp. (organization), 12,400 (money), Northwind Traders (organization), Chicago (geopolitical entity) and March 3, 2026 (date). Everything else in the sentence is left untagged. In practice, NER always combines two tasks: detection, finding where each entity starts and ends, and classification, assigning each span to a category.

Which entity types does NER recognize?
The label set depends on the dataset a model was trained on. Two schemes dominate: the CoNLL-2003 benchmark, which uses four types, and OntoNotes 5, used by the default English models of the spaCy library, which uses eighteen. The table shows the most frequent types and how each scheme names them.
| Entity | Example | CoNLL | OntoNotes |
|---|---|---|---|
| Person | Marie Curie | PER | PERSON |
| Organization | Acme Corp. | ORG | ORG |
| Country, city | Chicago | LOC | GPE |
| Other place | Lake Tahoe | LOC | LOC |
| Date | March 3, 2026 | none | DATE |
| Amount | $12,400 | none | MONEY |
| Other names | Olympics | MISC | EVENT |
OntoNotes 5 also covers times, percentages, quantities, products, laws, facilities and nationality or religious groups (NORP). Business projects usually add their own types on top: invoice number, tax ID, IBAN, drug name, contract clause.

How does NER work?
A NER system follows the same sequence whatever its technology: split the text, spot candidate spans, label them, use the context to settle ambiguous cases, then clean and export the result. The diagram below summarizes that processing chain.

1. Tokenization
Tokenization splits the raw text into units called tokens: words, punctuation marks, numbers. Every later step works on these tokens. For example, the sentence:

is segmented into ["The", "48th", "World", "Hospital", "Congress", "will", "take", "place", "in", "Geneva", "from", "November", "10", "to", "13", ",", "2025", "."].
2. Entity identification
The system then looks for groups of tokens that could be named entities. Older systems relied on explicit clues such as capitalization, digits, the word before ("in", "on") or lists of known names called gazetteers; modern models learn these clues from annotated examples.
3. Entity classification
Each candidate span then receives a category from a model trained on annotated text: conditional random fields (CRF) in older systems, neural networks and transformers today.

Most models treat NER as sequence labeling with the BIO scheme: each token gets B- if it begins an entity, I- if it is inside one, and O if it is outside any entity. "Northwind Traders" becomes B-ORG, I-ORG, which keeps multi-word names together.
4. Contextual analysis
The same word can name different things, and context is what lets a model decide. Neighboring words, syntax and even the layout of the page are used to remove the ambiguity.

5. Post-processing
A final pass merges multi-word names, removes duplicates and overlaps, validates values against reference lists or business rules, and links each entity to a record when needed (entity linking). The output is usually JSON, where each entity has its text, type and position.
A NER example in Python
The open source library spaCy runs the whole chain in a few lines. We ran this code on November 5, 2026 with spaCy 3.8.2 and its small English model, en_core_web_sm 3.8.0, trained on OntoNotes 5:
import spacy
model = "en_core_web_sm"
nlp = spacy.load(model)
text = ("Acme Corp. paid $12,400 "
"to Northwind Traders "
"in Chicago "
"on March 3, 2026.")
for ent in nlp(text).ents:
print(ent.text, ent.label_)
It prints: Acme Corp. ORG, 12,400 MONEY, Northwind Traders ORG, Chicago GPE, March 3, 2026 DATE. The dollar sign is left outside the MONEY span: a small boundary choice that post-processing has to handle before the amount is stored.
What are the main NER approaches?
Four families of methods coexist, and production systems often mix them. Each one trades precision, cost and flexibility differently.
1. Rules and dictionaries
Hand-written patterns catch entities with a fixed shape (phone numbers, dates, invoice numbers), and dictionaries list known names, places or companies, often combined with fuzzy matching to tolerate typos. Rules are precise and explainable but brittle and costly to maintain.
2. Statistical machine learning
Conditional random fields, support vector machines and decision trees learn from annotated examples, using features such as capitalization, suffixes or neighboring words. They generalize better than rules but need labeled data and feature engineering.
3. Deep learning and transformers
Recurrent networks (LSTM with a CRF layer) and then transformers such as BERT learn the features themselves and read the whole sentence at once, which is how they tell "Apple" the company from "apple" the fruit. The BERT paper reports an F1 score of 92.8 on the CoNLL-2003 test set for BERT large (Devlin et al., 2018).
4. LLMs and zero-shot NER
Classic models only recognize the types they were trained on. Large language models can extract any entity type described in a prompt, and compact models such as GLiNER (Zaratiana et al., 2023) take the type names as input; its authors report that it outperforms ChatGPT in zero-shot evaluations on several NER benchmarks while running much faster. Hybrid systems combine these families: rules first for fixed formats, a model for the ambiguous cases.
How is a NER model evaluated?
NER is scored at the entity level: a prediction counts as correct only if both its boundaries and its type match the reference annotation. Precision is the share of predicted entities that are correct, recall the share of real entities the model found, and the F1 score is the harmonic mean of the two.
Suppose a sentence contains three entities and the model predicts three spans: two are right, one is a false alarm, and one real entity is missed. The worked example gives the counts and the resulting scores.
| Count | Value | Metric | Score |
|---|---|---|---|
| True positives | 2 | Precision, 2/3 | 0.67 |
| False positives | 1 | Recall, 2/3 | 0.67 |
| Missed entities | 1 | F1 score | 0.67 |
For scale: at the MUC-7 evaluation in 1998, the best system scored 93.39% F-measure on English news, while human annotators scored 97.60% and 96.95% (Marsh and Perzanowski, 1998). Scores on clean news text do not transfer to invoices, medical notes or scanned forms, so every project should measure precision and recall on its own documents.
What is named entity recognition used for?
NER is used wherever text has to become data. The illustration below gives an overview of the main families of applications.

Most projects fall into one of six uses:
- Document processing: after OCR reads a scanned invoice or contract, NER pulls out the vendor, dates, amounts and references.
- Privacy and redaction: finding and masking names, addresses and account numbers before a document is shared.
- Search and recommendation: tagging articles with the people, companies and places they mention.
- Compliance and risk: spotting sanctioned names or counterparties in large document sets.
- Healthcare: extracting drugs, dosages and diagnoses from clinical notes.
- Customer support and chatbots: understanding which product, order or place a request is about.
Which tools and libraries can you use for NER?
The choice depends on whether you want to train and host a model yourself or call a ready-made service. The main options, all of which ship pretrained models for people, places, organizations and dates:
- spaCy: fast, production-oriented Python library with pretrained models for many languages and fine-tuning on your own labels.
- Flair: library from Zalando Research that stacks embeddings from several models, popular in research and multilingual work.
- Stanford CoreNLP: Java toolkit with Python wrappers, an academic reference that is heavier to run.
- Cloud APIs: Google Cloud Natural Language, Amazon Comprehend and IBM Watson Natural Language Understanding return entities without any model to train or host.
What limits NER accuracy?
NER performs well on clean, general text. Four obstacles explain most errors in real projects.
Ambiguity and context
The same word can name several kinds of things: "Amazon" is a company or a river. The type also depends on the role of the word in the sentence. Here, "Renault" is an organization:

But in the next sentence the same word refers to a racing team rather than to the car maker itself. Bidirectional models such as BERT capture these nuances better than older systems.

Boundaries and nested entities
In "New York City Mayor Eric Adams", the person is "Eric Adams", not "Mayor Eric". Nested names, such as a city inside a university name, are harder still, because many models assume entities never overlap.
Languages and scarce annotated data
Some languages and specialized fields such as law or medicine have few annotated corpora. The Universal NER project was created to fill that gap: its first version covers 18 datasets in 12 languages (Mayhew et al., 2023).
Noisy text
Models are sensitive to typos, OCR errors and unusual phrasing. Shortlisting candidate entities by similarity score, then validating the best one, makes matching more robust when strings differ:

From entity recognition to document data extraction
In document workflows, NER rarely works alone. A scanned or photographed document first has to be read, then its entities found, checked and exported. The chain below shows what goes in and what comes out at each stage of that pipeline.
From a scanned document to data
- InputScanned document
- Invoice, contract, pay stub
- PDF or photo
- Step 1OCR reads the text
- Words and their position
- Step 2NER tags entities
- Vendor, dates, amounts
- Step 3Values checked
- Reference lists, totals
- OutputStructured data
- JSON, Excel or API
This is the approach of intelligent document processing: computer vision, natural language processing and named entity recognition combined to return structured fields from documents such as:

- invoices (amounts, vendors, line items), the field of invoice OCR;
- contracts (clauses, dates, signatories);
- pay slips (gross and net pay, deductions);
- bank statements (balances, transactions).
In these documents, layout matters as much as language: a total is identified as much by its place at the bottom of a table as by the words around it, so document tools pair NER with models that read the page structure, and with rules that check that line items add up to the total.
Frequently asked questions
What does NER stand for?
NER stands for named entity recognition. It is the natural language processing task that finds names of people, organizations, places, dates, amounts and other entities in a text and labels each with a type. It is also called entity extraction or entity chunking.
What is named entity recognition used for?
To turn text into structured data: extracting vendors, dates and totals from invoices, masking personal data before sharing a document, tagging news articles, screening names for compliance, and helping chatbots understand what a request is about.
What is an example of named entity recognition?
In "Acme Corp. paid $12,400 to Northwind Traders in Chicago on March 3, 2026", a NER model tags Acme Corp. and Northwind Traders as organizations, 12,400 as money, Chicago as a place and March 3, 2026 as a date. That is the output spaCy's small English model returned in our test.
Which NER model should you use?
It depends on your labels and data. A pretrained spaCy or transformer model covers standard types such as people, places and dates. For business-specific fields, fine-tune a transformer on your own annotated examples, or use a zero-shot model such as GLiNER or an LLM with a schema when you have no labeled data.
Is NER the same as entity extraction?
Yes, the two terms are used interchangeably. Entity linking is a different, later step: it connects each extracted entity to a specific record in a knowledge base, so "Paris" points to the city and not to a person. Relation extraction then finds how entities are connected, such as which person works for which company.
How we updated this guide
This guide was shortened on November 21, 2026, after reading in full the pages that rank for "named entity recognition" and "NER" in the United States, most of which answer in 1,700 to 2,100 words. Figures were checked against their original sources (the BERT paper, the CoNLL-2003 task description, the GLiNER and Universal NER papers, the spaCy model card and the MUC-7 results), and the Python example was run by us on November 5, 2026.





