public final class FormTrainingAsyncClient extends Object
Instantiating an asynchronous Form Training Client
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.initialization' not found.
FormTrainingClientBuilder
,
FormTrainingAsyncClient
Modifier and Type | Method and Description |
---|---|
PollerFlux<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.
|
PollerFlux<FormRecognizerOperationResult,CustomFormModelInfo> |
beginCopyModel(String modelId,
CopyAuthorization target,
Duration pollInterval)
Copy a custom model stored in this resource (the source) to the user specified target Form Recognizer resource.
|
PollerFlux<FormRecognizerOperationResult,CustomFormModel> |
beginCreateComposedModel(List<String> modelIds)
Create a composed model from the provided list of existing models in the account.
|
PollerFlux<FormRecognizerOperationResult,CustomFormModel> |
beginCreateComposedModel(List<String> modelIds,
CreateComposedModelOptions createComposedModelOptions)
Create a composed model from the provided list of existing models in the account.
|
PollerFlux<FormRecognizerOperationResult,CustomFormModel> |
beginTraining(String trainingFilesUrl,
boolean useTrainingLabels)
Create and train a custom model.
|
PollerFlux<FormRecognizerOperationResult,CustomFormModel> |
beginTraining(String trainingFilesUrl,
boolean useTrainingLabels,
TrainingOptions trainingOptions)
Create and train a custom model.
|
Mono<Void> |
deleteModel(String modelId)
Deletes the specified custom model.
|
Mono<Response<Void>> |
deleteModelWithResponse(String modelId)
Deletes the specified custom model.
|
Mono<AccountProperties> |
getAccountProperties()
Get account information of the form recognizer account.
|
Mono<Response<AccountProperties>> |
getAccountPropertiesWithResponse()
Get account information of the form recognizer account with an Http response.
|
Mono<CopyAuthorization> |
getCopyAuthorization(String resourceId,
String resourceRegion)
Generate authorization for copying a custom model into the target Form Recognizer resource.
|
Mono<Response<CopyAuthorization>> |
getCopyAuthorizationWithResponse(String resourceId,
String resourceRegion)
Generate authorization for copying a custom model into the target Form Recognizer resource.
|
Mono<CustomFormModel> |
getCustomModel(String modelId)
Get detailed information for a specified custom model id.
|
Mono<Response<CustomFormModel>> |
getCustomModelWithResponse(String modelId)
Get detailed information for a specified custom model id with Http response.
|
FormRecognizerAsyncClient |
getFormRecognizerAsyncClient()
Creates a new
FormRecognizerAsyncClient object. |
PagedFlux<CustomFormModelInfo> |
listCustomModels()
List information for each model on the form recognizer account.
|
public FormRecognizerAsyncClient getFormRecognizerAsyncClient()
FormRecognizerAsyncClient
object. The new FormTrainingAsyncClient
uses the same request policy pipeline as the FormTrainingAsyncClient
.FormRecognizerAsyncClient
object.public PollerFlux<FormRecognizerOperationResult,CustomFormModel> beginTraining(String trainingFilesUrl, boolean useTrainingLabels)
The service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.
See here for information on building your own training data set.Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.beginTraining#string-boolean' not found.
trainingFilesUrl
- source URL parameter that is an externally accessible Azure
storage blob container Uri (preferably a Shared Access Signature Uri).useTrainingLabels
- boolean to specify the use of labeled files for training the model.PollerFlux
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 a model with ModelStatus.INVALID
is created.NullPointerException
- If trainingFilesUrl
is null.public PollerFlux<FormRecognizerOperationResult,CustomFormModel> beginTraining(String trainingFilesUrl, boolean useTrainingLabels, TrainingOptions trainingOptions)
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.
See here for information on building your own training data set.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.beginTraining#string-boolean-TrainingOptions' not found.
trainingFilesUrl
- an externally accessible Azure storage blob container Uri (preferably a
Shared Access Signature Uri).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.PollerFlux
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 Mono<CustomFormModel> getCustomModel(String modelId)
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.getCustomModel#string' not found.
modelId
- The UUID string format model identifier.IllegalArgumentException
- If modelId
is null or empty.public Mono<Response<CustomFormModel>> getCustomModelWithResponse(String modelId)
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.getCustomModelWithResponse#string' not found.
modelId
- The UUID string format model identifier.Response
containing the requested model
.IllegalArgumentException
- If modelId
is null or empty.public Mono<AccountProperties> getAccountProperties()
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.getAccountProperties' not found.
public Mono<Response<AccountProperties>> getAccountPropertiesWithResponse()
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.getAccountPropertiesWithResponse' not found.
Response
containing the requested account information details.public Mono<Void> deleteModel(String modelId)
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.deleteModel#string' not found.
modelId
- The UUID string format model identifier.IllegalArgumentException
- If modelId
is null or empty.public Mono<Response<Void>> deleteModelWithResponse(String modelId)
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.deleteModelWithResponse#string' not found.
modelId
- The UUID string format model identifier.Response
containing the status code and HTTP headers.IllegalArgumentException
- If modelId
is null or empty.public PagedFlux<CustomFormModelInfo> listCustomModels()
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.listCustomModels' not found.
PagedFlux
of CustomFormModelInfo
.public PollerFlux<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 FormTrainingAsyncClient.getCopyAuthorization(String, String)
PollerFlux
that polls the copy model operation until it has completed, has failed,
or has been cancelled. The completed operation returns the copied model CustomFormModelInfo
.FormRecognizerException
- If copy operation fails and model with OperationStatus.FAILED
is created.NullPointerException
- If modelId
, target
is null.public PollerFlux<FormRecognizerOperationResult,CustomFormModelInfo> beginCopyModel(String modelId, CopyAuthorization target, Duration pollInterval)
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-Duration' 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 FormTrainingAsyncClient.getCopyAuthorization(String, String)
pollInterval
- Duration between each poll for the operation status. If none is specified, a default of
5 seconds is used.PollerFlux
that polls the copy model operation until it has completed, has failed,
or has been cancelled. The completed operation returns the copied model CustomFormModelInfo
.FormRecognizerException
- If copy operation fails and model with OperationStatus.FAILED
is created.NullPointerException
- If modelId
, target
is null.public Mono<CopyAuthorization> getCopyAuthorization(String resourceId, String resourceRegion)
resourceId
- Azure Resource Id of the target Form Recognizer resource where the model will be copied to.resourceRegion
- Location of the target Form Recognizer resource. A valid Azure region name supported
by Cognitive Services.
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.getCopyAuthorization#string-string' not found.
CopyAuthorization
that could be used to authorize copying model between resources.NullPointerException
- If resourceId
, resourceRegion
is null.public Mono<Response<CopyAuthorization>> getCopyAuthorizationWithResponse(String resourceId, String resourceRegion)
FormTrainingAsyncClient.beginCopyModel(String, CopyAuthorization)
.resourceId
- Azure Resource Id of the target Form Recognizer resource where the model will be copied to.resourceRegion
- Location of the target Form Recognizer resource. A valid Azure region name supported by
Cognitive Services.
Code sample
Snippet 'com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.getCopyAuthorizationWithResponse#string-string' not found.
Response
containing the CopyAuthorization
that could be used to authorize copying
model between resources.NullPointerException
- If resourceId
, resourceRegion
is null.public PollerFlux<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.FormTrainingAsyncClient.beginCreateComposedModel#list' not found.
modelIds
- The list of models Ids to form the composed model.PollerFlux
that polls the create composed model operation until it has completed, has failed,
or has been cancelled. The completed operation returns the created 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 PollerFlux<FormRecognizerOperationResult,CustomFormModel> beginCreateComposedModel(List<String> modelIds, CreateComposedModelOptions createComposedModelOptions)
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.FormTrainingAsyncClient.beginCreateComposedModel#list-createComposedModelOptions' not found.
modelIds
- The list of models Ids to form the composed model.createComposedModelOptions
- The configurable options
to pass when
creating a composed model.PollerFlux
that polls the create composed model operation until it has completed, has failed,
or has been cancelled. The completed operation returns the copied model CustomFormModel
.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.