public final class FormTrainingClient extends Object
Instantiating a synchronous Form Training Client
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingClient.initialization' not found.
FormTrainingClientBuilder
,
FormTrainingClient
Modifier and Type | Method and Description |
---|---|
SyncPoller<FormRecognizerOperationResult,CustomFormModelInfo> |
beginCopyModel(String modelId,
CopyAuthorization target)
Copy a custom model stored in this resource (the source) to the user specified target Form Recognizer resource.
|
SyncPoller<FormRecognizerOperationResult,CustomFormModelInfo> |
beginCopyModel(String modelId,
CopyAuthorization target,
Duration pollInterval,
Context context)
Copy a custom model stored in this resource (the source) to the user specified target Form Recognizer resource.
|
SyncPoller<FormRecognizerOperationResult,CustomFormModel> |
beginCreateComposedModel(List<String> modelIds)
Create a composed model from the provided list of existing models in the account.
|
SyncPoller<FormRecognizerOperationResult,CustomFormModel> |
beginCreateComposedModel(List<String> modelIds,
CreateComposedModelOptions createComposedModelOptions,
Context context)
Create a composed model from the provided list of existing models in the account.
|
SyncPoller<FormRecognizerOperationResult,CustomFormModel> |
beginTraining(String trainingFilesUrl,
boolean useTrainingLabels)
Create and train a custom model.
|
SyncPoller<FormRecognizerOperationResult,CustomFormModel> |
beginTraining(String trainingFilesUrl,
boolean useTrainingLabels,
TrainingOptions trainingOptions,
Context context)
Create and train a custom model.
|
void |
deleteModel(String modelId)
Deletes the specified custom model.
|
Response<Void> |
deleteModelWithResponse(String modelId,
Context context)
Deletes the specified custom model.
|
AccountProperties |
getAccountProperties()
Get account information of the form recognizer account.
|
Response<AccountProperties> |
getAccountPropertiesWithResponse(Context context)
Get account information of the form recognizer account with an Http response and a
specified
Context . |
CopyAuthorization |
getCopyAuthorization(String resourceId,
String resourceRegion)
Generate authorization for copying a custom model into the target Form Recognizer resource.
|
Response<CopyAuthorization> |
getCopyAuthorizationWithResponse(String resourceId,
String resourceRegion,
Context context)
Generate authorization for copying a custom model into the target Form Recognizer resource.
|
CustomFormModel |
getCustomModel(String modelId)
Get detailed information for a specified custom model id.
|
Response<CustomFormModel> |
getCustomModelWithResponse(String modelId,
Context context)
Get detailed information for a specified custom model id.
|
FormRecognizerClient |
getFormRecognizerClient()
Creates a new
FormRecognizerClient object. |
PagedIterable<CustomFormModelInfo> |
listCustomModels()
List information for each model on the form recognizer account.
|
PagedIterable<CustomFormModelInfo> |
listCustomModels(Context context)
List information for each model on the form recognizer account with an Http response and a specified
Context . |
public FormRecognizerClient getFormRecognizerClient()
FormRecognizerClient
object. The new FormTrainingClient
uses the same request policy pipeline as the FormTrainingClient
.FormRecognizerClient
object.public SyncPoller<FormRecognizerOperationResult,CustomFormModel> beginTraining(String trainingFilesUrl, boolean useTrainingLabels)
Models are trained using documents that are of the following content type - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff'. Other type of content is ignored.
The service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingClient.beginTraining#string-boolean' not found.
trainingFilesUrl
- an externally accessible Azure storage blob container Uri (preferably a Shared Access
Signature Uri).
For instructions on setting up forms for training in an Azure Storage Blob Container, see
here.useTrainingLabels
- boolean to specify the use of labeled files for training the model.SyncPoller
that polls the training model operation until it has completed, has failed, or has
been cancelled. The completed operation returns the trained custom form model
.FormRecognizerException
- If training fails and model with ModelStatus.INVALID
is created.NullPointerException
- If trainingFilesUrl
is null.public SyncPoller<FormRecognizerOperationResult,CustomFormModel> beginTraining(String trainingFilesUrl, boolean useTrainingLabels, TrainingOptions trainingOptions, Context context)
The service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingClient.beginTraining#string-boolean-TrainingOptions-Context' not found.
trainingFilesUrl
- an externally accessible Azure storage blob container Uri (preferably a
Shared Access Signature Uri).
For instructions on setting up forms for training in an Azure Storage Blob Container, see
here.useTrainingLabels
- boolean to specify the use of labeled files for training the model.trainingOptions
- The additional configurable options
that may be passed when training a model.context
- Additional context that is passed through the HTTP pipeline during the service call.SyncPoller
that polls the training model operation until it has completed, has failed, or has
been cancelled. The completed operation returns the trained custom form model
.FormRecognizerException
- If training fails and model with ModelStatus.INVALID
is created.NullPointerException
- If trainingFilesUrl
is null.public CustomFormModel getCustomModel(String modelId)
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingClient.getCustomModel#string' not found.
modelId
- The UUID string format model identifier.IllegalArgumentException
- If modelId
is null or empty.public Response<CustomFormModel> getCustomModelWithResponse(String modelId, Context context)
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingClient.getCustomModelWithResponse#string-Context' not found.
modelId
- The UUID string format model identifier.context
- Additional context that is passed through the Http pipeline during the service call.IllegalArgumentException
- If modelId
is null or empty.public AccountProperties getAccountProperties()
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingClient.getAccountProperties' not found.
public Response<AccountProperties> getAccountPropertiesWithResponse(Context context)
Context
.
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingClient.getAccountPropertiesWithResponse#Context' not found.
context
- Additional context that is passed through the Http pipeline during the service call.public void deleteModel(String modelId)
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingClient.deleteModel#string' not found.
modelId
- The UUID string format model identifier.IllegalArgumentException
- If modelId
is null or empty.public Response<Void> deleteModelWithResponse(String modelId, Context context)
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingClient.deleteModelWithResponse#string-Context' not found.
modelId
- The UUID string format model identifier.context
- Additional context that is passed through the Http pipeline during the service call.Response
containing containing status code and HTTP headers.IllegalArgumentException
- If modelId
is null or empty.public PagedIterable<CustomFormModelInfo> listCustomModels()
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingClient.listCustomModels' not found.
PagedIterable
of CustomFormModelInfo
custom form model information.public PagedIterable<CustomFormModelInfo> listCustomModels(Context context)
Context
.
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingClient.listCustomModels#Context' not found.
context
- Additional context that is passed through the Http pipeline during the service call.PagedIterable
of CustomFormModelInfo
custom form model information.public SyncPoller<FormRecognizerOperationResult,CustomFormModelInfo> beginCopyModel(String modelId, CopyAuthorization target)
This should be called with the source Form Recognizer resource (with the model that is intended to be copied).
The target parameter should be supplied from the target resource's output from
FormTrainingAsyncClient.getCopyAuthorization(String, String)
method.
The service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.beginCopyModel#string-copyAuthorization' not found.
modelId
- Model identifier of the model to copy to the target Form Recognizer resourcetarget
- the copy authorization to the target Form Recognizer resource. The copy authorization can be
generated from the target resource's call to FormTrainingClient.getCopyAuthorization(String, String)
SyncPoller
that polls the copy model operation until it has completed, has failed,
or has been cancelled.public SyncPoller<FormRecognizerOperationResult,CustomFormModelInfo> beginCopyModel(String modelId, CopyAuthorization target, Duration pollInterval, Context context)
This should be called with the source Form Recognizer resource (with the model that is intended to be copied).
The target parameter should be supplied from the target resource's output from
FormTrainingClient.getCopyAuthorization(String, String)
method.
The service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingClient.beginCopyModel#string-copyAuthorization-Duration-Context' not found.
modelId
- Model identifier of the model to copy to the target Form Recognizer resourcetarget
- the copy authorization to the target Form Recognizer resource. The copy authorization can be
generated from the target resource's call to FormTrainingClient.getCopyAuthorization(String, String)
pollInterval
- Duration between each poll for the operation status. If none is specified, a default of
5 seconds is used.context
- Additional context that is passed through the HTTP pipeline during the service call.SyncPoller
that polls the copy model operation until it has completed, has failed,
or has been cancelled.public CopyAuthorization getCopyAuthorization(String resourceId, String resourceRegion)
resourceId
- Azure Resource Id of the target Form Recognizer resource where the model will be copied to.
This information can be found in the 'Properties' section of the Form Recognizer resource in the Azure Portal.resourceRegion
- Location of the target Form Recognizer resource. A valid Azure region name supported
by Cognitive Services. This information can be found in the 'Keys and Endpoint' section of the Form Recognizer
resource in the Azure Portal.
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingClient.getCopyAuthorization#string-string' not found.
CopyAuthorization
public Response<CopyAuthorization> getCopyAuthorizationWithResponse(String resourceId, String resourceRegion, Context context)
FormTrainingAsyncClient.beginCopyModel(String, CopyAuthorization)
.resourceId
- Azure Resource Id of the target Form Recognizer resource where the model will be copied to.
This information can be found in the 'Properties' section of the Form Recognizer resource in the Azure Portal.resourceRegion
- Location of the target Form Recognizer resource. A valid Azure region name supported by
Cognitive Services.This information can be found in the 'Keys and Endpoint' section of the Form Recognizer
resource in the Azure Portal.context
- Additional context that is passed through the Http pipeline during the service call.
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingClient.getCopyAuthorizationWithResponse#string-string-Context' not found.
Response
containing the CopyAuthorization
public SyncPoller<FormRecognizerOperationResult,CustomFormModel> beginCreateComposedModel(List<String> modelIds)
This operations fails if the list consists of an invalid, non-existing model Id or duplicate Ids. This operation is currently only supported for custom models trained using labels.
The service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingClient.beginCreateComposedModel#list' not found.
modelIds
- The list of models Ids to form the composed model.SyncPoller
that polls the create composed model operation until it has completed, has failed,
or has been cancelled. The completed operation returns the composed model
.FormRecognizerException
- If create composed model operation fails and model with
OperationStatus.FAILED
is created.NullPointerException
- If the list of modelIds
is null or empty.public SyncPoller<FormRecognizerOperationResult,CustomFormModel> beginCreateComposedModel(List<String> modelIds, CreateComposedModelOptions createComposedModelOptions, Context context)
This operations fails if the list consists of an invalid, non-existing model Id or duplicate Ids. This operation is currently only supported for custom models trained using labels.
The service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingClient.beginCreateComposedModel#list-CreateComposedModelOptions-Context' not found.
modelIds
- The list of models Ids to form the composed model.createComposedModelOptions
- The configurable options
to pass when
creating a composed model.context
- Additional context that is passed through the HTTP pipeline during the service call.SyncPoller
that polls the create composed model operation until it has completed, has failed,
or has been cancelled. The completed operation returns the composed model
.FormRecognizerException
- If create composed model operation fails and model with
OperationStatus.FAILED
is created.NullPointerException
- If the list of modelIds
is null or empty.Copyright © 2021. All rights reserved.