Can WordNetLemmatizer in Nltk stem words?

為{幸葍}努か 提交于 2019-12-12 11:26:42

问题


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')

回答1:


Try using one of the stemmers in nltk.stem module, such as the PorterStemmer. Here's an online demo of NLTK's stemmers: http://text-processing.com/demo/stem/




回答2:


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

>>> WordNetLemmatizer().lemmatize('having','v')
'have'
>>> WordNetLemmatizer().lemmatize('has','v')
'have'



回答3:


No, Wordnet cannot stem the words. It can only give lemmatized words i.e. words which are actual words in the language. A stemmer may not always give real meaningful words.



来源:https://stackoverflow.com/questions/6658380/can-wordnetlemmatizer-in-nltk-stem-words

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!