Skip to content

Commit

Permalink
fix: reshape matrix (#519)
Browse files Browse the repository at this point in the history
fixes: #518
  • Loading branch information
shahules786 committed Jan 26, 2024
1 parent a76e5f0 commit 594871f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ragas/metrics/_answer_relevance.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def calculate_similarity(
question_vec = np.asarray(self.embeddings.embed_query(question)).reshape(1, -1)
gen_question_vec = np.asarray(
self.embeddings.embed_documents(generated_questions)
)
).reshape(len(generated_questions), -1)
norm = np.linalg.norm(gen_question_vec, axis=1) * np.linalg.norm(
question_vec, axis=1
)
Expand Down

0 comments on commit 594871f

Please sign in to comment.