Table of Contents

Property EnableModalityAugmentation

Namespace
LMKit.TextAnalysis.Training
Assembly
LM-Kit.NET.dll

EnableModalityAugmentation

Gets or sets whether to add modality-augmented samples when the engine runs in Multimodal.

public bool EnableModalityAugmentation { get; set; }

Property Value

bool

Examples

using var model = new LM("path/to/model.gguf");
var ner = new NamedEntityRecognition(model);

var dataset = new NamedEntityRecognitionTrainingDataset(ner)
{
    // Enable automatic augmentation for multimodal samples
    EnableModalityAugmentation = true
};

// This single call produces 3 samples when engine is Multimodal:
// one Multimodal, one Text-only, and one Vision-only
dataset.AddSample(
    "Dr. Marie Curie worked at the University of Paris.",
    new[]
    {
        new EntityAnnotation("Person", "Dr. Marie Curie"),
        new EntityAnnotation("Organization", "University of Paris")
    });

dataset.ExportAsSharegpt("augmented_ner_dataset.json", overwrite: true);

Remarks

When true and the generated sample uses Multimodal, two additional samples are appended automatically using Text and Vision with the same content and labels. This can improve robustness across modalities during fine-tuning.