We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 34a7914 commit cf3ad78Copy full SHA for cf3ad78
ragas/metrics/similarity.py
@@ -50,8 +50,8 @@ def score(
50
)
51
52
if self.similarity_metric == "cosine":
53
- score = np.dot(gndtruth_emb, gentext_emb.T) / (
54
- norm(gndtruth_emb) * norm(gentext_emb)
+ score = np.sum(gndtruth_emb * gentext_emb, axis=1) / (
+ norm(gndtruth_emb, axis=1) * norm(gentext_emb, axis=1)
55
56
57
elif self.similarity_metric == "euclidean":
0 commit comments