嗨,我正在用python尝试一个简单的coref解析代码
import spacy
nlp = spacy.load('en_coref_md')
doc = nlp(u'Phone area code will be valid only when all the below conditions are met. It cannot be left blank. It should be numeric. It cannot be less than 200. Minimum number of digits should be 3. ')
print(doc._.coref_clusters)
print(doc._.coref_resolved)
它显示以下错误:
"OSError: [E050] Can't find model 'en_coref_lg'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data"
如果我尝试使用python安装en_coref_lg
,那么它会显示
"✘ No compatible model found for 'en_coref_lg' (spaCy v2.3.2)."
我该怎么办
安装
neuralcoref
和spacy==2.1.0
:运行您的代码:
请注意
spacy==2.1.0
的版本。如果要使用pip
安装,则需要此选项或者,从源代码生成:
证明:
试着像这样使用它:
我觉得应该行得通
相关问题 更多 >
编程相关推荐