Last active
September 29, 2018 15:59
-
-
Save aaronkub/282a9f377d3ff5f8073464727a980d1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nltk.corpus import stopwords | |
english_stop_words = stopwords.words('english') | |
def remove_stop_words(corpus): | |
removed_stop_words = [] | |
for review in corpus: | |
removed_stop_words.append( | |
' '.join([word for word in review.split() | |
if word not in english_stop_words]) | |
) | |
return removed_stop_words | |
no_stop_words = remove_stop_words(reviews_train_clean) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment