Method CreateTrainingObject
- Namespace
- LMKit.TextAnalysis
- Assembly
- LM-Kit.NET.dll
CreateTrainingObject(IList<(string, bool)>, int)
Creates an object for fine-tuning a sarcasm detection model using the provided training data.
public LoraFinetuning CreateTrainingObject(IList<(string, bool)> trainingData, int maxSamples = 2147483647)
Parameters
trainingData
IList<(string, bool)>A list of tuples where each tuple contains a text (string) and a boolean indicating sarcasm.
The text represents the input data, and the boolean represents the expected output (sarcastic or not).maxSamples
intThe 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 firstmaxSamples
samples will be used.
Returns
- LoraFinetuning
A LoraFinetuning object configured for fine-tuning the sarcasm 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 contains invalid entries.- InvalidModelException
Thrown if fine-tuning is not supported for Embedding classification mode.
CreateTrainingObject(TrainingDataset, int, bool, int?)
Creates a training object for fine-tuning a sarcasm detection model using a specified dataset.
public LoraFinetuning CreateTrainingObject(SarcasmDetection.TrainingDataset dataset, int maxSamples = 2147483647, bool shuffle = false, int? seed = null)
Parameters
dataset
SarcasmDetection.TrainingDatasetThe dataset to be used for training.
maxSamples
intThe maximum number of samples to use from the dataset. Default is 1000.
shuffle
boolIndicates whether to shuffle the dataset before selecting samples. Default is false.
seed
int?An optional seed for the random number generator used when shuffling. If
null
, the shuffle operation will not be seeded.
Returns
- LoraFinetuning
A LoraFinetuning object configured with the training data.
Exceptions
- ArgumentException
Thrown if the dataset is not recognized.
- InvalidModelException
Thrown if fine-tuning is not supported for Embedding classification mode.