SentenceSimilarityTrainer Class

Definition

The IEstimator<TTransformer> for training a Deep Neural Network(DNN) to classify text.

public class SentenceSimilarityTrainer : Microsoft.ML.TorchSharp.NasBert.NasBertTrainer<float,float>
type SentenceSimilarityTrainer = class
    inherit NasBertTrainer<single, single>
Public Class SentenceSimilarityTrainer
Inherits NasBertTrainer(Of Single, Single)
Inheritance

Remarks

To create this trainer, use TextClassification.

Input and Output Columns

The input label column data must be typeSingle type and the sentence columns must be of typeTextDataViewType.

This trainer outputs the following columns:

Output Column Name Column Type Description
Score Single The degree of similarity between the 2 sentences.

Trainer Characteristics

Machine learning task Rregression
Is normalization required? No
Is caching required? No
Required NuGet in addition to Microsoft.ML Microsoft.ML.TorchSharp and libtorch-cpu or libtorch-cuda-11.3 or any of the OS specific variants.
Exportable to ONNX No

Training Algorithm Details

Trains a Deep Neural Network(DNN) by leveraging an existing pre-trained NAS-BERT roBERTa model for the purpose of determining sentence similarity.

Methods

Fit(IDataView) (Inherited from TorchSharpBaseTrainer<TLabelCol,TTargetsCol>)
GetOutputSchema(SchemaShape) (Inherited from NasBertTrainer<TLabelCol,TTargetsCol>)

Applies to