Remove English Stop Words From Text Using Python NLTK

In this tutorial, we will introduce the way to remove english stop words from a text using python nltk.

1. Import library

from nltk.corpus import stopwords
import nltk

2. Create a word tokens

tokenized_words = ['i', 'am', 'going', 'to', 'go', 'to', 'the', 'store', 'and', 'park']

3. Load english stop words

stop_words = stopwords.words('english')

4. Remove stop words from word tokens

sen = [word for word in tokenized_words if word not in stop_words]