TorchSharpCatalog.NamedEntityRecognition Method

Definition

Overloads

NamedEntityRecognition(MulticlassClassificationCatalog+MulticlassClassificationTrainers, NerTrainer+NerOptions)

Fine tune a Named Entity Recognition model.

NamedEntityRecognition(MulticlassClassificationCatalog+MulticlassClassificationTrainers, String, String, String, Int32, Int32, BertArchitecture, IDataView)

Fine tune a NAS-BERT model for Named Entity Recognition. The limit for any sentence is 512 tokens. Each word typically will map to a single token, and we automatically add 2 specical tokens (a start token and a separator token) so in general this limit will be 510 words for all sentences.

NamedEntityRecognition(MulticlassClassificationCatalog+MulticlassClassificationTrainers, NerTrainer+NerOptions)

Source:
TorchSharpCatalog.cs
Source:
TorchSharpCatalog.cs
Source:
TorchSharpCatalog.cs

Fine tune a Named Entity Recognition model.

C#
public static Microsoft.ML.TorchSharp.NasBert.NerTrainer NamedEntityRecognition(this Microsoft.ML.MulticlassClassificationCatalog.MulticlassClassificationTrainers catalog, Microsoft.ML.TorchSharp.NasBert.NerTrainer.NerOptions options);

Parameters

options
NerTrainer.NerOptions

The full set of advanced options.

Returns

Applies to

ML.NET Preview and other versions
Product Versions
ML.NET 3.0.0, 4.0.0, Preview

NamedEntityRecognition(MulticlassClassificationCatalog+MulticlassClassificationTrainers, String, String, String, Int32, Int32, BertArchitecture, IDataView)

Source:
TorchSharpCatalog.cs
Source:
TorchSharpCatalog.cs
Source:
TorchSharpCatalog.cs

Fine tune a NAS-BERT model for Named Entity Recognition. The limit for any sentence is 512 tokens. Each word typically will map to a single token, and we automatically add 2 specical tokens (a start token and a separator token) so in general this limit will be 510 words for all sentences.

C#
public static Microsoft.ML.TorchSharp.NasBert.NerTrainer NamedEntityRecognition(this Microsoft.ML.MulticlassClassificationCatalog.MulticlassClassificationTrainers catalog, string labelColumnName = "Label", string outputColumnName = "PredictedLabel", string sentence1ColumnName = "Sentence", int batchSize = 32, int maxEpochs = 10, Microsoft.ML.TorchSharp.NasBert.BertArchitecture architecture = Microsoft.ML.TorchSharp.NasBert.BertArchitecture.Roberta, Microsoft.ML.IDataView validationSet = default);

Parameters

labelColumnName
String

Name of the label column. Column should be a key type.

outputColumnName
String

Name of the output column. It will be a key type. It is the predicted label.

sentence1ColumnName
String

Name of the column for the first sentence.

batchSize
Int32

Number of rows in the batch.

maxEpochs
Int32

Maximum number of times to loop through your training set.

architecture
BertArchitecture

Architecture for the model. Defaults to Roberta.

validationSet
IDataView

The validation set used while training to improve model quality.

Returns

Applies to

ML.NET Preview and other versions
Product Versions
ML.NET 3.0.0, 4.0.0, Preview