This commit is contained in:
Coding with Peter 2023-04-18 19:58:35 -07:00
parent d0b7cd93f1
commit b0e5e278a1
1 changed files with 2 additions and 0 deletions

View File

@ -1058,6 +1058,8 @@ def search_embeddings():
# Sort the sentences by their cosine similarity to the query sentence
results = sorted(zip(sentences, cosine_scores, files), key=lambda x: x[1], reverse=True)
print(results[:5])
# Print the top 5 results
for i, (sentence, score, file) in enumerate(results[:5]):
print(f'Top {i+1}: {file} - {sentence} - (Score: {score})')