Notes

Named Entity Recognition (NER)

Open a contract, a news story or a support ticket and most of what you actually want out of it is the proper nouns — who, where, how much, when. Named Entity Recognition is the job of finding those mentions in running text and labelling what kind of thing each one is.

How the task is framed
NER is posed as sequence labelling: every token gets a tag, and the tags encode spans rather than words. Under the BIO scheme, “Reserve Bank of India” becomes B-ORG I-ORG I-ORG I-ORG, so a four-token span is recoverable from per-token decisions. The classic implementation was a CRF over hand-built features; the current one fine-tunes an encoder such as BERT with a token-classification head. Scoring is span-level F1 — the boundary and the type must both be exactly right, so clipping “India” off the end counts as a miss, not a near-miss.

What makes it hard

  • The same string is different entities in different sentences: “Washington” as person, city or state.
  • Entities nest and overlap — “University of Washington” contains a location inside an organisation.
  • A model trained on CoNLL-2003 newswire degrades sharply on clinical notes, chat logs or lowercase text, because capitalisation was carrying much of the signal.
  • Most entities in production traffic were never in training, so the model must generalise from context rather than memorise names.

Why it matters
NER is the entry point to information extraction: entity linking, relation extraction and knowledge-base population all consume its spans, and so do redaction of personal data and the facets in a search interface. Get it through spaCy in three lines; get it wrong and every later stage inherits the error silently, linking a fact to the wrong company.

Named Entity Recognition locates mentions of real-world entities in text — people, organisations, places, dates, amounts — and labels each span with its type. It is framed as per-token tagging with a span scheme such as BIO and scored by span-level F1, where boundary and type must both be exact. NER is the first stage of information extraction: entity linking, relation extraction and data redaction all operate on the spans it returns.

Hand someone a stack of contracts and a highlighter and ask them to mark every name, company, place, date and sum of money. That is the job, and Named Entity Recognition is software doing it.

It reads ordinary sentences and picks out the specific things being talked about, saying which kind each one is. That sounds easy until you notice how much depends on the sentence around the word: “Jordan” is a person in one story and a country in the next. This is the step behind a bank blacking out personal details, a news site tagging the companies in an article, and a phone turning “lunch with Priya on Friday” into a calendar entry.