SyntacticWatermarker<T>
Models & Types · AiDotNet.Safety.Watermarking
Keyed form-transformation text watermark: at every negation or pronoun-auxiliary pair that can be written either in full or contracted (“do not” / “don’t”, “they are” / “they’re”), the key and the preceding word choose the form.
Inheritance: ModelBase<T, Vector<T>, Vector<T>> → SafetyModuleBase<T> → TextSafetyModuleBase<T> → TextWatermarkerBase<T> → KeyedSubstitutionWatermarker<T> → SyntacticWatermarker<T>
For Beginners
many phrases can be written two ways, “do not” or “don’t”. This watermarker picks one way at each place using the secret key. Text marked with your key always matches the key’s picks; other text matches only about half the time.
How It Works
Natural-language watermarking by meaning-preserving transformations was introduced by Atallah et al. (2001), who
applied transformations to parse trees. This watermarker uses one transformation that needs no parser:
contraction and expansion. Only unambiguous pairs are used (“it’s” is left alone, since it may stand for “it is”
or “it has”). Embedding and detection follow KeyedSubstitutionWatermarker: the keyed choice at
each site, and a z-test on how many sites agree with it.
Embedding changes the register of a text slightly, since it mixes contracted and full forms. Conversational and technical prose usually offers several sites per hundred words; 36 distinct sites reach full confidence.
Constructors
| Constructor | Summary |
|---|---|
SyntacticWatermarker(double watermarkStrength) |
Preserves the original constructor signature using the default configuration. |
SyntacticWatermarker(double watermarkStrength, string key) |
Initializes a new syntactic (contraction) watermarker. |
Properties
| Property | Summary |
|---|---|
IReadOnlyList<IReadOnlyList<string>> ContractionGroups { get; } |
The contraction pairs used as substitution sites. |
string ModuleName { get; } |