update to version 0.0.4

This commit is contained in:
shibing624 2022-03-08 22:17:06 +08:00
parent 2094d90562
commit 957efb5012
4 changed files with 5 additions and 6 deletions

View File

@ -1,9 +1,7 @@
# -*- coding: utf-8 -*-
"""
@author:XuMing(xuming624@qq.com)
@description:
This basic example loads a pre-trained model from the web and uses it to
compute cosine similarity for a given list of sentences.
@description: 文本语义相似度计算和文本匹配搜索
"""
import sys

View File

@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
"""
@author:XuMing(xuming624@qq.com)
@description: 文本语义相似度计算
@description: This basic example loads a matching model and use it to
compute cosine similarity for a given list of sentences.
"""
import sys

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""
@author:XuMing(xuming624@qq.com)
@description:
@description: Fast similarity search demo
"""
import os
import sys

View File

@ -12,7 +12,7 @@ sim_model = WordEmbeddingSimilarity(wv_model)
def ai_text(sentence1, sentence2):
score = sim_model.similarity(sentence1, sentence2).numpy()[0][0]
score = sim_model.similarity(sentence1, sentence2)
print("{} \t\t {} \t\t Score: {:.4f}".format(sentence1, sentence2, score))
return score