Bird
Raised Fist0
NLPml~20 mins

Entity types (PERSON, ORG, LOC, DATE) in NLP - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
πŸŽ–οΈ
Entity Type Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding Entity Types in Named Entity Recognition
Which of the following best describes the entity type ORG in Named Entity Recognition (NER)?
AA person’s name such as 'Alice' or 'Dr. Smith'.
BA location such as 'Paris' or 'Mount Everest'.
CA date or time expression such as 'January 1, 2020'.
DAn organization such as 'Google' or 'United Nations'.
Attempts:
2 left
πŸ’‘ Hint
Think about what kind of real-world entities organizations represent.
❓ Predict Output
intermediate
2:00remaining
Output of NER Entity Extraction
Given the sentence: 'Apple was founded by Steve Jobs in California in 1976.' What entities will be recognized with their correct types?
NLP
sentence = 'Apple was founded by Steve Jobs in California in 1976.'
# Assume a perfect NER model output
entities = [
  ('Apple', 'ORG'),
  ('Steve Jobs', 'PERSON'),
  ('California', 'LOC'),
  ('1976', 'DATE')
]
print(entities)
A[('Apple', 'PERSON'), ('Steve Jobs', 'ORG'), ('California', 'LOC'), ('1976', 'DATE')]
B[('Apple', 'LOC'), ('Steve Jobs', 'PERSON'), ('California', 'ORG'), ('1976', 'DATE')]
C[('Apple', 'ORG'), ('Steve Jobs', 'PERSON'), ('California', 'LOC'), ('1976', 'DATE')]
D[('Apple', 'ORG'), ('Steve Jobs', 'PERSON'), ('California', 'DATE'), ('1976', 'LOC')]
Attempts:
2 left
πŸ’‘ Hint
Think about what each entity represents in real life.
❓ Model Choice
advanced
1:30remaining
Choosing the Best Model for Entity Type Recognition
You want to build a system that identifies PERSON, ORG, LOC, and DATE entities in news articles. Which model type is best suited for this task?
AA linear regression model predicting numeric values.
BA recurrent neural network (RNN) or transformer-based model trained on labeled text data.
CA clustering algorithm like K-means on raw text.
DA convolutional neural network (CNN) trained on image data.
Attempts:
2 left
πŸ’‘ Hint
Think about models designed for sequence and language understanding.
❓ Metrics
advanced
1:30remaining
Evaluating NER Model Performance
You have a NER model that predicts entity types PERSON, ORG, LOC, and DATE. Which metric best measures how well the model correctly identifies these entities?
APrecision, Recall, and F1-score for each entity type
BAccuracy of predicting the next word
CMean Squared Error (MSE)
DR-squared value
Attempts:
2 left
πŸ’‘ Hint
Think about metrics used for classification tasks with multiple classes.
πŸ”§ Debug
expert
2:00remaining
Debugging Incorrect Entity Type Predictions
A NER model often labels 'Amazon' as a LOCATION instead of an ORGANIZATION. What is the most likely cause?
AThe training data lacks enough examples of 'Amazon' as an organization.
BThe model architecture is a CNN instead of an RNN.
CThe input text is too short for the model to understand context.
DThe model uses precision instead of recall as a metric.
Attempts:
2 left
πŸ’‘ Hint
Think about how the model learns entity meanings from examples.

Practice

(1/5)
1. Which entity type label would you use to mark the name "Albert Einstein" in a text?
easy
A. PERSON
B. ORG
C. LOC
D. DATE

Solution

  1. Step 1: Understand entity types

    PERSON labels identify names of people in text.
  2. Step 2: Match the example to entity type

    "Albert Einstein" is a person's name, so it fits PERSON.
  3. Final Answer:

    PERSON -> Option A
  4. Quick Check:

    PERSON = Albert Einstein [OK]
Hint: Names of people are always PERSON entities [OK]
Common Mistakes:
  • Confusing ORG with PERSON
  • Labeling locations as PERSON
  • Using DATE for names
2. Which of the following is the correct way to label the entity type for "Google" in a named entity recognition task?
easy
A. LOC
B. ORG
C. PERSON
D. DATE

Solution

  1. Step 1: Identify what Google represents

    Google is a company, which is an organization.
  2. Step 2: Match to entity type

    ORG is the label for organizations like companies.
  3. Final Answer:

    ORG -> Option B
  4. Quick Check:

    ORG = Google [OK]
Hint: Companies and institutions are labeled ORG [OK]
Common Mistakes:
  • Labeling companies as LOC
  • Using PERSON for organizations
  • Confusing DATE with ORG
3. Given the sentence: "Barack Obama visited Paris on July 14, 2015." Which of the following is the correct sequence of entity types for [Barack Obama, Paris, July 14, 2015]?
medium
A. [PERSON, LOC, ORG]
B. [ORG, LOC, DATE]
C. [PERSON, LOC, DATE]
D. [PERSON, ORG, DATE]

Solution

  1. Step 1: Identify each entity type

    "Barack Obama" is a person, "Paris" is a location, and "July 14, 2015" is a date.
  2. Step 2: Match entities to types in order

    The sequence is PERSON, LOC, DATE.
  3. Final Answer:

    [PERSON, LOC, DATE] -> Option C
  4. Quick Check:

    PERSON, LOC, DATE = Barack Obama, Paris, July 14, 2015 [OK]
Hint: Match each entity to person, place, or date in order [OK]
Common Mistakes:
  • Confusing ORG with LOC
  • Mixing DATE with ORG
  • Wrong order of entity types
4. You have a named entity recognition model that labels "Amazon" as a LOC (location). What is the most likely error in this labeling?
medium
A. Amazon is an organization, so it should be ORG
B. Amazon is a person, so LOC is wrong
C. Amazon is a date, so LOC is incorrect
D. Amazon is a location, so LOC is correct

Solution

  1. Step 1: Understand the entity "Amazon"

    Amazon is commonly known as a company (organization), not a location.
  2. Step 2: Correct entity type for Amazon

    ORG is the correct label for companies like Amazon.
  3. Final Answer:

    Amazon is an organization, so it should be ORG -> Option A
  4. Quick Check:

    ORG = Amazon company [OK]
Hint: Companies are ORG, not LOC [OK]
Common Mistakes:
  • Assuming Amazon is only a location
  • Labeling company names as PERSON
  • Ignoring context of entity
5. You want to extract all dates and locations from the sentence: "The conference was held in New York on March 3rd, 2023, and attended by experts from Google." Which entity types should your model identify to get the correct information?
hard
A. PERSON and LOC
B. PERSON and ORG
C. ORG and DATE
D. LOC and DATE

Solution

  1. Step 1: Identify entities to extract

    The task is to extract dates and locations only.
  2. Step 2: Match entity types for locations and dates

    Locations are labeled LOC and dates are labeled DATE.
  3. Final Answer:

    LOC and DATE -> Option D
  4. Quick Check:

    LOC and DATE = New York, March 3rd, 2023 [OK]
Hint: Dates = DATE, places = LOC [OK]
Common Mistakes:
  • Extracting PERSON or ORG instead
  • Mixing LOC with ORG
  • Ignoring DATE entities