from nltk.corpus import stopwords nltk.download("stopwords") stop = set(stopwords.words("english")) filtered_words = [word.lower() for word in text.split() if word.lower() not in stop]