Table of Contents

Method CreateTrainingObject

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

CreateTrainingObject(IList<(string, EmotionCategory)>, int)

Creates an object for fine-tuning an emotion detection model using the provided training data.

public LoraFinetuning CreateTrainingObject(IList<(string, EmotionDetection.EmotionCategory)> trainingData, int maxSamples = 2147483647)

Parameters

trainingData IList<(string, EmotionDetection.EmotionCategory)>

A list of tuples where each tuple contains a text (string) and its corresponding emotion category (EmotionDetection.EmotionCategory).
The text represents the input data, and the emotion category represents the expected output.

maxSamples int

The maximum number of training samples to use. The default value is int.MaxValue. If the number of samples in trainingData exceeds this value, only the first maxSamples samples will be used.

Returns

LoraFinetuning

A LoraFinetuning object configured for fine-tuning the emotion detection model with the provided training data.

Exceptions

ArgumentNullException

Thrown if the trainingData argument is null.

ArgumentException

Thrown if the trainingData list is empty, or if any entry in the list is associated with an undefined emotion category.

InvalidModelException

Thrown if fine-tuning is not supported for Embedding classification mode.