Skip to content

Commit

Permalink
Bug fixing recall in _factual_correctness.py (#1650)
Browse files Browse the repository at this point in the history
Bug fixing recall in factual correctness:

recall is equal to: tp / (tp + fn)

but was calculated exactly like the precision.

Reference:
https://docs.ragas.io/en/latest/concepts/metrics/available_metrics/factual_correctness/#factual-correctness
  • Loading branch information
GitMarco27 authored Nov 12, 2024
1 parent d26a521 commit c2c9d5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ragas/metrics/_factual_correctness.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ async def _single_turn_ascore(
if self.mode == "precision":
score = tp / (tp + fp + 1e-8)
elif self.mode == "recall":
score = tp / (tp + fp + 1e-8)
score = tp / (tp + fn + 1e-8)
else:
score = fbeta_score(tp, fp, fn, self.beta)

Expand Down

0 comments on commit c2c9d5b

Please sign in to comment.