Skip to content

Commit

Permalink
Correct Faithfulness Verdict Map (#739)
Browse files Browse the repository at this point in the history
closes #736

Co-authored-by: Baumgartner, Peter <[email protected]>
  • Loading branch information
pmbaumgartner and Baumgartner, Peter authored Mar 12, 2024
1 parent 16cf5d7 commit 7c4e7e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ragas/metrics/_faithfulness.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def _create_nli_prompt(self, row: t.Dict, statements: t.Any) -> PromptValue:

def _compute_score(self, output: t.Any):
# check the verdicts and compute the score
verdict_score_map = {"1": 1, "0": 0, "null": np.nan}
verdict_score_map = {"1": 1, "0": 0, "-1": np.nan}
output = output if isinstance(output, list) else [output]
faithful_statements = sum(
verdict_score_map.get(
Expand Down

0 comments on commit 7c4e7e6

Please sign in to comment.