Articles → NLP → Stop Words In NLP

Stop Words In NLP






What Are Stop Words?





Example




from nltk.corpus import stopwords


# Get English stopwords
stop_words = set(stopwords.words('english'))

print(len(stop_words))        # Number of stopwords
print(list(stop_words)[:20])  # First 20 stopwords



Output


Picture showing the output of stop words in NLP



How To Remove Stop Words?




from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords


stop_words = set(stopwords.words('english'))

sentence = "This is an example showing off stopwords removal in NLP."
words = word_tokenize(sentence)

filtered = [w for w in words if w.lower() not in stop_words]

print("Original:", words)
print("Without stopwords:", filtered)


Picture showing the collection after removing stop words



Posted By  -  Karan Gupta
 
Posted On  -  Friday, August 29, 2025

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250