Named Entity Recognition, or NER, is an NLP task that finds and labels important named items in text. These named items are called entities.
Simple Idea: Text → Find important named items → Label each item by type
NER matters because large amounts of text contain important information. It helps computers extract names, places, dates, companies, products, and other useful details automatically.
Key Idea: NER helps turn unstructured text into structured data.
An entity is an important named item found in text.
Sentence: Dr. Patel works at Drexel University in Philadelphia.
Dr. Patel — Person
Drexel University — Organization
Philadelphia — Location
The model identifies the text span and assigns an entity type.
An entity type is the category assigned to an entity.
| Entity Type | Meaning |
|---|---|
| Person | Names of people |
| Organization | Companies, schools, agencies, teams |
| Location | Cities, countries, buildings, regions |
| Date | Specific dates or calendar references |
| Money | Currency amounts |
| Product | Named products or services |
A text span is the exact part of text that is labeled as an entity.
Sentence: Barack Obama was born in Hawaii.
Barack Obama — Person
Hawaii — Location
Key Idea: The model must find where the entity starts and where it ends.
Text spans matter because many entities contain multiple words.
Sentence: New York City is a major city in the United States.
Correct: New York City = Location / United States = Location
Incorrect: New = Location (incomplete span)
Goal: Identify the full named entity.
Text: Microsoft hired Sarah Chen in Seattle last March.
Microsoft — Organization
Sarah Chen — Person
Seattle — Location
last March — Date
NER output usually includes the entity text and the entity type.
Text: Amazon announced a new product in Canada.
Amazon — Organization
Canada — Location
Note: "new product" may not be labeled unless the model is trained to recognize product mentions.
Important: Different tools and datasets may use different labels.
PERSON entities are names of people.
Sentence: Marie Curie won Nobel Prizes in Physics and Chemistry.
Marie Curie — PERSON
ORG entities are organizations, such as companies, schools, agencies, or teams.
Sentence: Drexel University is located in Philadelphia.
Drexel University — ORG
GPE usually means geopolitical entity, while LOC is often used for locations that are not political units.
GPE: Canada / Toronto / France / Philadelphia / Japan
LOC: Mount Everest / Pacific Ocean / Sahara Desert
Important: Different NER systems may label locations differently.
DATE entities refer to dates or calendar expressions. TIME entities refer to specific times.
Sentence: The meeting is on Friday at 2 PM.
Friday — DATE
2 PM — TIME
More DATE Examples: Monday, June 5, 2026, next week
More TIME Examples: noon, midnight, 8:30 AM
MONEY entities refer to currency amounts. PERCENT entities refer to percentages.
Sentence: The price increased by 10 percent to $50.
10 percent — PERCENT
$50 — MONEY
More Examples: €100, 1 million CAD, 75%, 0.5%
PRODUCT entities refer to named products or services.
Sentence: She bought an iPhone in Toronto.
iPhone — PRODUCT
Note: Product recognition depends on the model and training data.
EVENT entities refer to named events.
Sentence: The Olympics will attract visitors from around the world.
Olympics — EVENT
Information extraction means pulling useful details from text. NER is one form of information extraction.
Text: John Smith joined Apple in 2024.
John Smith — Person
Apple — Organization
2024 — Date
Use: The structured information can be stored, searched, or analyzed.
Text classification labels a whole text. NER labels specific parts of the text.
Assigns a label to the whole document
Text: Apple opened a store in Toronto.
Label: Business news
Labels specific named items inside the document
Apple — Organization
Toronto — Location
Sentiment analysis detects tone or opinion. NER finds named entities. These tasks can be used together.
Text: I love using Spotify during long walks.
Sentiment Analysis: Positive
NER: Spotify — Product or Organization
Combined Use: Find which entity is mentioned and how the user feels about it.
Keyword matching searches for exact words. NER identifies named entities and their types.
Searches for exact word "Toronto"
Returns a word match only
Recognizes Toronto as a location
Gives structure, not just a word match
Rule-based NER uses human-written rules to find entities.
If a word starts with a capital letter and is followed by "Inc.", it may be an organization.
Example: Acme Inc.
Strength: Works well for simple patterns.
Limitation: Rules can be hard to maintain.
Text: The meeting is scheduled for June 5 at 3 PM.
Rules: Month name + number = DATE / Number + AM or PM = TIME
June 5 — DATE
3 PM — TIME
Useful For: Dates, times, and formatted text
Machine learning NER learns patterns from labeled examples.
Training Sentence: Apple opened an office in Toronto.
Apple — ORG
Toronto — LOC
Learning: The model sees many labeled examples and learns to predict entities in new text.
Deep learning NER uses neural networks. Modern systems often use transformer models because they can use context effectively.
Sentence 1: Apple released a new phone. — Apple: Organization
Sentence 2: She ate an apple after lunch. — apple: Not an organization
Key Idea: Context helps the model decide.
Context is important because the same word can mean different things in different sentences.
Jordan works at the hospital. — Jordan: Person
Jordan is a country in the Middle East. — Jordan: Location
Goal: Use surrounding words to choose the correct label.
Ambiguity means a word or phrase can have more than one meaning.
Word: Amazon
Possible Meanings: Company / River / Rainforest region
Amazon announced new delivery options. — Organization
The Amazon is home to many species. — Location
NER models must use context.
Many entities contain multiple words. The model should identify the full span.
Incorrect: New = Location
Correct: New York City = Location
Sometimes entities can appear inside other entities.
University of Toronto
Full Entity: University of Toronto = Organization
Inside It: Toronto = Location
Important: Some NER systems only label the full organization. Advanced systems may support nested entities.
BIO tagging is a common way to label tokens for NER. BIO stands for Beginning, Inside, and Outside.
B — Beginning of an entity
I — Inside an entity
O — Outside an entity
Text: New York City is busy.
New = B-LOC / York = I-LOC / City = I-LOC / is = O / busy = O
Sentence: Sarah works at Google.
Sarah = B-PERSON / works = O / at = O / Google = B-ORG / . = O
Purpose: BIO tagging helps models find entity boundaries.
NER models need labeled training data. The labels show which text spans are entities and what type they are.
Text: Dr. Lee works at Toronto General Hospital.
Dr. Lee — PERSON
Toronto General Hospital — ORG
Important: High-quality labels are needed. Incorrect labels can confuse the model.
Annotation is the process of labeling data. For NER, annotators mark entity spans and types.
Sentence: Tesla opened a factory in Germany.
Tesla — ORG
Germany — GPE
Challenge: Entity boundaries must be precise.
NER is often part of a larger NLP system.
Collect text — gather documents, messages, or articles
Clean or normalize text if needed — fix formatting and noise
Tokenize the text — split into words or subwords
Run the NER model — apply the trained classifier
Identify entity spans — find where each entity starts and ends
Assign entity types — label each span as PERSON, ORG, DATE, etc.
Store or display results — save or show the extracted entities
Evaluate the results — check precision, recall, and F1
NER can improve search by identifying important details in a query.
Search Query: schools in Philadelphia
Possible Entities: Philadelphia = Location
Use: The search system can use this structure to return better results.
NER helps analyze long documents by extracting important names, dates, locations, and organizations.
NER: Extracts these details into a structured summary.
Chatbots can use NER to understand important details in user messages.
User: Book a flight to Toronto tomorrow.
Toronto — Location
tomorrow — Date
Use: The chatbot can use these entities to complete the task.
Customer support systems can use NER to identify products, dates, order details, or account-related information.
User: My iPhone order from May 12 has not arrived.
iPhone — Product
May 12 — Date
Use: Route the request or search for the right order information.
NER can help extract information from healthcare text, but it requires careful validation and privacy protection.
Text: The patient was prescribed amoxicillin on Monday.
amoxicillin — Medication | Monday — Date
Businesses use NER to analyze documents, emails, reviews, and reports.
Example: Analyze reviews to see which products are mentioned most often.
NER can help organize news by people, places, organizations, dates, and events.
Article: The Prime Minister met with leaders in Ottawa on Tuesday.
Prime Minister — Person or title, depending on system
Ottawa — Location
Tuesday — Date
Use: Organize and search news content.
A knowledge graph stores relationships between entities. NER can help identify entities before relationships are extracted.
Text: Marie Curie was born in Warsaw.
Marie Curie — Person
Warsaw — Location
Possible Relationship: Marie Curie was born in Warsaw.
NER: Often the first step in building structured knowledge.
Custom NER means training or adapting a model to recognize entity types specific to a domain.
Text: The student asked about React hooks and TypeScript.
React — Framework | TypeScript — Programming language
NER models need careful evaluation. Common metrics include precision, recall, and F1 score.
Precision: Of the entities the model found, how many were correct?
Recall: Of the correct entities in the text, how many did the model find?
F1 Score: A balance between precision and recall.
Precision measures how many predicted entities are correct.
Model predicted: 10 entities
Correct predictions: 8
Precision: 8 out of 10
Meaning: High precision means fewer false positives.
Recall measures how many true entities the model found.
The text had: 12 correct entities
The model found: 9
Recall: 9 out of 12
Meaning: High recall means fewer missed entities.
F1 score balances precision and recall.
The model finds few entities, but most are correct.
The model finds many entities, but some are wrong.
NER evaluation often requires the exact entity span and correct entity type.
Correct Entity: New York City
Model Prediction: New York
Problem: The span is incomplete.
NER Evaluation: May count this as incorrect.
A false positive happens when the model labels something as an entity, but it should not.
Text: I like apple pie.
Incorrect NER: apple = Organization
Problem: The word apple refers to fruit, not the company.
A false negative happens when the model misses a real entity.
Text: The meeting is in Mississauga.
Missed Entity: Mississauga = Location
Problem: The model failed to recognize the location.
A wrong entity type happens when the model finds the entity but assigns the wrong category.
Text: Amazon announced new jobs.
Incorrect: Amazon = Location
Correct: Amazon = Organization
Reason: Context helps reduce this error.
NER often uses capitalization as a clue, but capitalization is not always reliable.
Apple — Company
apple — Fruit
Problem: Text messages may use lowercase for everything.
Example: i visited toronto last week
Goal: Still recognize toronto as a location.
General NER models may not recognize specialized terms.
Healthcare Text: The patient was prescribed metformin.
General Model: May not label metformin correctly.
Healthcare NER Model: May recognize metformin as a medication.
Key Idea: Specialized domains often need specialized training data.
NER may identify sensitive information. This can be useful, but it also creates privacy risks.
Important: Extracted entities must be handled responsibly.
NER models can have bias if training data is not representative.
A model may recognize common names better than less common names.
A model may perform better on some languages, regions, or writing styles than others.
Solution: Test across diverse examples.
NER can save time, but it is not perfect. Human review is important when accuracy matters.
Key Idea: NER should support humans, not blindly replace careful review.
Key Idea: NER finds entities, but other NLP tasks may also be needed.
Misconception: NER understands the whole sentence.
Reality: NER focuses on finding and labeling named entities.
Misconception: NER is always correct.
Reality: NER can miss entities or assign wrong labels.
Misconception: Capitalized words are always entities.
Reality: Some capitalized words are not entities, and some entities may be lowercase.
Misconception: NER and keyword search are the same.
Reality: NER identifies entity types, not just exact word matches.
Identify the named entities in the sentence below and label each entity type.
Sentence: Google opened a new office in Toronto on June 5.
Then explain why context matters when deciding whether a word is an organization, location, date, or something else.
Ask the AI if you need help understanding Named Entity Recognition, entities, entity types, text spans, BIO tagging, precision, recall, false positives, false negatives, context, custom NER, or how NER is used in real-world NLP systems.