【发布时间】:2021-04-21 09:25:02
【问题描述】:
我正在使用下面的代码并从 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')
但错误是AttributeError: 'getset_descriptor' object has no attribute 'setdefault' for ----> 3 nlp = spacy.load('en_core_web_sm')这一行。
【问题讨论】:
标签: python-3.x nlp nltk corpus