Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can WordNetLemmatizer in Nltk stem words?

I want to find word stems with Wordnet. Does wordnet have a function for stemming? I use this import for my stemming, but it doesn't work as expected.

from nltk.stem.wordnet import WordNetLemmatizer
WordNetLemmatizer().lemmatize('Having','v')
like image 258
Masoud Abasian Avatar asked Dec 17 '22 11:12

Masoud Abasian


1 Answers

Seems like you have to input a lowercase string to the lemmatize method:

>>> WordNetLemmatizer().lemmatize('having','v')
'have'
>>> WordNetLemmatizer().lemmatize('has','v')
'have'
like image 92
Fred Foo Avatar answered Dec 21 '22 23:12

Fred Foo