Skip to content

Commit

Permalink
fix attribute error for faithfulness metric (#1436)
Browse files Browse the repository at this point in the history
  • Loading branch information
linzzzzzz and Fu (Alex) Lin authored Oct 8, 2024
1 parent 5c0f3a9 commit 962c8a5
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 @@ -234,7 +234,7 @@ def _create_statements_prompt(self, row: t.Dict) -> PromptValue:
def _compute_score(self, answers: StatementFaithfulnessAnswers):
# check the verdicts and compute the score
faithful_statements = sum(
1 if answer.verdict else 0 for answer in answers.model_dump()
1 if answer['verdict'] else 0 for answer in answers.model_dump()
)
num_statements = len(answers.model_dump())
if num_statements:
Expand Down

0 comments on commit 962c8a5

Please sign in to comment.