SynonymReplacement<T>

Models & Types · AiDotNet.Augmentation.Text

Replaces random words with their synonyms.

Inheritance: AugmentationBase<T, string[]> → TextAugmenterBase<T> → SynonymReplacement<T>

For Beginners

Synonym replacement swaps words with similar-meaning words. For example, “happy” might become “joyful” or “glad”. This helps models understand that different words can have the same meaning.

How It Works

When to use:

  • Text classification tasks
  • Sentiment analysis
  • When training data has limited vocabulary variation

Constructors

Constructor Summary
SynonymReplacement(double replacementFraction, double probability, string languageCode) Creates a new synonym replacement augmentation.

Properties

Property Summary
Dictionary<string, string[]> CustomSynonyms { get; set; } Gets or sets the custom synonym dictionary.
double ReplacementFraction { get; } Gets the fraction of words to replace.

Methods

Method Summary
IDictionary<string, object> GetParameters()