我试图从 deeppavlov 的关于 NER 的教程中运行代码片段。
首先我运行命令:
python -m deeppavlov install ner_ontonotes_bert_mult
python -m deeppavlov interact ner_ontonotes_bert_mult [-d]
然后
from deeppavlov import configs, build_model
ner_model = build_model(configs.ner.ner_ontonotes_bert_mult, download=True)
ner_model(['World Curling Championship will be held in Antananarivo'])
抓住这个错误:
ImportError: cannot import name 'convert_examples_to_features'
因此,如果在 VSCode 中粘贴代码,则行
configs.ner.ner_ontonotes_bert_mult
会给出一个信号“'Struct'的实例没有'ner'成员”
(配置是结构)
我该如何解决?谷歌没有找到答案