- Faithfulness Assessment: Determines if the response is supported by context
- Binary Scoring: Returns 1.0 (faithful) or 0.0 (not faithful)
- Hallucination Detection: Identifies when responses include unsupported claims
- Detailed Reasoning: Provides explanation for the faithfulness assessment
- Fiddler API Integration: Uses Fiddler’s built-in faithfulness evaluation model
- RAG Systems: Detecting hallucinations in generated responses
- Document Q&A: Ensuring answers are grounded in source documents
- Customer Support: Verifying responses align with knowledge base
- Legal/Medical AI: Critical applications requiring factual accuracy
- Content Generation: Ensuring generated content matches source material
- 1.0 (Faithful): Response is fully supported by the reference documents
- 0.0 (Not Faithful): Response contains information not in the documents or contradicts the documents
Parameters
- user_query (str) – The question or query being asked.
- rag_response (str) – The LLM’s response to evaluate.
- retrieved_documents (list *[*str ]) – The reference documents to check against.
- model (str)
- credential (str | None)
- kwargs (Any)
Returns
A Score object containing:
- value: 1.0 if faithful, 0.0 if not faithful
- label: “yes” or “no”
- reasoning: Detailed explanation of the assessment
Example
This evaluator uses Fiddler’s built-in faithfulness assessment model
and requires an active connection to the Fiddler API. The evaluator
checks if the response is supported by the documents, not whether
the response correctly answers the question.
name = ‘rag_faithfulness’
score()
Score the faithfulness of a response to the provided context.Parameters
The question or query being asked.
The LLM’s response to evaluate.
The reference documents to check against.
Returns
A Score object containing:
- value: 1.0 if faithful, 0.0 if not faithful
- label: “yes” or “no”
- reasoning: Detailed explanation of the assessment