Add sentence-transformer local text embedding supports
This commit is contained in:
@@ -67,11 +67,13 @@ def test_st():
|
||||
]
|
||||
|
||||
# Compute embeddings
|
||||
|
||||
#embeddings = model.encode(sentences, convert_to_tensor=True)
|
||||
embeddings = model.encode(sentences)
|
||||
print("embeddings as follows: ")
|
||||
print(embeddings)
|
||||
|
||||
|
||||
# Compute cosine-similarities for each sentence with each other sentence
|
||||
cosine_scores = util.cos_sim(embeddings, embeddings)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user