Skip to content

Instantly share code, notes, and snippets.

@amnrzv
Last active November 1, 2017 13:07
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 amnrzv/bce078e87a08e12ff8d7fee213756cfc to your computer and use it in GitHub Desktop.
Save amnrzv/bce078e87a08e12ff8d7fee213756cfc to your computer and use it in GitHub Desktop.
An example of NLTK's WordNet Lemmatizer.
from nltk.stem import WordNetLemmatizer
wordnet_lemmatizer = WordNetLemmatizer()
print (wordnet_lemmatizer.lemmatize("geese"))
print (wordnet_lemmatizer.lemmatize("bottles", 'n'))
print (wordnet_lemmatizer.lemmatize("said", 'v'))
print (wordnet_lemmatizer.lemmatize("better", 'a'))
print (wordnet_lemmatizer.lemmatize("quickly", 'r'))
goose
bottle
say
good
quick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment