在管道中添加自定义组件后无法加载模型(spaCy)

时间:2018-02-14 10:46:05

标签: python spacy

我从头开始使用自定义数据集训练了一个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'."`

0 个答案:

没有答案
相关问题