NER Flashcards

(14 cards)

1
Q

What is Named Entity Recognition ?

A

Named Entity Recognition (NER) is the task of identifying and classifying specific pieces of information (called entities) in text into predefined categories like:

🧑 Person names

🏙️ Locations

🏢 Organizations

📅 Dates, ⏰ Time

💰 Monetary values, % Percentages

📚 Product names, 🧬 Medical terms, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is NER?

A

Named Entity Recognition (NER) is the process of detecting named entities in text and classifying them into predefined categories such as:

PERSON → names of people

LOCATION → cities, countries, landmarks

ORGANIZATION → companies, institutions

DATE / TIME → dates, durations

MONEY / PERCENT → monetary values, percentages

PRODUCT / EVENT / DISEASE → optional/custom categories

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Example of NER

A

Text:
Apple Inc. was founded by Steve Jobs in California in 1976.

NER Output:
[(“Apple Inc.”, ORGANIZATION),
(“Steve Jobs”, PERSON),
(“California”, LOCATION),
(“1976”, DATE)]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Explain POS, Chunking, NER

A

POS Tagging → individual words
Chunking → phrase-level structure
NER → real-world objects/entities

POS Tagging (Part-of-Speech Tagging):Part-of-Speech tagging assigns a grammatical label (such as noun, verb, adjective, etc.) to each word in a sentence based on its role and context.
Example:
Word POS Tag
The Determiner (DT)
dog Noun (NN)
barked Verb (VBD)
loudly Adverb (RB)

Chunking (Shallow Parsing):Chunking groups words into phrases like noun phrases (NP), verb phrases (VP), etc., using POS tags as a guide.
Example:
Sentence: The smart girl read a book.
Noun Phrase (NP): The smart girl
Verb Phrase (VP): read a book
This breaks the sentence into functional groups.

NER (Named Entity Recognition):
NER locates and classifies real-world entities in text into predefined categories like Person, Organization, Location, Date, etc.
Example:
Sentence: Apple launched the iPhone in California on Monday.
Entity NER Tag
Apple ORGANIZATION
iPhone PRODUCT (if supported)
California LOCATION
Monday DATE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why is NER important?

A

📄 Information Extraction: Find people, places, dates in documents

💬 Chatbots: Understand what entity the user is referring to

📊 Business Intelligence: Extract company names, trends from articles

🏥 Medical NLP: Identify diseases, drug names in medical records

📚 Search Engines: Improve search by recognizing key entities

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Named Entity Recognition (NER) – Common Entity Types

A

PERSON:
👉 Names of specific people.
✅ Examples: Virat Kohli, Elon Musk

ORGANIZATION (ORG):
👉 Companies, institutions, or groups.
✅ Examples: Google, BCCI, UNICEF

LOCATION (LOC):
👉 Geographical locations.
✅ Examples: India, Hyderabad, Himalayas

DATE:
👉 Any date expression.
✅ Examples: March 15, 2025, yesterday

TIME:
👉 Specific time of day.
✅ Examples: 10:30 AM, noon, midnight

MONEY:
👉 Monetary amounts.
✅ Examples: ₹500, $1000, 12 dollars

QUANTITY:
👉 Numeric values with units.
✅ Examples: 50kg, 20km, 3 liters

PERCENT:
👉 Percentage values.
✅ Examples: 75%, 20 percent

PRODUCT (Optional):
👉 Commercial products.
✅ Examples: iPhone, Tesla Model S

EVENT (Optional):
👉 Named events.
✅ Examples: World War II, Olympics

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is BIO tagging in NER? why it is needed, explain with example

A

BIO tagging is part of the NER task, and the NER model uses BIO tagging to understand the structure and boundaries of entities in the text.

When we train a Named Entity Recognition (NER) model, the goal is to identify specific entities like names, locations, organizations, dates, etc. However, the difficulty arises in distinguishing where the entity starts and where it ends, especially in cases where an entity consists of multiple words.

BIO Tagging (Beginning, Inside, Outside) Format:
BIO tagging solves this by marking each word in the sentence based on its position within an entity. Here’s how it works:

B-X (Beginning): Marks the first word of an entity.
I-X (Inside): Marks the subsequent words inside the same entity.
O (Outside): Marks words that are not part of any entity.

Example Sentences with BIO Tagging:
Sentence 1: “Barack Obama lives in Washington.”
Word: Barack Obama lives in Washington
Tag: B-PER I-PER O O B-LOC

B-PER: “Barack” is the beginning of a person entity.
I-PER: “Obama” is part of the same person entity.
O: “lives” and “in” are not part of any named entity.
B-LOC: “Washington” is the beginning of a location entity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Why is BIO Tagging Used in NER?

A

Clear boundaries: It helps the model identify where the entity starts and where it ends.

Multi-word entities: It allows the model to recognize that a named entity like “Barack Obama” spans two words, not just one.

Non-entities: The “O” tag clearly distinguishes words that are not part of any entity, preventing errors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

When is BIO Tagging Important?

A

Complex entities: When an entity has multiple words, like “United States of America” or “New York City,” BIO ensures each word is properly labeled.

Sequential prediction: NER models need to understand the structure of text, especially when words are connected (e.g., “United” → B-LOC, “States” → I-LOC, “of” → I-LOC).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Approaches to solve NER

A

Rule-based

Statistical models (HMM, CRF)

Deep Learning models (RNN, LSTM, BiLSTM, BERT)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Explain Rule Based approach for NER

A

Rule-based Approach
What it is: This is a traditional approach where rules or patterns are explicitly written to identify entities in the text.

How it works: You define a set of rules based on regular expressions (regex) or dictionaries for entity identification. For example:

Pattern-based rules: “If a word starts with a capital letter and is followed by another capital letter, it could be a person name.”

Dictionary-based rules: A predefined list of names, places, or organizations can help identify entities.

Example:
A rule-based system might look for patterns like “Mr. [Capitalized Word]” to identify person names (e.g., “Mr. Smith”).
If it sees “Monday” or “December”, it may tag them as a day or month.

Advantages:
Simple to implement.
Interpretability: You can easily understand why a particular word was tagged.

Disadvantages:
Limited coverage: Hard to cover all possible variations.
ack of flexibility: Doesn’t adapt well to unseen data or new entities.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Explain Statistical models (HMM, CRF) for NER

A

Statistical Models
What it is: These models use probabilities to predict the likelihood of a word being part of an entity, based on the patterns in labeled data.

Hidden Markov Models (HMM):
How it works: HMMs use sequences of words to predict whether a word is part of an entity or not. They model the sequence of words as a series of states (e.g., “inside a person name” or “outside an entity”).

The model considers the current state and the previous states to decide the current entity tag.

Conditional Random Fields (CRF):
How it works: CRFs are a probabilistic graphical model that are used for sequence labeling tasks, like NER. Unlike HMMs, which assume independence between observed features, CRFs can take interactions between features into account when predicting the entity class.

Advantages:
Better handling of sequential data (e.g., sentences or word sequences).
Can incorporate contextual features like neighboring words.

Disadvantages:
Requires labeled training data to learn good models.
Limited scalability compared to modern deep learning models.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Explain deep learning models for NER

A

DL Models used are: RNN, LSTM, BiLSTM, BERT
Recurrent Neural Networks (RNN):
How it works: RNNs process sequences of data (like sentences) step-by-step, using feedback loops to remember information about previous words. This helps with understanding context across the sequence, which is essential for NER.

For example, an RNN might identify that “Mr.” in a sentence followed by a capitalized word like “Smith” refers to a person’s name.

BERT (Bidirectional Encoder Representations from Transformers):
How it works: BERT is a transformer-based model that uses attention mechanisms to understand the context of words in a sentence. BERT is pretrained on a large corpus and can be fine-tuned for NER tasks.

Unlike RNNs or LSTMs, BERT doesn’t process the text sequentially. Instead, it looks at all the words in a sentence simultaneously, allowing it to capture both forward and backward context at once.

Advantages of Deep Learning Models:
No need for manual feature extraction: The model learns features on its own.
State-of-the-art performance: Deep learning models (especially BERT) often outperform traditional methods (HMM, CRF) in NER tasks.
Generalization: Deep learning models can generalize better to unseen data.

Disadvantages:
Requires large datasets: Deep learning models require lots of labeled data to perform well.
Computationally expensive: Training deep learning models requires more computing power and time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Real-World Applications of NER

A

Search Engines (Google, Bing, etc.)
Entity Recognition for Search Optimization: NER helps search engines understand and categorize the content of web pages. For instance, when you search for “Apple,” the search engine needs to differentiate between the fruit and the tech company.
Example: If you search for “Elon Musk,” Google can recognize that it’s a person (and not just a common noun) and provide related news, facts, and media about him.

Voice Assistants (Amazon Alexa, Google Assistant, Siri)
Understanding Commands: Voice assistants rely heavily on NER to identify and extract entities from spoken language. For example, when you say, “What’s the weather in Paris tomorrow?” the assistant uses NER to extract “Paris” as a location and “tomorrow” as a time entity to provide accurate weather information.
Example: “Set an alarm for 7 AM” → Recognize “7 AM” as a time entity.

Customer Service & Chatbots
Automating Support: Many customer service systems use NER to automatically identify relevant details from customer queries. NER helps to pick up on things like product names, order numbers, dates, and locations. This makes automated responses more accurate and relevant.
Example: “I ordered an iPhone 13 on 5th March, but I haven’t received it yet” → Recognize “iPhone 13” as a product and “5th March” as a date to generate an appropriate response.

Medical Field (Clinical Text Analysis)
Extracting Entities from Medical Records: NER is used to extract key entities from clinical text, like patient names, diseases, medications, medical conditions, treatment dates, etc. This makes it easier to analyze patient data and clinical reports.
Example: “Patient John Doe was diagnosed with Type 2 Diabetes on 1st March 2022” → Recognize “John Doe” as a person, “Type 2 Diabetes” as a medical condition, and “1st March 2022” as a date.

E-commerce and Recommendation Systems
Personalized Recommendations: E-commerce platforms use NER to extract key product names, categories, brands, and even customer preferences from reviews or queries to personalize the shopping experience and suggest relevant products.
Example: “I want a red Nike T-shirt” → Recognize “Nike” (Brand) and “red T-shirt” (Product description).

and many more..

How well did you know this?
1
Not at all
2
3
4
5
Perfectly