Stemming
"Connect", "connected", "connecting", "connection" — to a reader these are obviously the same idea; to a bag-of-words model they are four unrelated columns. Stemming is the crude, fast fix: chop the ends off words by rule until the variants collide on a common string.
Rules, not dictionaries
A stemmer has no vocabulary and no grammar. It applies ordered suffix-stripping rules and accepts that the result need not be a real word.
- The Porter stemmer (1980) and its successor Snowball are the standard English choices; Lancaster is more aggressive. All are a few hundred rules and run in microseconds.
- "Connection" and "connecting" both reduce to "connect"; "studies" becomes "studi", which is not a word and does not need to be — only consistency matters.
Overstemming, understemming, and when to use it
Two errors define the trade. Overstemming merges words that mean different things: "universe", "university" and "universal" all collapse to "univers". Understemming leaves related forms apart, as when irregular morphology ("ran" against "run") escapes a suffix rule entirely. Lemmatisation avoids both by consulting a dictionary and a part-of-speech tag, at a real cost in speed. Stemming stays the right call in high-volume retrieval and classic TF-IDF pipelines, where recall matters more than precision and the stem is never shown to a user — NLTK and Snowball ship it as a one-liner. It is the wrong call before a modern encoder: BERT's subword tokenizer already shares pieces across inflections, and stemming only destroys information the model would have used.
Stemming reduces inflected words to a common root by stripping suffixes with ordered rules — Porter, Snowball, Lancaster — without a dictionary, so the output ("studi") need not be a real word. It matters where variants must count as one token: it shrinks vocabulary and lifts recall in TF-IDF and search pipelines. The cost is precision, since overstemming merges unrelated words such as "universe" and "university".
Think of a filing clerk who files "invoice", "invoices" and "invoicing" in the same folder by snipping the endings off before filing. Fast, a bit brutal, and mostly right.
Stemming does that to words so software can treat "connect", "connected" and "connecting" as one thing instead of three strangers. Search engines have used it for decades: it is why looking for "running shoes" still finds a page that says "run". The trimmed form need not be a real word — nobody sees it, it only has to match. The rough edges show when the scissors go too far and "university" ends up filed with "universe".