Stop Word Removal
In any English document, a handful of words — "the", "of", "is", "and" — take up a third of the tokens while saying almost nothing about the topic. Stop word removal deletes them before the text reaches the model, on the bet that what they cost in size exceeds what they carry in meaning.
How the list is chosen
A stop list is a fixed vocabulary, not a learned decision, and where it comes from matters.
- Shipped lists: NLTK carries 179 English stop words, spaCy about 326, scikit-learn its own frozen set. They disagree, so results shift with the library.
- Corpus-derived lists: drop the most frequent terms in your own collection, or let TF-IDF do it statistically — a word in every document earns an inverse-document-frequency weight near zero without being deleted at all.
- Domain additions: in a corpus of patents, "claim" and "invention" are stop words in all but name.
When deleting them is a mistake
Removal pays off in classic retrieval and topic models, where documents are bags of counts and the index shrinks measurably. It is actively harmful anywhere word order or small function words carry the signal. "To be or not to be" is entirely stop words. Negation ("not") flips sentiment; prepositions ("flights from Delhi to Mumbai") carry the whole query; "The Who" and "Let It Be" vanish as entities. Transformer encoders such as BERT were pre-trained on ordinary prose and use function words to parse structure, so stripping them before fine-tuning degrades accuracy rather than improving it. The honest default for neural pipelines is to leave the text alone and keep stop lists for count-based representations.
Stop word removal deletes high-frequency function words — "the", "of", "is" — using a fixed list before text is represented. It matters in count-based pipelines: it trims index size and stops ubiquitous tokens from dominating bag-of-words and topic models. It is harmful where function words carry meaning, since negation, prepositions and multi-word names depend on them, which is why transformer encoders are fed unfiltered text.
When you skim a news story for what it is about, you skip over "the", "and" and "is" without noticing. They hold the sentence together but tell you nothing about the subject.
Stop word removal is software doing the same skipping on purpose, deleting those filler words from a list before it analyses the text. For sorting documents by topic, that leaves less to store and the useful words stand out. But the trick backfires when the little words are the point: "not" reverses the meaning of a review, and a search for "flights from Delhi to Mumbai" falls apart without "from" and "to". Modern language systems usually keep every word.