导入spacy模块包:
import spacy
nlp=spacy.load(‘en’)
报错:
OSError: [E941] Can’t find model ‘en’. It looks like you’re trying to load a model from a shortcut, which is deprecated as of spaCy v3.0. To load the model, use its full name instead.
解决方法:
将
import spacy
nlp=spacy.load('en')
改为
from spacy.lang.en import English
nlp = English()