Extract entities and patterns from text with spaCy
8 steps · about 3 h 25 min · Beginner
- Practise the basics interactively (interactive, spaCy course, 40 min)
Hands-on exercises in the browser build the habit of working with Doc, Token and Span objects.
- Understand pipelines and shared objects (doc, spaCy, 25 min)
Know what each pipeline component adds to a document before mixing statistical and rule-based steps.
- Read tokens, parts of speech and entities (doc, spaCy, 30 min)
These annotations are the raw material for every extraction rule and every downstream feature.
- Match phrases and token patterns (doc, spaCy, 30 min)
Rules capture product codes, dates or domain phrases precisely where a statistical model would guess.
- Add domain entities with patterns (reference, spaCy, 15 min)
An entity ruler lets known names override or complement the model's own predictions.
- Visualise entities and dependencies (doc, spaCy, 10 min)
Seeing highlighted entities makes errors obvious and helps explain results to others.
- Train a custom entity model (doc, spaCy, 40 min)
When rules are not enough, a small annotated set and a training config teach the model new labels.
- Evaluate the model on held-out text (reference, spaCy, 15 min)
Precision, recall and F-score per label show whether the trained model actually beats your rules.