Named Entity Recognition
Entity Types
PER, ORG, LOC, and more
"Sarah" is a Person entity (PER). NER models learn to recognize these from context — "Sarah" appears in a position and context typical of person names.
Step 1 of 6: Entity Types
PER, ORG, LOC, and more
"Sarah" is a Person entity (PER). NER models learn to recognize these from context — "Sarah" appears in a position and context typical of person names.
Step 2 of 6: BIO Tagging
Begin, Inside, Outside
"Tim" gets tag B-PER. B (Begin) marks the start of a new entity.
Step 3 of 6: Context Windows
How much context helps?
With ±1 context: "leads Apple from". The verb "leads" and nearby tokens help disambiguate — Apple is likely an organization because someone "leads" it. Confidence: 50%.
Step 4 of 6: Sequence Labeling
RNN hidden states → entity tags
Position 0: "Tim" — the RNN has no prior context. It uses only the word embedding of "Tim" to predict B-PER. Common first names are strong signals even without context.
Step 5 of 6: Confidence Thresholds
When to label, when to skip
Threshold 50%: balanced precision (100%) and recall (75%). F1 = 86%. This is the precision-recall trade-off — tighter thresholds mean fewer but more confident predictions.
Step 6 of 6: Entity-Level Evaluation
Exact span matching vs. partial credit
Exact span matching: "Tim" ≠ "Tim Cook" — the predicted span is too short, so it's a miss. Only "Apple" and "Cupertino" match exactly. This is the strictest evaluation used in NER benchmarks like CoNLL.