Lemmatization
"Ran", "running" and "runs" are three different strings to a computer and one idea to you. Lemmatization reconciles the two: it maps an inflected word back to its dictionary form, so the three count as one entry.
Dictionary and grammar, not scissors
The output is a lemma, a word you could actually look up: "ran" becomes "run", "better" becomes "good", "mice" becomes "mouse". Getting there takes more than chopping suffixes. A lemmatizer consults a lexical resource such as WordNet and the word's part of speech: "saw" is "see" as a verb and "saw" as a noun, and no rule reading only the letters can separate them. In spaCy the lemma arrives for free because the pipeline has already tagged the token; with the NLTK WordNet lemmatizer you pass the tag yourself, and the default assumption of "noun" silently leaves verbs untouched.
Against stemming
- Stemming strips affixes by rule — fast, and it produces non-words: Porter takes "studies" to "studi".
- Lemmatization returns real words and handles irregular forms, paying for it with a lookup table and a tagging step.
- Stemming over-merges unrelated senses; lemmatization keeps the distinctions a dictionary makes.
Why it matters
Every count-based representation sharpens when variants collapse: a search for "mouse" finds "mice", and TF-IDF spends one column on a concept instead of five. Skip it and the vocabulary inflates while each form's statistics thin out. Subword tokenizers made the step optional for neural models — BERT never sees a lemma — so it belongs to count-based pipelines, search indexes, and any analysis a human will read.
Lemmatization reduces an inflected word to its lemma, the dictionary form — "ran" to "run", "mice" to "mouse" — using a lexical resource and the word's part of speech rather than rule-based suffix stripping. Unlike stemming it returns real words and handles irregular forms, at the cost of a lookup and a tagging step. Collapsing variants shrinks the vocabulary and sharpens the counts that search indexes and count-based representations depend on.
A dictionary has one entry for "run". It does not list "ran", "runs" and "running" separately — you are expected to know they are the same word wearing different clothes. Software is not born knowing that, so lemmatization teaches it: every word is traded for its dictionary form before anything else happens.
That is why searching an archive for "mouse" can still turn up a page that only ever says "mice". The trick needs a little grammar to work: "saw" becomes "see" if you meant the verb, and stays "saw" if you meant the tool. Without this tidying up, a computer treats each spelling as an unrelated word and its tallies scatter across forms that mean the same thing.