Skip to content

Instantly share code, notes, and snippets.

@FranciscusRenatus
Created July 20, 2017 17:45
Show Gist options
  • Save FranciscusRenatus/86efb15e6021fb5ab02bad586630dc1f to your computer and use it in GitHub Desktop.
Save FranciscusRenatus/86efb15e6021fb5ab02bad586630dc1f to your computer and use it in GitHub Desktop.
import nltk
nltk.download('stopwords')
from nltk.corpus import stopwords
from nltk.stem.porter import PorterStemmer
ps = PorterStemmer()
review = [ps.stem(word) for word in review if not word in set(stopwords.words('english'))]
review = ' '.join(review)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment