我从头开始使用自定义数据集训练了一个NER,而没有任何其他组件在管道中。我加载了模型并将另一个组件(Phrase Matcher)添加到现有管道并再次训练NER。现在我无法加载新保存的模型。
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/deusxmachine/.local/lib/python2.7/site-packages/spacy/__init__.py", line 19, in load
return util.load_model(name, **overrides)
File "/home/deusxmachine/.local/lib/python2.7/site-packages/spacy/util.py", line 116, in load_model
return load_model_from_path(Path(name), **overrides)
File "/home/deusxmachine/.local/lib/python2.7/site-packages/spacy/util.py", line 156, in load_model_from_path
component = nlp.create_pipe(name, config=config)
File "/home/deusxmachine/.local/lib/python2.7/site-packages/spacy/language.py", line 215, in create_pipe
raise KeyError("Can't find factory for '{}'.".format(name))
KeyError: u"Can't find factory for 'my_component'."`