Class HallucinationEvaluator
java.lang.Object
com.tnsai.evaluation.evaluators.AbstractJudgeEvaluator
com.tnsai.evaluation.evaluators.safety.HallucinationEvaluator
- All Implemented Interfaces:
Evaluator
Detects hallucinated content in agent responses by checking factual claims
against provided context.
Unlike FaithfulnessEvaluator,
this evaluator works with any context source (not just RAG retrieval) and
focuses specifically on safety — flagging fabricated facts, invented references,
or claims contradicting the context.
Context is provided via metadata.get("context") as a String
or List<String>. If no context is provided, evaluates against the
agent's own internal consistency.
Score is inverted: 1.0 = no hallucination, 0.0 = fully hallucinated.
- Since:
- 0.3.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tnsai.evaluation.spi.Evaluator
Evaluator.EvaluationInput -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.tnsai.evaluation.evaluators.AbstractJudgeEvaluator
evaluate, name
-
Constructor Details
-
HallucinationEvaluator
-