TextWatermarkerBase<T>
Base Classes · AiDotNet.Safety.Watermarking
Abstract base class for keyed text watermarkers.
Inheritance: ModelBase<T, Vector<T>, Vector<T>> → SafetyModuleBase<T> → TextSafetyModuleBase<T> → TextWatermarkerBase<T>
Implements: IKeyedWatermarker, ITextWatermarker<T>
Known derived types: KeyedSubstitutionWatermarker<T>, SamplingWatermarker<T>, WatermarkDetector<T>
For Beginners
This base class provides common code for all text watermarkers. Each watermarker type extends this and adds its own way of embedding and finding a keyed signature in text.
How It Works
Holds the watermark key and turns a detection test into findings. A derived watermarker implements
Detect, a statistical test whose z-score is approximately standard normal on text that does not
carry its key’s watermark; the base maps z to a confidence with Confidence and
reports a finding from ReportThreshold.
A watermarker constructed without a key uses Public. That keeps it deterministic, so a
detector built the same way recognises its marks, but anyone can forge a public-key mark: an application marking
its own text passes a secret key.
Properties
| Property | Summary |
|---|---|
bool UsesPublicKey { get; } |
Methods
| Method | Summary |
|---|---|
IReadOnlyList<SafetyFinding> EvaluateText(string text) |
|
WatermarkResult Detect(string text) |
|
double DetectWatermark(string text) |