You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
522 B

1 month ago
'''
# 安装向量化的包 # 断开VPN后执行安装包
conda activate rag
pip install text2vec torch torchvision torchaudio
1 month ago
# 安装完整版本(包含额外依赖)
pip install gensim[complete]
1 month ago
'''
1 month ago
1 month ago
from Util.EmbeddingUtil import *
1 month ago
# 在加载模型后添加自定义词典
1 month ago
jieba.load_userdict("./Dict/custom_dict.txt") # 文件中包含: 花呗
1 month ago
sentences = ['如何更换花呗绑定银行卡', '花呗更改绑定银行卡']
1 month ago
for sentence in sentences:
1 month ago
x = text_to_embedding(sentence)