How to remove stop words using nltk or python
nltk, python, stop-words
Solution
from nltk.corpus import stopwords
# ...
filtered_words = [word for word in word_list if word not in stopwords.words('english')]
Problem
I have a dataset from which I would like to remove stop words. I used NLTK to get a list of stop words: ``` from nltk.corpus import stopwords stopwords.words('english') ``` Exactly how do I compare the data to the list of stop words, and thus remove the stop words from the data?