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");
using var pii = new PiiExtraction(model);

var dataset = new PiiExtractionTrainingDataset(pii)
{
    // 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(
    "Patient ID: P-12345",
    new[] { new EntityAnnotation("PatientID", "P-12345") });

dataset.ExportAsSharegpt("augmented_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.