text2vec, chinese text to vetor.(文本向量化表示工具,包括词向量化、句子向量化、段落向量化)
- 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