0
0
ML Pythonml~20 mins

Named Entity Recognition basics in ML Python - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
NER Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:00remaining
What is the main goal of Named Entity Recognition (NER)?
Choose the best description of what NER does in text processing.
AIdentify and classify key information like names, places, and dates in text.
BTranslate text from one language to another automatically.
CSummarize long documents into short paragraphs.
DDetect the sentiment or emotion expressed in a sentence.
Attempts:
2 left
💡 Hint
Think about what entities like people or locations are in a sentence.
Predict Output
intermediate
1:30remaining
Output of a simple NER tagging example
What is the output of this NER tagging code snippet?
ML Python
sentence = "Apple is looking at buying U.K. startup for $1 billion"
entities = [('Apple', 'ORG'), ('U.K.', 'GPE'), ('$1 billion', 'MONEY')]
A[('Apple', 'ORG'), ('U.K.', 'PERSON'), ('$1 billion', 'MONEY')]
B[('Apple', 'PERSON'), ('U.K.', 'ORG'), ('$1 billion', 'DATE')]
C[('Apple', 'ORG'), ('U.K.', 'GPE'), ('$1 billion', 'MONEY')]
D[('Apple', 'ORG'), ('U.K.', 'GPE'), ('$1 billion', 'QUANTITY')]
Attempts:
2 left
💡 Hint
ORG means organization, GPE means geopolitical entity, MONEY means monetary value.
Model Choice
advanced
2:00remaining
Choosing the best model type for NER
Which model type is most suitable for Named Entity Recognition tasks?
ARecurrent Neural Network (RNN) or Transformer-based model trained on sequence labeling
BConvolutional Neural Network (CNN) designed for image classification
CGenerative Adversarial Network (GAN) for image generation
DK-Means clustering for unsupervised grouping
Attempts:
2 left
💡 Hint
NER requires understanding word order and context in sentences.
Metrics
advanced
1:30remaining
Evaluating NER model performance
Which metric is most appropriate to evaluate a Named Entity Recognition model?
ASilhouette score measuring cluster separation
BAccuracy of predicting the exact entity tags for each token
CBLEU score comparing generated text to reference text
DMean Squared Error between predicted and true entity counts
Attempts:
2 left
💡 Hint
NER is a classification task at the token level.
🔧 Debug
expert
2:30remaining
Debugging incorrect NER predictions
Given this NER model output on the sentence "Barack Obama was born in Hawaii.": Predicted entities: [('Barack', 'PERSON'), ('Obama', 'PERSON'), ('Hawaii', 'ORG')] What is the likely cause of the error?
AThe model incorrectly labeled 'Hawaii' as an organization instead of a location.
BThe model did not detect any entities in the sentence.
CThe model confused the entity type for 'Barack' and 'Obama'.
DThe model failed to recognize 'Barack Obama' as a single entity and split it into two.
Attempts:
2 left
💡 Hint
Consider how multi-word entities should be tagged in NER.