update to 1.0.5

This commit is contained in:
shibing624 2023-04-16 16:52:17 +08:00
parent e666de1e63
commit 25b1df6e8a

View File

@ -42,6 +42,10 @@ corpus = [
model.add_corpus(corpus) model.add_corpus(corpus)
model.save_index('en_corpus_emb.json') model.save_index('en_corpus_emb.json')
res = model.most_similar(queries=sentences1, topn=3)
print(res)
del model
model = Similarity(model_name_or_path="sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2")
model.load_index('en_corpus_emb.json') model.load_index('en_corpus_emb.json')
res = model.most_similar(queries=sentences1, topn=3) res = model.most_similar(queries=sentences1, topn=3)
print(res) print(res)