我正在尝试导入import spacy_sentence_bert并在python中运行以下代码。
我在anaconda提示符上安装了conda install -c conda-forge spacy-transformers。
import spacy_sentence_bert
nlp = spacy_sentence_bert.load_model('en_stsb_bert_large')我收到的错误如下:
ModuleNotFoundError: No module named 'spacy_sentence_bert'但是,由于另一个错误,我最近不得不卸载Python,而现在它无法工作。
任何帮助都会受到感谢,我不太精通Python。
我正在使用Python3.9.12通过Spyder通过Anaconda下载。
发布于 2022-10-13 04:04:18
您需要安装spacy-sentence-bert,无论是使用pip install spacy-sentence-bert还是conda等效程序。( conda和pip混合使用,但有时会导致奇怪的错误。)
spacy-transformers是一个单独的包,一般用于包装spaCy中的变压器。这有点让人困惑,但sentence-transformers也是一个单独的包,spacy-sentence-bert是该包的包装器。
https://stackoverflow.com/questions/74001877
复制相似问题