Skip to content

Instantly share code, notes, and snippets.

@shubham769
Created April 29, 2020 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shubham769/699bdc8dc0029200eca9c130e62b01fa to your computer and use it in GitHub Desktop.
Save shubham769/699bdc8dc0029200eca9c130e62b01fa to your computer and use it in GitHub Desktop.
import nltk
def my_stemmer(text):
ps = nltk.porter.PorterStemmer()
text = ' '.join([ps.stem(word) for word in text.split()])
return text
my_stemmer("My system keeps crashing his crashed yesterday, ours crashes")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment