这是笔记本中的单元格:
#%%
!python -m spacy download de_core_news_sm
spacy_en = spacy.load('en_core_web_sm')
spacy_de = spacy.load('de_core_news_sm')
我收到此错误:
OSError: [E050] Can't find model 'de_core_news_sm'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.
我很困惑,因为我认为我正确地遵循了spacy指示。
答案 0 :(得分:0)
执行后
!python -m spacy download de_core_news_sm
spacy_de = spacy.load('de_core_news_sm')
spacy_en = spacy.load('en_core_web_sm')
只需重新启动运行时。从运行时>重新启动运行时。然后运行
import spacy
nlp = spacy.load('de_core_news_sm')
为我工作。希望对您有所帮助