Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions deepeval/metrics/faithfulness/faithfulness.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ async def _a_generate_reason(self, multimodal: bool) -> str:
for verdict in self.verdicts:
if verdict.verdict.strip().lower() == "no":
contradictions.append(verdict.reason)
if verdict.verdict.strip().lower() == "idk" and self.penalize_ambiguous_claims:
contradictions.append(f"(Ambiguous) {verdict.reason}")

prompt = self.evaluation_template.generate_reason(
contradictions=contradictions,
Expand All @@ -195,6 +197,8 @@ def _generate_reason(self, multimodal: bool) -> str:
for verdict in self.verdicts:
if verdict.verdict.strip().lower() == "no":
contradictions.append(verdict.reason)
if verdict.verdict.strip().lower() == "idk" and self.penalize_ambiguous_claims:
contradictions.append(f"(Ambiguous) {verdict.reason}")

prompt = self.evaluation_template.generate_reason(
contradictions=contradictions,
Expand Down
Loading