FormTrainingClient.StartTrainingAsync Method

Definition

Trains a model from a collection of custom forms in a blob storage container.

public virtual System.Threading.Tasks.Task<Azure.AI.FormRecognizer.Training.TrainingOperation> StartTrainingAsync (Uri trainingFilesUri, bool useTrainingLabels, string modelName = default, Azure.AI.FormRecognizer.Training.TrainingOptions trainingOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member StartTrainingAsync : Uri * bool * string * Azure.AI.FormRecognizer.Training.TrainingOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.AI.FormRecognizer.Training.TrainingOperation>
override this.StartTrainingAsync : Uri * bool * string * Azure.AI.FormRecognizer.Training.TrainingOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.AI.FormRecognizer.Training.TrainingOperation>
Public Overridable Function StartTrainingAsync (trainingFilesUri As Uri, useTrainingLabels As Boolean, Optional modelName As String = Nothing, Optional trainingOptions As TrainingOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TrainingOperation)

Parameters

trainingFilesUri
System.Uri

An externally accessible Azure storage blob container Uri. For more information see here.

useTrainingLabels
System.Boolean

If true, corresponding labeled files must exist in the blob container. If false, the model will be trained from forms only.

modelName
System.String

An optional, user-defined name to associate with the model. This property is only available for V2_1 and up.

trainingOptions
TrainingOptions

A set of options available for configuring the training request. For example, set a filter to apply to the documents in the source path for training.

cancellationToken
System.Threading.CancellationToken

A System.Threading.CancellationToken controlling the request lifetime.

Returns

System.Threading.Tasks.Task<TrainingOperation>

A TrainingOperation to wait on this long-running operation. Its Value upon successful completion will contain meta-data about the trained model.

Even if training fails, a model is created in the Form Recognizer account with an "invalid" status. A RequestFailedException will be raised containing the modelId to access this invalid model.

Applies to