报错: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.
解决方案:
pip install spacy
python -m spacy download en_core_web_sm
或者直接
pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.2.0/en_core_web_sm-2.2.0.tar.gz
将代码nlp = spacy.load('en_core_web_sm')
替换成
import en_core_web_sm
nlp = en_core_web_sm.load()