小编Mar*_*_DS的帖子

加载 spacy 时出错 [E002] 找不到“tok2vec”工厂

我似乎无法在任何地方找到这个问题的解决方案:

我正在尝试使用 spacy 的中等英语模型:en_core_web_md

由于通过命令行下载 spacy 根本不起作用,我将模型下载到我的目录中并继续调用它:

import spacy
nlp = spacy.load('en_core_web_md-3.1.0')

Run Code Online (Sandbox Code Playgroud)

但是,我不断收到以下错误:

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."
Run Code Online (Sandbox Code Playgroud)

小型 spacy 模型 en_core_web_sm 工作得很好,但我需要一个更大的模型来执行我需要的计算。

pip 21.1.3 
spaCy version    2.3.5 …
Run Code Online (Sandbox Code Playgroud)

python nlp model spacy

5
推荐指数
1
解决办法
9126
查看次数

标签 统计

model ×1

nlp ×1

python ×1

spacy ×1