Last active
November 1, 2017 13:07
-
-
Save amnrzv/bce078e87a08e12ff8d7fee213756cfc to your computer and use it in GitHub Desktop.
An example of NLTK's WordNet Lemmatizer.
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.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')) |
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
goose | |
bottle | |
say | |
good | |
quick |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment