Bertopic 运行中报错记录

1、下载模型报错ConnectionError: (ProtocolError(‘Connection aborted.’, ConnectionResetError(54, ‘Connection reset by peer’))

运行代码:
topics, probabilities = model.fit_transform(docs)
报错内容:

ConnectionError: (ProtocolError(‘Connection aborted.’, ConnectionResetError(54, ‘Connection reset by peer’)), ‘(Request ID: 5a75855f-ec0f-415b-8626-cb998e73aa80)’)

解决方案:

安装OpenSSL
MAC 安装

brew install OpenSSL

2、下载模型报错ConnectionError: (MaxRetryError("HTTPSConnectionPool(host=‘huggingface.co’, port=443):

运行代码:
topics, probabilities = model.fit_transform(docs)
报错内容:

ConnectionError: (MaxRetryError("HTTPSConnectionPool(host=‘huggingface.co’, port=443)

解决方案:
  • 将模型下载到本地,在huggingface 上,指定模型的Files and versions 进行下载,全部下载完成以后,设置本地模型的路径,就是下载以后放在本地的文件夹地址。
  • 科学上网,切换网络后可以直接下载
    • 在这里插入图片描述

3、OMP: Info #276: omp_set_nested routine deprecated, please use omp_set_max_active_levels instead."

运行代码:
topics, probabilities = model.fit_transform(docs)
报错内容:P: Info #276: omp_set_nested routine deprecated, please use omp_set_max_active_levels instead."
解决方案
conda install -c numba numba==0.56.2

4、ValueError: empty vocabulary; perhaps the documents only contain stop words

5、TypeError: object of type ‘numpy.float64’ has no len()

遇到上面两个(4 & 5)问题基本上都是因为,默认的模型是处理英文数据,即处理word+空格的语言,对中文不适用,针对问题5:网上有个解决方案,但是我自己没有解决

最终的解决方案是不用默认的模型,换成支持中文的模型

from sentence_transformers import SentenceTransformer
embedding_model = SentenceTransformer("distiluse-base-multilingual-cased-v1")

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Andy_shenzl

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值