44
55using System ;
66using System . Collections . Generic ;
7+ using System . ComponentModel ;
78using System . Text ;
89using Microsoft . ML . Data ;
910using Microsoft . ML . TorchSharp . AutoFormerV2 ;
@@ -161,7 +162,45 @@ public static ObjectDetectionMetrics EvaluateObjectDetection(
161162 }
162163
163164 /// <summary>
164- /// Fine tune a NAS-BERT model for Name Entity Recognition. The limit for any sentence is 512 tokens. Each word typically
165+ /// Obsolete: please use the <see cref="NamedEntityRecognition"/> method instead
166+ /// </summary>
167+ /// <param name="catalog">The transform's catalog.</param>
168+ /// <param name="labelColumnName">Name of the label column. Column should be a key type.</param>
169+ /// <param name="outputColumnName">Name of the output column. It will be a key type. It is the predicted label.</param>
170+ /// <param name="sentence1ColumnName">Name of the column for the first sentence.</param>
171+ /// <param name="batchSize">Number of rows in the batch.</param>
172+ /// <param name="maxEpochs">Maximum number of times to loop through your training set.</param>
173+ /// <param name="architecture">Architecture for the model. Defaults to Roberta.</param>
174+ /// <param name="validationSet">The validation set used while training to improve model quality.</param>
175+ /// <returns></returns>
176+ [ Obsolete ( "Please use NamedEntityRecognition method instead" , false ) ]
177+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
178+ public static NerTrainer NameEntityRecognition (
179+ this MulticlassClassificationCatalog . MulticlassClassificationTrainers catalog ,
180+ string labelColumnName = DefaultColumnNames . Label ,
181+ string outputColumnName = DefaultColumnNames . PredictedLabel ,
182+ string sentence1ColumnName = "Sentence" ,
183+ int batchSize = 32 ,
184+ int maxEpochs = 10 ,
185+ BertArchitecture architecture = BertArchitecture . Roberta ,
186+ IDataView validationSet = null )
187+ => NamedEntityRecognition ( catalog , labelColumnName , outputColumnName , sentence1ColumnName , batchSize , maxEpochs , architecture , validationSet ) ;
188+
189+ /// <summary>
190+ /// Obsolete: please use the <see cref="NamedEntityRecognition"/> method instead
191+ /// </summary>
192+ /// <param name="catalog">The transform's catalog.</param>
193+ /// <param name="options">The full set of advanced options.</param>
194+ /// <returns></returns>
195+ [ Obsolete ( "Please use NamedEntityRecognition method instead" , false ) ]
196+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
197+ public static NerTrainer NameEntityRecognition (
198+ this MulticlassClassificationCatalog . MulticlassClassificationTrainers catalog ,
199+ NerTrainer . NerOptions options )
200+ => NamedEntityRecognition ( catalog , options ) ;
201+
202+ /// <summary>
203+ /// Fine tune a NAS-BERT model for Named Entity Recognition. The limit for any sentence is 512 tokens. Each word typically
165204 /// will map to a single token, and we automatically add 2 specical tokens (a start token and a separator token)
166205 /// so in general this limit will be 510 words for all sentences.
167206 /// </summary>
@@ -174,7 +213,7 @@ public static ObjectDetectionMetrics EvaluateObjectDetection(
174213 /// <param name="architecture">Architecture for the model. Defaults to Roberta.</param>
175214 /// <param name="validationSet">The validation set used while training to improve model quality.</param>
176215 /// <returns></returns>
177- public static NerTrainer NameEntityRecognition (
216+ public static NerTrainer NamedEntityRecognition (
178217 this MulticlassClassificationCatalog . MulticlassClassificationTrainers catalog ,
179218 string labelColumnName = DefaultColumnNames . Label ,
180219 string outputColumnName = DefaultColumnNames . PredictedLabel ,
@@ -186,12 +225,12 @@ public static NerTrainer NameEntityRecognition(
186225 => new NerTrainer ( CatalogUtils . GetEnvironment ( catalog ) , labelColumnName , outputColumnName , sentence1ColumnName , batchSize , maxEpochs , validationSet , architecture ) ;
187226
188227 /// <summary>
189- /// Fine tune a Name Entity Recognition model.
228+ /// Fine tune a Named Entity Recognition model.
190229 /// </summary>
191230 /// <param name="catalog">The transform's catalog.</param>
192231 /// <param name="options">The full set of advanced options.</param>
193232 /// <returns></returns>
194- public static NerTrainer NameEntityRecognition (
233+ public static NerTrainer NamedEntityRecognition (
195234 this MulticlassClassificationCatalog . MulticlassClassificationTrainers catalog ,
196235 NerTrainer . NerOptions options )
197236 => new NerTrainer ( CatalogUtils . GetEnvironment ( catalog ) , options ) ;
0 commit comments