小编goe*_*goe的帖子

nltk.corpus -“getset_descriptor”对象没有属性“setdefault”

我正在使用下面的代码并从 nltk 导入停用词

   #from nltk.corpus import words as word_corp
    from nltk.corpus import stopwords
    nlp = spacy.load('en_core_web_sm')
    phrase_matcher = PhraseMatcher(nlp.vocab)
    en_words = nltk.corpus.words.words('en')
    stop_words = stopwords.words('english')
Run Code Online (Sandbox Code Playgroud)

但错误就是AttributeError: 'getset_descriptor' object has no attribute 'setdefault' for ----> 3 nlp = spacy.load('en_core_web_sm')这一行。

nlp corpus nltk python-3.x

6
推荐指数
1
解决办法
1980
查看次数

标签 统计

corpus ×1

nlp ×1

nltk ×1

python-3.x ×1