本文主要是介绍OSError: [E050] Can‘t find model ‘en_core_web_sm‘.,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
报错: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()
这篇关于OSError: [E050] Can‘t find model ‘en_core_web_sm‘.的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!