尝试加载 spacy NER 模型时与 'scorers' 相关的问题

Issue related with 'scorers', when trying to load a spacy NER model

我在尝试加载 NER 模型时遇到 spacy 问题:

nlp = spacy.load("./output_model/model-best")

提示如下错误:

RegistryError: [E892] Unknown function registry: 'scorers'.

Available names: architectures, augmenters, batchers, callbacks, cli, datasets, displacy_colors, factories, initializers, languages, layers, lemmatizers, loggers, lookups, losses, misc, models, ops, optimizers, readers, schedules, tokenizers

我之前有过类似的错误,我可以通过以下方式修复它:

pip install -U spacy

同样的代码昨天运行正常,不知道是不是版本冲突

经过多次尝试,重启内核,再做pip install -U spacy,果然解决了问题。