HallucinationDetectorBase<T>

Base Classes · AiDotNet.Safety.Text

Abstract base class for hallucination detection modules.

Inheritance: ModelBase<T, Vector<T>, Vector<T>> → SafetyModuleBase<T> → TextSafetyModuleBase<T> → HallucinationDetectorBase<T>

Implements: IHallucinationDetector<T>

For Beginners

This base class provides common code for all hallucination detectors. Each detector type extends this and adds its own way of checking whether an AI made something up.

How It Works

Provides shared infrastructure for hallucination detectors including claim extraction utilities and common scoring logic. Concrete implementations provide the actual detection algorithm (reference-based, self-consistency, triplet, entailment).

Methods

Method Summary
IReadOnlyList<SafetyFinding> EvaluateAgainstReference(string generatedText, string referenceText)
double GetHallucinationScore(string text)