Update app.py
Browse files
app.py
CHANGED
@@ -302,11 +302,11 @@ def calculate_statistics(results, search_time, vector_store, num_tokens, embeddi
|
|
302 |
stats["silhouette_score"] = "N/A"
|
303 |
|
304 |
query_embedding = embedding_model.embed_query(query)
|
305 |
-
result_embeddings = [embedding_model.embed_query(doc.page_content) for doc in results]
|
306 |
-
similarities = [np.inner(query_embedding, emb) for emb in result_embeddings]
|
307 |
#similarities = [np.inner(query_embedding, emb)[0] for emb in result_embeddings]
|
308 |
-
rank_correlation, _ = spearmanr(similarities, range(len(similarities)))
|
309 |
-
stats["rank_correlation"] = rank_correlation
|
310 |
|
311 |
return stats
|
312 |
|
|
|
302 |
stats["silhouette_score"] = "N/A"
|
303 |
|
304 |
query_embedding = embedding_model.embed_query(query)
|
305 |
+
#result_embeddings = [embedding_model.embed_query(doc.page_content) for doc in results]
|
306 |
+
#similarities = [np.inner(query_embedding, emb) for emb in result_embeddings]
|
307 |
#similarities = [np.inner(query_embedding, emb)[0] for emb in result_embeddings]
|
308 |
+
#rank_correlation, _ = spearmanr(similarities, range(len(similarities)))
|
309 |
+
#stats["rank_correlation"] = rank_correlation
|
310 |
|
311 |
return stats
|
312 |
|