WordNet Lemmatizer
Chop the ending off a word and you can usually guess its base form — until flies becomes fli and the guess falls apart. The WordNet lemmatizer takes the other route: instead of cutting, it looks the word up and returns a base form that actually exists.
Dictionary, not scissors
WordNet is Princeton's hand-built lexical database of English, and this lemmatiser is the morphy routine that ships with it. It applies a short list of detachment rules per part of speech — strip -s, -es, -ed, -ing — but accepts the result only if that string is a real WordNet entry, and it keeps an exception table for irregular forms, so geese maps to goose and was to be. It also needs the part of speech: NLTK's WordNetLemmatizer defaults to noun, so lemmatising running returns it unchanged while passing the verb tag returns run. Correct use means running a POS tagger first.
What it is for
Collapsing inflected forms makes variants count as one, which shrinks the vocabulary and concentrates sparse representations: a search index where study, studies and studied share one entry matches a query that none of them matched exactly. Against the Porter and Snowball stemmers it is slower and far more conservative, and every output is a genuine word you can show to a reader. It is bounded by WordNet's coverage, though, so names, jargon and new vocabulary pass straight through untouched. In neural pipelines it is largely historical: subword tokenisers absorb morphology implicitly, and a model given the inflected form keeps the tense and number information lemmatising would have thrown away.
The WordNet lemmatizer reduces an inflected word to its dictionary base form by applying part-of-speech-specific detachment rules and accepting the result only if it is a real entry in WordNet, with an exception table for irregulars such as geese to goose. Unlike a stemmer it always returns a valid word, but it requires the correct part of speech — NLTK's implementation defaults to noun — and leaves vocabulary WordNet does not list untouched.
Suppose you are counting how often a book talks about studying. Study, studies, studied and studying should all count towards the same total, so you need a way to recognise them as one word.
One approach is crude: hack the endings off and hope for the best. The WordNet lemmatizer is the careful alternative. It consults a huge hand-written dictionary of English and only accepts an answer that is a real word in it. That is how it knows geese means goose and was means be, cases no amount of chopping would ever catch.
The price is speed, and it has to be told whether the word is a noun or a verb before it answers correctly.