Stop words in NLP: lists and filtering
What stop words are in NLP, how stop word lists differ, what filtering removes, and when to keep the full text instead.
Stop words are very common words, such as articles, prepositions, auxiliary verbs and many pronouns, that some natural language processing pipelines remove before analysis. Removing them is a text transformation: it changes which tokens remain. Whether that helps depends on what the remaining tokens are used for. This review explains what filtering changes, how stop word lists differ, and when you should keep the original text.
Is stop word removal right for your task?
Stop word filtering is worth trying when your method treats text as a set or bag of words and frequent function words would crowd out more informative terms. Typical cases are keyword extraction, simple topic modeling and term-frequency features for classic classifiers. The benefit is a smaller vocabulary and a feature set that leans toward content words.
The main tradeoff is lost meaning. Function words carry negation, direction, quantity and question type. Removing them can make opposite statements look the same. For that reason, skip filtering or use a minimal custom list for sentiment analysis, question answering, translation, text generation, phrase search, and models that learn from full word sequences, such as transformer-based models. For any text a person will read, keep the plain original.
What filtering actually changes
Filtering deletes tokens from the data. It does not change how anything looks on screen. The text is first split into tokens, and every token that matches an entry in the stop list is dropped. The result is a shorter sequence of the remaining words. The original cannot be rebuilt from it, so if you need the source text later, store it separately.
Three details decide the outcome:
- Tokenization: contractions, hyphens and punctuation may be split differently by different tokenizers. A form like "don't" may become one token or two, and only some forms will match the list.
- Case handling: if the text is not lowercased first, or the list is not case-insensitive, a capitalized "The" may slip through.
- List contents: the same sentence produces different output with different lists, because the lists themselves differ.
The term "stop words" also means different things in different settings. In NLP preprocessing it means words dropped before analysis. In search engines it has historically meant words ignored at indexing or query time, and many modern search systems keep them. Stop word removal is also separate from stemming and lemmatization, which reduce words to base forms instead of deleting them.
Where stop word lists come from
There is no single standard stop word list for any language. Common sources include:
- Library defaults: toolkits such as NLTK, spaCy and scikit-learn ship their own lists. These lists differ in size and contents. Read the actual entries before relying on one. Scikit-learn's own documentation warns that its built-in English list has known issues.
- Frequency-derived lists: the most frequent terms in your own corpus, usually reviewed by a person before use.
- Domain lists: words that are common but uninformative in a specific field, such as boilerplate terms in legal or support-ticket text.
- Negative lists: words deliberately kept out of the stop list, such as negations, when the task depends on them.
Lists are language-specific. Applying an English list to multilingual text removes little from other languages. It can also remove short words that happen to match an English entry but mean something else.
Example: how negation disappears
The snippet below uses a small illustrative list, not any library's default. Many general-purpose lists include negations such as "not", which is exactly what causes this problem.
stop_words = {"the", "was", "not", "at", "all", "a", "is"}
text = "The movie was not good at all"
tokens = text.lower().split()
filtered = [t for t in tokens if t not in stop_words]
print(filtered)
# ['movie', 'good']
stop_words.discard("not")
filtered = [t for t in tokens if t not in stop_words]
print(filtered)
# ['movie', 'not', 'good']
With the first list, a negative review becomes "movie good". Removing "not" from the list keeps the polarity. The example uses plain whitespace splitting, so attached punctuation would not be separated. A real pipeline would use a proper tokenizer.
Is the filtered output readable and usable?
Filtered text is meant for machine processing, not for people. Copying it elsewhere gives you the reduced word sequence, not readable prose. A screen reader will read the remaining words, but the listener receives the same broken meaning as a sighted reader. Never show filtered output in place of the source text in a user interface, report or accessible document.
Filtering can also break later steps. Phrase searches that depend on function words, such as titles or quotations, may stop matching. Character offsets and word positions no longer line up with the source, which matters if you need to highlight matches or link results back to the original passage. Keeping the original text alongside the tokens, along with their positions, avoids both problems.
| Use case | Stop word filtering | Notes |
| Keyword or topic extraction | Often useful | Review the list for domain terms |
| Bag-of-words classification | Test both ways | The effect depends on the data |
| Sentiment analysis | Use with caution | Keep negations and intensifiers |
| Transformer models, translation, generation | Usually skip | These models use full word sequences |
| Phrase search, highlighting, display | Keep the original | Filtering breaks phrases and positions |
Practical checklist
- Decide whether your method uses word order or only word counts.
- Print and read the stop list you plan to use.
- Remove words your task depends on, such as negations, from the list.
- Apply the same tokenization and lowercasing to the text and the list.
- Keep the original text, and token positions if you need them.
- Compare results with and without filtering on a held-out sample of your own data.
What this review cannot tell you
No benchmark results, list sizes or tool-specific measurements were provided for this review, so it makes no claims about how much filtering changes accuracy or speed in any particular setup. The effect varies with the model, the language, the domain and the list. Treat the guidance above as a starting point and confirm it with a comparison on your own data.