text2vec, text to vector tool, the most accurate Chinese text similarity calculation tool.(最准的中文文本相似度计算工具)
- pip3 install text2vec
or
git clone https://github.com/shibing624/text2vec.git
cd text2vec
python3 setup.py install
import text2vec
a = '如何更换花呗绑定银行卡'
b = '花呗更改绑定银行卡'
emb = text2vec.encode(a)
print(emb)
s = text2vec.score(a, b)
print(s)
output:
0.9569100456524151