我知道这个问题已被问过几次,但无论我尝试运行多少解决方案,我仍然会遇到同样的错误。这是我得到的错误:
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-248-fdd700a1da8b> in <module>
8 STOPLIST = set(list(text.ENGLISH_STOP_WORDS))
9 KEEP_POS = {'ADJ', 'ADP', 'ADV', 'NOUN', 'VERB'}
---> 10 nlp = spacy.load('en_core_web_sm')
11
12 def scrubbing_text(reviews):
~/opt/anaconda3/lib/python3.8/site-packages/spacy/__init__.py in load(name, disable, exclude, config)
45 RETURNS (Language): The loaded nlp object.
46 """
---> 47 return util.load_model(name, disable=disable, exclude=exclude, config=config)
48
49
~/opt/anaconda3/lib/python3.8/site-packages/spacy/util.py in load_model(name, vocab, disable, exclude, config)
327 if name in OLD_MODEL_SHORTCUTS:
328 raise IOError(Errors.E941.format(name=name, full=OLD_MODEL_SHORTCUTS[name]))
--> 329 raise IOError(Errors.E050.format(name=name))
330
331
OSError: [E050] Can't find model 'en_core_web_sm'. It doesn't seem to be a Python package or a valid path to a data directory.
我在 Mac 上使用 Anaconda。我可以在左侧看到 spaCy 文件夹,但由于某种原因它不起作用。请帮忙 :(