NLP Stemming与Lemmatization的区别

Stemming:基于规则

from nltk.stem.porter import PorterStemmer
porter_stemmer = PorterStemmer()
porter_stemmer.stem('wolves')
结果里es被去掉了
u'wolv'

Lemmatization:基于字典

from nltk.stem import WordNetLemmatizer
lemmatizer = WordNetLemmatizer()
lemmatizer.lemmatize('wolves')

结果准确

u'wolf'





你可能感兴趣的:(NLP)