admin管理员组

文章数量:1550647

背景

模型需要用到指代消解功能,查询到比较好用的是spaCy+neuralcoref。代码简单,但是出现了很多兼容性问题,neuralcoref相当于一个插件,在spaCy框架下实现指代消解,安装很多版本都不能顺利运行,各种error。最终找到一个匹配的版本。

问题

  1. Segmentation fault (core dumped)
  2. KeyError: “[E002] Can’t find factory for ‘tok2vec’. This usually happens when spaCy calls nlp.create_pipe with a component name that’s not built in - for example, when constructing the pipeline from a model’s meta.json. If you’re using a custom component, you can write to Language.factories['tok2vec'] or remove it from the model meta and add it via nlp.add_pipe instead.”
  3. ValueError: spacy.strings.StringStore size changed, may indicate binary incompatibility. Expected 80 from C header, got 64 from PyObject

解决

版本

python 3.8.16
spacy 2.1.0
neuralcoref 4.0
en_core_web_sm 2.

本文标签: spacyneuralcoref