简体   繁体   English

ntlk python frenchStemmer

[英]ntlk python frenchStemmer

I an trying to initialize FrenchStemmer : 我试图初始化FrenchStemmer

stemmer = nltk.stem.FrenchStemmer('french')

and the error is: 而错误是:

AttributeError: 'module' object has no attribute 'FrenchStemmer' AttributeError:'module'对象没有属性'FrenchStemmer'

Has anyone seen this error before? 有没有人见过这个错误?

That's because nltk.stem has no module called as FrenchStemmer . 那是因为nltk.stem 没有名为FrenchStemmer的模块。

The French stemmer available is in SnowballStemmer() and you can access it by 可用的法语词干分析器SnowballStemmer() ,您可以通过它访问它

import nltk
stemmer=nltk.stem.SnowballStemmer('french')

or by 或者

import nltk
stemmer=nltk.stem.snowball.FrenchStemmer()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM