Skip to content

Commit

Permalink
fix tp&fp calc error
Browse files Browse the repository at this point in the history
  • Loading branch information
oslijunw committed Jan 15, 2025
1 parent b3c768b commit 3d8751c
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 @@ -257,10 +257,10 @@ async def _single_turn_ascore(
else:
response_reference = np.array([])

response_reference = np.array(response_reference, dtype=bool)
tp = sum(reference_response)
fp = sum(~reference_response)
if self.mode != "precision":
response_reference = np.array(response_reference, dtype=bool)
fn = sum(~response_reference)
else:
fn = 0
Expand Down

0 comments on commit 3d8751c

Please sign in to comment.