TextSafetyModuleBase<T>

Base Classes · AiDotNet.Safety.Text

Abstract base class for text safety modules providing common text processing utilities.

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

Implements: ITextSafetyModule<T>

Known derived types: ClassifierToxicityDetector<T>, ComplianceModuleBase<T>, CompositePIIDetector<T>, ContextAwarePIIDetector<T>, CopyrightDetectorBase<T>, EmbeddingCopyrightDetector<T>, EmbeddingToxicityDetector<T>, EnsembleJailbreakDetector<T>, EnsembleToxicityDetector<T>, EntailmentHallucinationDetector<T>, GradientJailbreakDetector<T>, GuardrailBase<T>, HallucinationDetectorBase<T>, JailbreakDetectorBase<T>, KnowledgeTripletHallucinationDetector<T>, NERPIIDetector<T>, NgramCopyrightDetector<T>, PIIDetectorBase<T>, PatternJailbreakDetector<T>, PerplexityMemorizationDetector<T>, ReferenceBasedHallucinationDetector<T>, RegexPIIDetector<T>, RuleBasedToxicityDetector<T>, SelfConsistencyHallucinationDetector<T>, SemanticJailbreakDetector<T>, TextImageAlignmentChecker<T>, TextToxicityDetectorBase<T>, TextWatermarkerBase<T>

For Beginners

This base class handles the boring plumbing so that each text safety module only needs to implement one method: EvaluateText(string).

How It Works

Provides shared infrastructure for all text safety modules, including the vector-to-text conversion needed to satisfy ISafetyModule. Concrete modules implement EvaluateText and this base class handles the Evaluate bridge.

Methods

Method Summary
IReadOnlyList<SafetyFinding> Evaluate(Vector<T> content)
IReadOnlyList<SafetyFinding> EvaluateText(string text)