gpt4 book ai didi

nlp - 收到 Spacy 错误 : No module named 'spacy.pipeline.pipes' ; 'spacy.pipeline' is not a package

转载 作者:行者123 更新时间:2023-12-02 19:48:39 24 4
gpt4 key购买 nike

我正在尝试测试在另一台计算机上运行的模型,但是当我尝试将其导入我的笔记本时,出现以下错误:ModuleNotFoundError:没有名为“spacy.pipeline.pipes”的模块; 'spacy.pipeline' 不是一个包

我们已经安装了:Spacy 2.0.18(卡住版本,不可更新)

我正在导入:

import spacy
import thinc
import unidecode
import nltk
from spacy.vocab import Vocab
from spacy.language import Language
from spacy.lang.pt import Portuguese
from spacy.lang.en import English
from spacy.pipeline import EntityRecognizer
ner = EntityRecognizer(nlp.vocab)
nlp = Language(Vocab())
nlp = Portuguese()
# Load NER Model
NER_MODEL = pickle.load( open("/ner_model_v022_epoch=706_loss=09o76364626.pkl", "rb" ) )

我收到以下错误:

---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-12-83d4770d3e3e> in <module>

---> 40 NER_MODEL = pickle.load( open("/ner_model_v022_epoch=706_loss=09o76364626.pkl", "rb" ) )

ModuleNotFoundError: No module named 'spacy.pipeline.pipes'; 'spacy.pipeline' is not a package

有什么想法可能会发生这种情况吗?已经从 0 重新安装了所有内容,但一直给我同样的错误。

任何帮助将不胜感激。

最佳答案

关闭并重新打开终端(控制台)。从您正在处理的当前文件夹中激活 venv

关于nlp - 收到 Spacy 错误 : No module named 'spacy.pipeline.pipes' ; 'spacy.pipeline' is not a package,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58735715/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com