WatermarkDetector<T>
Models & Types · AiDotNet.Safety.Watermarking
Composite text watermark detector: runs the green-list, synonym and contraction detectors of one key and reports the strongest evidence, corrected for having run three tests.
Inheritance: ModelBase<T, Vector<T>, Vector<T>> → SafetyModuleBase<T> → TextSafetyModuleBase<T> → TextWatermarkerBase<T> → WatermarkDetector<T>
For Beginners
This detector checks for all of this library’s text watermarks made with your key at once, without becoming more trigger-happy than any single check.
How It Works
Each detector’s z-score is approximately standard normal on text without its watermark. Taking the best of three would triple the false-positive rate, so the smallest p-value is multiplied by three (a Bonferroni correction) and turned back into a z-score before the usual confidence mapping. A false-positive rate stated for one detector therefore holds for the composite too.
The green-list detector can only score text when the generator’s tokenizer is supplied; without it the composite still checks the two post-hoc watermarks.
Constructors
| Constructor | Summary |
|---|---|
WatermarkDetector() |
Preserves the original constructor signature using the default configuration. |
WatermarkDetector(string key, IGenerationTokenizer tokenizer) |
Initializes a new composite watermark detector. |
Properties
| Property | Summary |
|---|---|
string ModuleName { get; } |
Methods
| Method | Summary |
|---|---|
WatermarkResult Detect(string text) |