Skip to content

Instantly share code, notes, and snippets.

@emmagrimaldi
Created September 1, 2018 00:37
Show Gist options
  • Select an option

  • Save emmagrimaldi/db4c8706d423077036c544daed24090b to your computer and use it in GitHub Desktop.

Select an option

Save emmagrimaldi/db4c8706d423077036c544daed24090b to your computer and use it in GitHub Desktop.
porterstemmer
# importing the library needed in this section
from nltk.stem.porter import PorterStemmer
# instantiating the stemmer object
pstemmer = PorterStemmer()
# stemming each word through a list comprehension
[pstemmer.stem(token) for token in clean_tokens]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment