Hello! Welcome to your first lesson on Named Entity Recognition (NER). Given your background in NLP and Transformer models, you're already familiar with how machines can process and "understand" text. In this course, we will channel that understanding toward a very specific and powerful goal: extracting structured information from unstructured text.
Today, we'll start with the fundamentals. Our goal is to answer two basic but crucial questions: What is Named Entity Recognition, and what kinds of information, or "entities," can it recognize? We'll define the task, explore its real-world applications, and familiarize ourselves with the standard categories of entities like people, organizations, and locations that NER systems are designed to find.
What is Named Entity Recognition?
At its heart, Named Entity Recognition is a form of information extraction. It is the process of scanning a text, identifying mentions of specific real-world objects, and classifying them into predefined categories.
To get a formal definition, let's start with a brief reading.
What Is Named Entity Recognition in NLP? - Aya Data
This article from Aya Data provides a very direct and useful definition of NER.
Please read the short introductory section, focusing on the definition in bold.
As the article states, the goal is to find things like people, organizations, and locations within a body of text. Imagine reading a news article. An NER system would automatically tag "Barack Obama" as a person, "the United States" as a location, and "the Democratic Party" as an organization.
These two images provide a clear visual illustration of what the output of an NER system looks like.


Why is NER Important?
This seemingly simple task of tagging words has profound implications. By turning unstructured sentences into structured data (e.g., a list of people and organizations mentioned), NER powers a vast range of applications. Since you have a background in computer science, you can think of it as a parsing step that makes raw text queryable and machine-readable.
To see just how widespread its applications are, let's watch a short video that explores some real-world use cases.
Named Entity Recognition (NER): NLP Tutorial For Beginners - S1 E12
This video from the codebasics channel provides an excellent overview of how NER is used in search engines, recommendation systems, and customer support.
Watch the first part of the video, from the beginning up to the start of the coding demo. Pay attention to the three main use cases presented: search, recommendations, and customer service.
As the video highlights, NER is a foundational technology for:
- Intelligent Search: Allowing you to search for articles mentioning a specific company ("Tesla") without getting results about the person ("Nikola Tesla").
- Recommendation Engines: Recommending content based on the entities you've shown interest in (e.g., movies by a certain director or articles about a particular city).
- Data Analytics and Business Intelligence: Automatically sorting customer feedback or news reports to track mentions of specific products or competitors.
The Taxonomy of Entities
Now that we know what NER is and why it's useful, let's look closer at the "named entities" themselves. The set of categories, or the taxonomy, is a crucial part of any NER system.
While the exact categories can be customized for a specific task, a small set of core types appears almost universally.
The core of NER is the set of categories, or "entity types," it uses. This article by Michael Brenndoerfer provides a great breakdown of the standard taxonomy.
Please read the section titled "Entity Types". Start from the beginning of the section and read through to the end of the subsection "Domain-Specific Taxonomies". Focus on understanding: The three core entity types: PER (Person), ORG (Organization), and LOC (Location). Examples of extended categories like GPE (Geopolitical Entity), DATE, and PRODUCT. The concept of domain-specific taxonomies and why they are necessary.
To summarize the key points from the reading:
- Core Entities: The foundational triad in most NER systems is Person, Organization, and Location. These were part of the original NER tasks and remain the most common.
- Extended Entities: Most general-purpose systems expand on this. For instance,
GPE(Geopolitical Entity) is often used for countries, states, and cities to distinguish them from natural locations like mountains (LOC). Other common types includeDATE,TIME,MONEY,PERCENT, andPRODUCT. - Domain-Specific Entities: This is where NER becomes incredibly versatile. For a biomedical application, you'd train a model to find
GENE,DISEASE, andCHEMICAL. For finance, you'd wantTICKER_SYMBOLandFISCAL_PERIOD. The choice of entity taxonomy is driven entirely by the needs of the final application.
A Glimpse into Practice with spaCy
While we'll spend this course learning to build NER models from the ground up, it's helpful to see what interacting with a pre-built NER model looks like. The popular NLP library spaCy comes with pre-trained models that can perform NER out of the box.
Let's revisit the codebasics video for a quick, practical demonstration.
Named Entity Recognition (NER): NLP Tutorial For Beginners - S1 E12
This practical demonstration shows how a developer would use spaCy to extract entities from text. It gives a concrete sense of the input and output of an NER system.
Watch the segment from the Jupyter Notebook section. Notice how the code iterates through doc.ents to get entities and prints the entity text and its label (e.g., ORG, PERSON, GPE). Also, pay close attention to the examples where the pre-trained model gets things wrong—this is a crucial aspect of working with real-world NLP models.
As you saw in the video, using a pre-trained model is straightforward. You process the text and then simply loop through the ents attribute of the processed document. However, you also saw its limitations. The model struggled with capitalization ("Twitter" vs. "twitter") and made a clear error by classifying "Bloomberg L.P." as a person.
This is a vital takeaway: out-of-the-box models are a great starting point, but they are not perfect. Their performance is tied to the data they were trained on. This is precisely why it's so important to understand how these models work and how to train or fine-tune them on your own data for your specific task—which is exactly what we will be learning to do in this course.
Conclusion
In this lesson, we laid the foundational groundwork for our study of Named Entity Recognition.
Key Takeaways:
- NER is the task of identifying and classifying named entities in unstructured text into predefined categories.
- It's a form of information extraction that turns raw text into structured, queryable data.
- NER has numerous applications, including improving search, powering recommendation systems, and enabling large-scale data analysis.
- Entity taxonomies typically include core types like Person (PER), Organization (ORG), and Location (LOC), but can be extended with many other general or domain-specific categories.
Preview of the Next Lesson:
We've seen what we want to extract. In the next lesson, we will focus on how to prepare data for an NER model. We'll learn about the BIO (Beginning, Inside, Outside) tagging scheme, a standard format for annotating text that tells a machine learning model precisely where each named entity begins and ends. This is the first critical step on the path to training our own custom NER models.