Named entity recognition (NER) finds spans referring to people, places, organizations, dates, locations, and other information, then assigns each span an entity category. It turns unstructured text into pieces that can populate a knowledge graph, where entities become nodes and relations become edges. section 11.4 section 11.0
NER can use two complementary approaches:
- Pattern matching, including regular expressions, can be especially precise for GPS locations, dates, prices, and numbers. section 11.4
- Neural systems use surrounding context to recognize boundaries and categories; common architectures include CNNs, bidirectional transformers, and bidirectional LSTMs with CRFs. section 11.4.2
- Segmentation determines whether text such as “New York” forms one entity, while categorization distinguishes context-dependent meanings such as person, location, organization, or sports team. section 11.4.2
Extract entities with spaCy
Run a spaCy model over an article, then inspect the document’s entities: `nlp = spacy.load('en_core_web_lg')`; `doc = nlp(text)`; `doc.ents[:6]` can return entities such as `Timnit Gebru`, `Amharic`, `13`, `May 1983`, `Ethiopian`, and `Black in AI`. Each token also exposes `ent_type_`, allowing the extracted span’s category to be examined alongside part-of-speech and dependency information. section 11.4.2
>>> doc = nlp(text) #1 >>> doc.ents[:6] #2 (Timnit Gebru, Amharic, 13, May 1983, Ethiopian, Black in AI)
Inspect the spaCy output listing to see extracted entity spans in context. section 11.4.2
NER is a foundation for information extraction: combine it with coreference resolution and relation extraction to build larger knowledge graphs or check facts generated by language models. Part-of-speech tagging supports recognition, while dependency parsing helps connect entities through sentence relations. section 11.3 section 11.4.2



