NER
Named Entity Recognition (NER) is an NLP task that locates and classifies named entities within unstructured text into predefined categories such as person names, organisations, geographic locations, dates, monetary values, and product names. It is typically framed as a sequence-labelling problem: each token in the input receives a label (e.g. B-PER for the beginning of a person name, I-ORG for a continuation of an organisation name, O for non-entity tokens) using schemes such as BIO or BIOES.
Think of it like a meticulous copy-editor who reads a news article and automatically highlights every proper noun in a different colour depending on whether it is a person, a company, or a place.
Using the popular spaCy library, NER is a one-liner:
import spacy
nlp = spacy.load("en_core_web_trf") # transformer-based model
text = "Elon Musk met with European Commission officials in Brussels on Monday."
doc = nlp(text)
for ent in doc.ents:
print(f"{ent.text:<30} {ent.label_}")
# Elon Musk PERSON
# European Commission ORG
# Brussels GPE
# Monday DATE
Modern NER systems fine-tune a pretrained Transformer like BERT on labelled corpora, achieving near-human accuracy on standard benchmarks. Related techniques include Tokenization (which determines the token boundaries NER labels are assigned to), Embedding (the vector representations fed into the classifier head), Fine-tuning (the training strategy that adapts a Foundation Model to the NER task), and Inference (the serving stage where entities are extracted from new documents in production).
NER is a foundational component in information-extraction pipelines for legal document review, clinical coding, financial news analysis, and any system that needs to populate a structured database from free-form text.
Related Courses
Learn how to use ChatGPT from scratch. This beginner-friendly course covers everything from creating your account to writing powerful prompts and…
Midjourney for Beginners: Create Stunning AI ArtMaster Midjourney from scratch. Learn how to craft prompts, control styles, use advanced parameters, and create professional-quality AI-generated images.
AI Video Generation: From Text to MotionLearn how to create videos using AI tools like Sora, Veo, and Runway.