Table of Contents

Method CreateTrainingObject

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

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

Creates an object for fine-tuning a categorization model using provided training data.

public LoraFinetuning CreateTrainingObject(IList<string> categories, IList<(string, string)> trainingData, int maxSamples = 1000)

Parameters

categories IList<string>

A list of predefined categories. Each category should be a unique, non-null string.

trainingData IList<(string, string)>

A list of tuples where each tuple contains a text and its corresponding category.

maxSamples int

The maximum number of training samples to use. The default value is 1000.

Returns

LoraFinetuning

A LoraFinetuning object for fine-tuning the categorization model.

Exceptions

ArgumentNullException

Thrown if the categories or trainingData arguments are null.

ArgumentException

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

InvalidModelException

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