azure-docs-sdk-java/docs-ref-autogen/com.azure.ai.formrecognizer...

298 строки
53 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.ai.formrecognizer.training.FormTrainingClient"
fullName: "com.azure.ai.formrecognizer.training.FormTrainingClient"
name: "FormTrainingClient"
nameWithType: "FormTrainingClient"
summary: "This class provides a synchronous client to connect to the Form Recognizer Azure Cognitive Service."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public final class **FormTrainingClient**"
methods:
- uid: "com.azure.ai.formrecognizer.training.FormTrainingClient.beginCopyModel(java.lang.String,com.azure.ai.formrecognizer.training.models.CopyAuthorization)"
fullName: "com.azure.ai.formrecognizer.training.FormTrainingClient.beginCopyModel(String modelId, CopyAuthorization target)"
name: "beginCopyModel(String modelId, CopyAuthorization target)"
nameWithType: "FormTrainingClient.beginCopyModel(String modelId, CopyAuthorization target)"
summary: "Copy a custom model stored in this resource (the source) to the user specified target Form Recognizer resource."
parameters:
- description: "Model identifier of the model to copy to the target Form Recognizer resource"
name: "modelId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "the copy authorization to the target Form Recognizer resource. The copy authorization can be\n generated from the target resource's call to <xref uid=\"com.azure.ai.formrecognizer.training.FormTrainingClient.getCopyAuthorization(java.lang.String,java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FormTrainingClient#getCopyAuthorization(String, String)\"></xref>"
name: "target"
type: "<xref href=\"com.azure.ai.formrecognizer.training.models.CopyAuthorization?alt=com.azure.ai.formrecognizer.training.models.CopyAuthorization&text=CopyAuthorization\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<FormRecognizerOperationResult,CustomFormModelInfo> beginCopyModel(String modelId, CopyAuthorization target)"
desc: "Copy a custom model stored in this resource (the source) to the user specified target Form Recognizer resource.\n\nThis 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 <xref uid=\"com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.getCopyAuthorization(java.lang.String,java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FormTrainingAsyncClient#getCopyAuthorization(String, String)\"></xref> method.\n\nThe service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.\n\n**Code sample**\n\n```java\nString resourceId = \"target-resource-Id\";\n String resourceRegion = \"target-resource-region\";\n String copyModelId = \"copy-model-Id\";\n formTrainingAsyncClient.getCopyAuthorization(resourceId, resourceRegion)\n .flatMapMany(copyAuthorization -> formTrainingAsyncClient.beginCopyModel(copyModelId, copyAuthorization))\n .flatMap(AsyncPollResponse::getFinalResult)\n .subscribe(customFormModelInfo ->\n System.out.printf(\"Copied model has model Id: %s, model status: %s, training started on: %s,\"\n + \" training completed on: %s.%n\",\n customFormModelInfo.getModelId(),\n customFormModelInfo.getStatus(),\n customFormModelInfo.getTrainingStartedOn(),\n customFormModelInfo.getTrainingCompletedOn()));\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the copy model operation until it has completed, has failed,\n or has been cancelled."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.formrecognizer.models.FormRecognizerOperationResult?alt=com.azure.ai.formrecognizer.models.FormRecognizerOperationResult&text=FormRecognizerOperationResult\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.formrecognizer.training.models.CustomFormModelInfo?alt=com.azure.ai.formrecognizer.training.models.CustomFormModelInfo&text=CustomFormModelInfo\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.formrecognizer.training.FormTrainingClient.beginCopyModel(java.lang.String,com.azure.ai.formrecognizer.training.models.CopyAuthorization,java.time.Duration,com.azure.core.util.Context)"
fullName: "com.azure.ai.formrecognizer.training.FormTrainingClient.beginCopyModel(String modelId, CopyAuthorization target, Duration pollInterval, Context context)"
name: "beginCopyModel(String modelId, CopyAuthorization target, Duration pollInterval, Context context)"
nameWithType: "FormTrainingClient.beginCopyModel(String modelId, CopyAuthorization target, Duration pollInterval, Context context)"
summary: "Copy a custom model stored in this resource (the source) to the user specified target Form Recognizer resource."
parameters:
- description: "Model identifier of the model to copy to the target Form Recognizer resource"
name: "modelId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "the copy authorization to the target Form Recognizer resource. The copy authorization can be\n generated from the target resource's call to <xref uid=\"com.azure.ai.formrecognizer.training.FormTrainingClient.getCopyAuthorization(java.lang.String,java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FormTrainingClient#getCopyAuthorization(String, String)\"></xref>"
name: "target"
type: "<xref href=\"com.azure.ai.formrecognizer.training.models.CopyAuthorization?alt=com.azure.ai.formrecognizer.training.models.CopyAuthorization&text=CopyAuthorization\" data-throw-if-not-resolved=\"False\" />"
- description: "Duration between each poll for the operation status. If none is specified, a default of\n 5 seconds is used."
name: "pollInterval"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Additional context that is passed through the HTTP pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<FormRecognizerOperationResult,CustomFormModelInfo> beginCopyModel(String modelId, CopyAuthorization target, Duration pollInterval, Context context)"
desc: "Copy a custom model stored in this resource (the source) to the user specified target Form Recognizer resource.\n\nThis 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 <xref uid=\"com.azure.ai.formrecognizer.training.FormTrainingClient.getCopyAuthorization(java.lang.String,java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FormTrainingClient#getCopyAuthorization(String, String)\"></xref> method.\n\nThe service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.\n\n**Code sample**\n\n```java\n// The resource to copy model to\n String resourceId = \"target-resource-Id\";\n String resourceRegion = \"target-resource-region\";\n // The Id of the model to be copied\n String copyModelId = \"copy-model-Id\";\n\n CopyAuthorization copyAuthorization = targetFormTrainingClient.getCopyAuthorization(resourceId,\n resourceRegion);\n formTrainingClient.beginCopyModel(copyModelId, copyAuthorization, Duration.ofSeconds(5), Context.NONE)\n .waitForCompletion();\n CustomFormModel modelCopy = targetFormTrainingClient.getCustomModel(copyAuthorization.getModelId());\n System.out.printf(\"Copied model has model Id: %s, model status: %s, was requested on: %s,\"\n + \" transfer completed on: %s.%n\",\n modelCopy.getModelId(),\n modelCopy.getModelStatus(),\n modelCopy.getTrainingStartedOn(),\n modelCopy.getTrainingCompletedOn());\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the copy model operation until it has completed, has failed,\n or has been cancelled."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.formrecognizer.models.FormRecognizerOperationResult?alt=com.azure.ai.formrecognizer.models.FormRecognizerOperationResult&text=FormRecognizerOperationResult\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.formrecognizer.training.models.CustomFormModelInfo?alt=com.azure.ai.formrecognizer.training.models.CustomFormModelInfo&text=CustomFormModelInfo\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.formrecognizer.training.FormTrainingClient.beginCreateComposedModel(java.util.List<java.lang.String>)"
fullName: "com.azure.ai.formrecognizer.training.FormTrainingClient.beginCreateComposedModel(List<String> modelIds)"
name: "beginCreateComposedModel(List<String> modelIds)"
nameWithType: "FormTrainingClient.beginCreateComposedModel(List<String> modelIds)"
summary: "Create a composed model from the provided list of existing models in the account."
parameters:
- description: "The list of models Ids to form the composed model."
name: "modelIds"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
syntax: "public SyncPoller<FormRecognizerOperationResult,CustomFormModel> beginCreateComposedModel(List<String> modelIds)"
desc: "Create a composed model from the provided list of existing models in the account.\n\nThis 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.\n\nThe service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.\n\n**Code sample**\n\n```java\nString labeledModelId1 = \"5f21ab8d-71a6-42d8-9856-ef5985c486a8\";\n String labeledModelId2 = \"d7b0904c-841f-46f9-a9f4-3f2273eef7c9\";\n final CustomFormModel customFormModel\n = formTrainingClient.beginCreateComposedModel(Arrays.asList(labeledModelId1, labeledModelId2))\n .getFinalResult();\n System.out.printf(\"Model Id: %s%n\", customFormModel.getModelId());\n System.out.printf(\"Model Status: %s%n\", customFormModel.getModelStatus());\n System.out.printf(\"Is this a composed model: %s%n\",\n customFormModel.getCustomModelProperties().isComposed());\n customFormModel.getSubmodels()\n .forEach(customFormSubmodel -> customFormSubmodel.getFields()\n .forEach((key, customFormModelField) ->\n System.out.printf(\"Form type: %s Field Text: %s Field Accuracy: %f%n\",\n key, customFormModelField.getName(), customFormModelField.getAccuracy())));\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the create composed model operation until it has completed, has failed,\n or has been cancelled. The completed operation returns the <xref uid=\"com.azure.ai.formrecognizer.training.models.CustomFormModel\" data-throw-if-not-resolved=\"false\" data-raw-source=\"composed model\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.formrecognizer.models.FormRecognizerOperationResult?alt=com.azure.ai.formrecognizer.models.FormRecognizerOperationResult&text=FormRecognizerOperationResult\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.formrecognizer.training.models.CustomFormModel?alt=com.azure.ai.formrecognizer.training.models.CustomFormModel&text=CustomFormModel\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.formrecognizer.training.FormTrainingClient.beginCreateComposedModel(java.util.List<java.lang.String>,com.azure.ai.formrecognizer.models.CreateComposedModelOptions,com.azure.core.util.Context)"
fullName: "com.azure.ai.formrecognizer.training.FormTrainingClient.beginCreateComposedModel(List<String> modelIds, CreateComposedModelOptions createComposedModelOptions, Context context)"
name: "beginCreateComposedModel(List<String> modelIds, CreateComposedModelOptions createComposedModelOptions, Context context)"
nameWithType: "FormTrainingClient.beginCreateComposedModel(List<String> modelIds, CreateComposedModelOptions createComposedModelOptions, Context context)"
summary: "Create a composed model from the provided list of existing models in the account."
parameters:
- description: "The list of models Ids to form the composed model."
name: "modelIds"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The configurable <xref uid=\"com.azure.ai.formrecognizer.models.CreateComposedModelOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> to pass when\n creating a composed model."
name: "createComposedModelOptions"
type: "<xref href=\"com.azure.ai.formrecognizer.models.CreateComposedModelOptions?alt=com.azure.ai.formrecognizer.models.CreateComposedModelOptions&text=CreateComposedModelOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the HTTP pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<FormRecognizerOperationResult,CustomFormModel> beginCreateComposedModel(List<String> modelIds, CreateComposedModelOptions createComposedModelOptions, Context context)"
desc: "Create a composed model from the provided list of existing models in the account.\n\nThis 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.\n\nThe service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.\n\n**Code sample**\n\n```java\nString labeledModelId1 = \"5f21ab8d-71a6-42d8-9856-ef5985c486a8\";\n String labeledModelId2 = \"d7b0904c-841f-46f9-a9f4-3f2273eef7c9\";\n final CustomFormModel customFormModel =\n formTrainingClient.beginCreateComposedModel(Arrays.asList(labeledModelId1, labeledModelId2),\n new CreateComposedModelOptions()\n .setModelName(\"my composed model name\"),\n Context.NONE)\n .setPollInterval(Duration.ofSeconds(5))\n .getFinalResult();\n System.out.printf(\"Model Id: %s%n\", customFormModel.getModelId());\n System.out.printf(\"Model Status: %s%n\", customFormModel.getModelStatus());\n System.out.printf(\"Model display name: %s%n\", customFormModel.getModelName());\n System.out.printf(\"Is this a composed model: %s%n\",\n customFormModel.getCustomModelProperties().isComposed());\n customFormModel.getSubmodels()\n .forEach(customFormSubmodel -> customFormSubmodel.getFields()\n .forEach((key, customFormModelField) ->\n System.out.printf(\"Form type: %s Field Text: %s Field Accuracy: %f%n\",\n key, customFormModelField.getName(), customFormModelField.getAccuracy())));\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the create composed model operation until it has completed, has failed,\n or has been cancelled. The completed operation returns the <xref uid=\"com.azure.ai.formrecognizer.training.models.CustomFormModel\" data-throw-if-not-resolved=\"false\" data-raw-source=\"composed model\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.formrecognizer.models.FormRecognizerOperationResult?alt=com.azure.ai.formrecognizer.models.FormRecognizerOperationResult&text=FormRecognizerOperationResult\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.formrecognizer.training.models.CustomFormModel?alt=com.azure.ai.formrecognizer.training.models.CustomFormModel&text=CustomFormModel\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.formrecognizer.training.FormTrainingClient.beginTraining(java.lang.String,boolean)"
fullName: "com.azure.ai.formrecognizer.training.FormTrainingClient.beginTraining(String trainingFilesUrl, boolean useTrainingLabels)"
name: "beginTraining(String trainingFilesUrl, boolean useTrainingLabels)"
nameWithType: "FormTrainingClient.beginTraining(String trainingFilesUrl, boolean useTrainingLabels)"
summary: "Create and train a custom model."
parameters:
- description: "an externally accessible Azure storage blob container Uri (preferably a Shared Access\n Signature Uri).\n For instructions on setting up forms for training in an Azure Storage Blob Container, see\n <a href=\"https://docs.microsoft.com/azure/cognitive-services/form-recognizer/build-training-data-set#upload-your-training-data\">here</a>."
name: "trainingFilesUrl"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "boolean to specify the use of labeled files for training the model."
name: "useTrainingLabels"
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<FormRecognizerOperationResult,CustomFormModel> beginTraining(String trainingFilesUrl, boolean useTrainingLabels)"
desc: "Create and train a custom model.\n\nModels 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.\n\nThe service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.\n\n**Code sample**\n\n```java\nString trainingFilesUrl = \"{SAS-URL-of-your-container-in-blob-storage}\";\n boolean useTrainingLabels = true;\n CustomFormModel customFormModel =\n formTrainingClient.beginTraining(trainingFilesUrl, useTrainingLabels).getFinalResult();\n System.out.printf(\"Model Id: %s%n\", customFormModel.getModelId());\n System.out.printf(\"Model Status: %s%n\", customFormModel.getModelStatus());\n customFormModel.getSubmodels()\n .forEach(customFormSubmodel -> customFormSubmodel.getFields()\n .forEach((key, customFormModelField) ->\n System.out.printf(\"Form Type: %s Field Text: %s Field Accuracy: %f%n\",\n key, customFormModelField.getName(), customFormModelField.getAccuracy())));\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the training model operation until it has completed, has failed, or has\n been cancelled. The completed operation returns the trained <xref uid=\"com.azure.ai.formrecognizer.training.models.CustomFormModel\" data-throw-if-not-resolved=\"false\" data-raw-source=\"custom form model\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.formrecognizer.models.FormRecognizerOperationResult?alt=com.azure.ai.formrecognizer.models.FormRecognizerOperationResult&text=FormRecognizerOperationResult\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.formrecognizer.training.models.CustomFormModel?alt=com.azure.ai.formrecognizer.training.models.CustomFormModel&text=CustomFormModel\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.formrecognizer.training.FormTrainingClient.beginTraining(java.lang.String,boolean,com.azure.ai.formrecognizer.training.models.TrainingOptions,com.azure.core.util.Context)"
fullName: "com.azure.ai.formrecognizer.training.FormTrainingClient.beginTraining(String trainingFilesUrl, boolean useTrainingLabels, TrainingOptions trainingOptions, Context context)"
name: "beginTraining(String trainingFilesUrl, boolean useTrainingLabels, TrainingOptions trainingOptions, Context context)"
nameWithType: "FormTrainingClient.beginTraining(String trainingFilesUrl, boolean useTrainingLabels, TrainingOptions trainingOptions, Context context)"
summary: "Create and train a custom model."
parameters:
- description: "an externally accessible Azure storage blob container Uri (preferably a\n Shared Access Signature Uri).\n For instructions on setting up forms for training in an Azure Storage Blob Container, see\n <a href=\"https://docs.microsoft.com/azure/cognitive-services/form-recognizer/build-training-data-set#upload-your-training-data\">here</a>."
name: "trainingFilesUrl"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "boolean to specify the use of labeled files for training the model."
name: "useTrainingLabels"
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- description: "The additional configurable <xref uid=\"com.azure.ai.formrecognizer.training.models.TrainingOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref>\n that may be passed when training a model."
name: "trainingOptions"
type: "<xref href=\"com.azure.ai.formrecognizer.training.models.TrainingOptions?alt=com.azure.ai.formrecognizer.training.models.TrainingOptions&text=TrainingOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional context that is passed through the HTTP pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public SyncPoller<FormRecognizerOperationResult,CustomFormModel> beginTraining(String trainingFilesUrl, boolean useTrainingLabels, TrainingOptions trainingOptions, Context context)"
desc: "Create and train a custom model. 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.\n\nThe service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.\n\n**Code sample**\n\n```java\nString trainingFilesUrl = \"{SAS-URL-of-your-container-in-blob-storage}\";\n TrainingFileFilter trainingFileFilter = new TrainingFileFilter().setSubfoldersIncluded(false).setPrefix(\"Invoice\");\n boolean useTrainingLabels = true;\n\n CustomFormModel customFormModel = formTrainingClient.beginTraining(trainingFilesUrl, useTrainingLabels,\n new TrainingOptions()\n .setTrainingFileFilter(trainingFileFilter)\n .setPollInterval(Duration.ofSeconds(5)), Context.NONE)\n .getFinalResult();\n\n System.out.printf(\"Model Id: %s%n\", customFormModel.getModelId());\n System.out.printf(\"Model Status: %s%n\", customFormModel.getModelStatus());\n customFormModel.getSubmodels()\n .forEach(customFormSubmodel -> customFormSubmodel.getFields()\n .forEach((key, customFormModelField) ->\n System.out.printf(\"Form Type: %s Field Text: %s Field Accuracy: %f%n\",\n key, customFormModelField.getName(), customFormModelField.getAccuracy())));\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.SyncPoller\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SyncPoller\"></xref> that polls the training model operation until it has completed, has failed, or has\n been cancelled. The completed operation returns the trained <xref uid=\"com.azure.ai.formrecognizer.training.models.CustomFormModel\" data-throw-if-not-resolved=\"false\" data-raw-source=\"custom form model\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.SyncPoller?alt=com.azure.core.util.polling.SyncPoller&text=SyncPoller\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.formrecognizer.models.FormRecognizerOperationResult?alt=com.azure.ai.formrecognizer.models.FormRecognizerOperationResult&text=FormRecognizerOperationResult\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.formrecognizer.training.models.CustomFormModel?alt=com.azure.ai.formrecognizer.training.models.CustomFormModel&text=CustomFormModel\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.formrecognizer.training.FormTrainingClient.deleteModel(java.lang.String)"
fullName: "com.azure.ai.formrecognizer.training.FormTrainingClient.deleteModel(String modelId)"
name: "deleteModel(String modelId)"
nameWithType: "FormTrainingClient.deleteModel(String modelId)"
summary: "Deletes the specified custom model."
parameters:
- description: "The UUID string format model identifier."
name: "modelId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public void deleteModel(String modelId)"
desc: "Deletes the specified custom model.\n\n**Code sample**\n\n```java\nString modelId = \"{model_id}\";\n formTrainingClient.deleteModel(modelId);\n System.out.printf(\"Model Id: %s is deleted.%n\", modelId);\n```"
- uid: "com.azure.ai.formrecognizer.training.FormTrainingClient.deleteModelWithResponse(java.lang.String,com.azure.core.util.Context)"
fullName: "com.azure.ai.formrecognizer.training.FormTrainingClient.deleteModelWithResponse(String modelId, Context context)"
name: "deleteModelWithResponse(String modelId, Context context)"
nameWithType: "FormTrainingClient.deleteModelWithResponse(String modelId, Context context)"
summary: "Deletes the specified custom model."
parameters:
- description: "The UUID string format model identifier."
name: "modelId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<Void> deleteModelWithResponse(String modelId, Context context)"
desc: "Deletes the specified custom model.\n\n**Code sample**\n\n```java\nString modelId = \"{model_id}\";\n Response<Void> response = formTrainingClient.deleteModelWithResponse(modelId, Context.NONE);\n System.out.printf(\"Response Status Code: %d.\", response.getStatusCode());\n System.out.printf(\"Model Id: %s is deleted.%n\", modelId);\n```"
returns:
description: "A <xref uid=\"com.azure.core.http.rest.Response\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Response\"></xref> containing status code and HTTP headers."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html\">Void</a>&gt;"
- uid: "com.azure.ai.formrecognizer.training.FormTrainingClient.getAccountProperties()"
fullName: "com.azure.ai.formrecognizer.training.FormTrainingClient.getAccountProperties()"
name: "getAccountProperties()"
nameWithType: "FormTrainingClient.getAccountProperties()"
summary: "Get account information of the form recognizer account."
syntax: "public AccountProperties getAccountProperties()"
desc: "Get account information of the form recognizer account.\n\n**Code sample**\n\n```java\nAccountProperties accountProperties = formTrainingClient.getAccountProperties();\n System.out.printf(\"Max number of models that can be trained for this account: %d%n\",\n accountProperties.getCustomModelLimit());\n System.out.printf(\"Current count of trained custom models: %d%n\", accountProperties.getCustomModelCount());\n```"
returns:
description: "The requested account information of the form recognizer account."
type: "<xref href=\"com.azure.ai.formrecognizer.training.models.AccountProperties?alt=com.azure.ai.formrecognizer.training.models.AccountProperties&text=AccountProperties\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.formrecognizer.training.FormTrainingClient.getAccountPropertiesWithResponse(com.azure.core.util.Context)"
fullName: "com.azure.ai.formrecognizer.training.FormTrainingClient.getAccountPropertiesWithResponse(Context context)"
name: "getAccountPropertiesWithResponse(Context context)"
nameWithType: "FormTrainingClient.getAccountPropertiesWithResponse(Context context)"
summary: "Get account information of the form recognizer account with an Http response and a specified <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref>."
parameters:
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<AccountProperties> getAccountPropertiesWithResponse(Context context)"
desc: "Get account information of the form recognizer account with an Http response and a specified <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref>.\n\n**Code sample**\n\n```java\nResponse<AccountProperties> response = formTrainingClient.getAccountPropertiesWithResponse(Context.NONE);\n System.out.printf(\"Response Status Code: %d.\", response.getStatusCode());\n AccountProperties accountProperties = response.getValue();\n System.out.printf(\"Max number of models that can be trained for this account: %s%n\",\n accountProperties.getCustomModelLimit());\n System.out.printf(\"Current count of trained custom models: %d%n\", accountProperties.getCustomModelCount());\n```"
returns:
description: "The requested account information of the form recognizer account."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.formrecognizer.training.models.AccountProperties?alt=com.azure.ai.formrecognizer.training.models.AccountProperties&text=AccountProperties\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.formrecognizer.training.FormTrainingClient.getCopyAuthorization(java.lang.String,java.lang.String)"
fullName: "com.azure.ai.formrecognizer.training.FormTrainingClient.getCopyAuthorization(String resourceId, String resourceRegion)"
name: "getCopyAuthorization(String resourceId, String resourceRegion)"
nameWithType: "FormTrainingClient.getCopyAuthorization(String resourceId, String resourceRegion)"
summary: "Generate authorization for copying a custom model into the target Form Recognizer resource."
parameters:
- description: "Azure Resource Id of the target Form Recognizer resource where the model will be copied to.\n This information can be found in the 'Properties' section of the Form Recognizer resource in the Azure Portal."
name: "resourceId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Location of the target Form Recognizer resource. A valid Azure region name supported\n by Cognitive Services. This information can be found in the 'Keys and Endpoint' section of the Form Recognizer\n resource in the Azure Portal.\n\n <p><strong>Code sample</strong></p>\n <!-- src_embed com.azure.ai.formrecognizer.v3.training.FormTrainingClient.getCopyAuthorization#string-string -->\n <pre>\n String resourceId = &quot;target-resource-Id&quot;;\n String resourceRegion = &quot;target-resource-region&quot;;\n CopyAuthorization copyAuthorization = formTrainingClient.getCopyAuthorization&#40;resourceId, resourceRegion&#41;;\n System.out.printf&#40;&quot;Copy Authorization for model id: %s, access token: %s, expiration time: %s, &quot;\n + &quot;target resource Id; %s, target resource region: %s%n&quot;,\n copyAuthorization.getModelId&#40;&#41;,\n copyAuthorization.getAccessToken&#40;&#41;,\n copyAuthorization.getExpiresOn&#40;&#41;,\n copyAuthorization.getResourceId&#40;&#41;,\n copyAuthorization.getResourceRegion&#40;&#41;\n &#41;;\n </pre>\n <!-- end com.azure.ai.formrecognizer.v3.training.FormTrainingClient.getCopyAuthorization#string-string -->"
name: "resourceRegion"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public CopyAuthorization getCopyAuthorization(String resourceId, String resourceRegion)"
desc: "Generate authorization for copying a custom model into the target Form Recognizer resource."
returns:
description: "The <xref uid=\"com.azure.ai.formrecognizer.training.models.CopyAuthorization\" data-throw-if-not-resolved=\"false\" data-raw-source=\"CopyAuthorization\"></xref>"
type: "<xref href=\"com.azure.ai.formrecognizer.training.models.CopyAuthorization?alt=com.azure.ai.formrecognizer.training.models.CopyAuthorization&text=CopyAuthorization\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.formrecognizer.training.FormTrainingClient.getCopyAuthorizationWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)"
fullName: "com.azure.ai.formrecognizer.training.FormTrainingClient.getCopyAuthorizationWithResponse(String resourceId, String resourceRegion, Context context)"
name: "getCopyAuthorizationWithResponse(String resourceId, String resourceRegion, Context context)"
nameWithType: "FormTrainingClient.getCopyAuthorizationWithResponse(String resourceId, String resourceRegion, Context context)"
summary: "Generate authorization for copying a custom model into the target Form Recognizer resource."
parameters:
- description: "Azure Resource Id of the target Form Recognizer resource where the model will be copied to.\n This information can be found in the 'Properties' section of the Form Recognizer resource in the Azure Portal."
name: "resourceId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Location of the target Form Recognizer resource. A valid Azure region name supported by\n Cognitive Services.This information can be found in the 'Keys and Endpoint' section of the Form Recognizer\n resource in the Azure Portal."
name: "resourceRegion"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Additional context that is passed through the Http pipeline during the service call.\n\n <p><strong>Code sample</strong></p>\n <!-- src_embed com.azure.ai.formrecognizer.v3.training.FormTrainingClient.getCopyAuthorizationWithResponse#string-string-Context -->\n <pre>\n String resourceId = &quot;target-resource-Id&quot;;\n String resourceRegion = &quot;target-resource-region&quot;;\n Response&lt;CopyAuthorization&gt; copyAuthorizationResponse =\n formTrainingClient.getCopyAuthorizationWithResponse&#40;resourceId, resourceRegion, Context.NONE&#41;;\n System.out.printf&#40;&quot;Copy Authorization operation returned with status: %s&quot;,\n copyAuthorizationResponse.getStatusCode&#40;&#41;&#41;;\n CopyAuthorization copyAuthorization = copyAuthorizationResponse.getValue&#40;&#41;;\n System.out.printf&#40;&quot;Copy model id: %s, access token: %s, expiration time: %s, &quot;\n + &quot;target resource Id; %s, target resource region: %s%n&quot;,\n copyAuthorization.getModelId&#40;&#41;,\n copyAuthorization.getAccessToken&#40;&#41;,\n copyAuthorization.getExpiresOn&#40;&#41;,\n copyAuthorization.getResourceId&#40;&#41;,\n copyAuthorization.getResourceRegion&#40;&#41;\n &#41;;\n </pre>\n <!-- end com.azure.ai.formrecognizer.v3.training.FormTrainingClient.getCopyAuthorizationWithResponse#string-string-Context -->"
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<CopyAuthorization> getCopyAuthorizationWithResponse(String resourceId, String resourceRegion, Context context)"
desc: "Generate authorization for copying a custom model into the target Form Recognizer resource. This should be called by the target resource (where the model will be copied to) and the output can be passed as the target parameter into <xref uid=\"com.azure.ai.formrecognizer.training.FormTrainingAsyncClient.beginCopyModel(java.lang.String,com.azure.ai.formrecognizer.training.models.CopyAuthorization)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FormTrainingAsyncClient#beginCopyModel(String, CopyAuthorization)\"></xref>."
returns:
description: "A <xref uid=\"com.azure.core.http.rest.Response\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Response\"></xref> containing the <xref uid=\"com.azure.ai.formrecognizer.training.models.CopyAuthorization\" data-throw-if-not-resolved=\"false\" data-raw-source=\"CopyAuthorization\"></xref>"
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.formrecognizer.training.models.CopyAuthorization?alt=com.azure.ai.formrecognizer.training.models.CopyAuthorization&text=CopyAuthorization\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.formrecognizer.training.FormTrainingClient.getCustomModel(java.lang.String)"
fullName: "com.azure.ai.formrecognizer.training.FormTrainingClient.getCustomModel(String modelId)"
name: "getCustomModel(String modelId)"
nameWithType: "FormTrainingClient.getCustomModel(String modelId)"
summary: "Get detailed information for a specified custom model id."
parameters:
- description: "The UUID string format model identifier."
name: "modelId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public CustomFormModel getCustomModel(String modelId)"
desc: "Get detailed information for a specified custom model id.\n\n**Code sample**\n\n```java\nString modelId = \"{model_id}\";\n CustomFormModel customFormModel = formTrainingClient.getCustomModel(modelId);\n System.out.printf(\"Model Id: %s%n\", customFormModel.getModelId());\n System.out.printf(\"Model Status: %s%n\", customFormModel.getModelStatus());\n customFormModel.getSubmodels()\n .forEach(customFormSubmodel -> customFormSubmodel.getFields()\n .forEach((key, customFormModelField) ->\n System.out.printf(\"Form Type: %s Field Text: %s Field Accuracy: %f%n\",\n key, customFormModelField.getName(), customFormModelField.getAccuracy())));\n```"
returns:
description: "The detailed information for the specified model."
type: "<xref href=\"com.azure.ai.formrecognizer.training.models.CustomFormModel?alt=com.azure.ai.formrecognizer.training.models.CustomFormModel&text=CustomFormModel\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.formrecognizer.training.FormTrainingClient.getCustomModelWithResponse(java.lang.String,com.azure.core.util.Context)"
fullName: "com.azure.ai.formrecognizer.training.FormTrainingClient.getCustomModelWithResponse(String modelId, Context context)"
name: "getCustomModelWithResponse(String modelId, Context context)"
nameWithType: "FormTrainingClient.getCustomModelWithResponse(String modelId, Context context)"
summary: "Get detailed information for a specified custom model id."
parameters:
- description: "The UUID string format model identifier."
name: "modelId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<CustomFormModel> getCustomModelWithResponse(String modelId, Context context)"
desc: "Get detailed information for a specified custom model id.\n\n**Code sample**\n\n```java\nString modelId = \"{model_id}\";\n Response<CustomFormModel> response = formTrainingClient.getCustomModelWithResponse(modelId, Context.NONE);\n System.out.printf(\"Response Status Code: %d.\", response.getStatusCode());\n CustomFormModel customFormModel = response.getValue();\n System.out.printf(\"Model Id: %s%n\", customFormModel.getModelId());\n System.out.printf(\"Model Status: %s%n\", customFormModel.getModelStatus());\n customFormModel.getSubmodels()\n .forEach(customFormSubmodel -> customFormSubmodel.getFields()\n .forEach((key, customFormModelField) ->\n System.out.printf(\"Field: %s Field Text: %s Field Accuracy: %f%n\",\n key, customFormModelField.getName(), customFormModelField.getAccuracy())));\n```"
returns:
description: "The detailed information for the specified model."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.formrecognizer.training.models.CustomFormModel?alt=com.azure.ai.formrecognizer.training.models.CustomFormModel&text=CustomFormModel\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.formrecognizer.training.FormTrainingClient.getFormRecognizerClient()"
fullName: "com.azure.ai.formrecognizer.training.FormTrainingClient.getFormRecognizerClient()"
name: "getFormRecognizerClient()"
nameWithType: "FormTrainingClient.getFormRecognizerClient()"
summary: "Creates a new <xref uid=\"com.azure.ai.formrecognizer.FormRecognizerClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FormRecognizerClient\"></xref> object."
syntax: "public FormRecognizerClient getFormRecognizerClient()"
desc: "Creates a new <xref uid=\"com.azure.ai.formrecognizer.FormRecognizerClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FormRecognizerClient\"></xref> object. The new <xref uid=\"com.azure.ai.formrecognizer.training.FormTrainingClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FormTrainingClient\"></xref> uses the same request policy pipeline as the <xref uid=\"com.azure.ai.formrecognizer.training.FormTrainingClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FormTrainingClient\"></xref>."
returns:
description: "A new <xref uid=\"com.azure.ai.formrecognizer.FormRecognizerClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FormRecognizerClient\"></xref> object."
type: "<xref href=\"com.azure.ai.formrecognizer.FormRecognizerClient?alt=com.azure.ai.formrecognizer.FormRecognizerClient&text=FormRecognizerClient\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.ai.formrecognizer.training.FormTrainingClient.listCustomModels()"
fullName: "com.azure.ai.formrecognizer.training.FormTrainingClient.listCustomModels()"
name: "listCustomModels()"
nameWithType: "FormTrainingClient.listCustomModels()"
summary: "List information for each model on the form recognizer account."
syntax: "public PagedIterable<CustomFormModelInfo> listCustomModels()"
desc: "List information for each model on the form recognizer account.\n\n**Code sample**\n\n```java\nformTrainingClient.listCustomModels()\n .forEach(customModel ->\n System.out.printf(\"Model Id: %s, Model status: %s, Training started on: %s, Training completed on: %s.%n\",\n customModel.getModelId(),\n customModel.getStatus(),\n customModel.getTrainingStartedOn(),\n customModel.getTrainingCompletedOn())\n );\n```"
returns:
description: "<xref uid=\"com.azure.core.http.rest.PagedIterable\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of <xref uid=\"com.azure.ai.formrecognizer.training.models.CustomFormModelInfo\" data-throw-if-not-resolved=\"false\" data-raw-source=\"CustomFormModelInfo\"></xref> custom form model information."
type: "<xref href=\"com.azure.core.http.rest.PagedIterable?alt=com.azure.core.http.rest.PagedIterable&text=PagedIterable\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.formrecognizer.training.models.CustomFormModelInfo?alt=com.azure.ai.formrecognizer.training.models.CustomFormModelInfo&text=CustomFormModelInfo\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.ai.formrecognizer.training.FormTrainingClient.listCustomModels(com.azure.core.util.Context)"
fullName: "com.azure.ai.formrecognizer.training.FormTrainingClient.listCustomModels(Context context)"
name: "listCustomModels(Context context)"
nameWithType: "FormTrainingClient.listCustomModels(Context context)"
summary: "List information for each model on the form recognizer account with an Http response and a specified <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref>."
parameters:
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public PagedIterable<CustomFormModelInfo> listCustomModels(Context context)"
desc: "List information for each model on the form recognizer account with an Http response and a specified <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref>.\n\n**Code sample**\n\n```java\nformTrainingClient.listCustomModels(Context.NONE)\n .forEach(customModel ->\n System.out.printf(\"Model Id: %s, Model status: %s, Training started on: %s, Training completed on: %s.%n\",\n customModel.getModelId(),\n customModel.getStatus(),\n customModel.getTrainingStartedOn(),\n customModel.getTrainingCompletedOn())\n );\n```"
returns:
description: "<xref uid=\"com.azure.core.http.rest.PagedIterable\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PagedIterable\"></xref> of <xref uid=\"com.azure.ai.formrecognizer.training.models.CustomFormModelInfo\" data-throw-if-not-resolved=\"false\" data-raw-source=\"CustomFormModelInfo\"></xref> custom form model information."
type: "<xref href=\"com.azure.core.http.rest.PagedIterable?alt=com.azure.core.http.rest.PagedIterable&text=PagedIterable\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.ai.formrecognizer.training.models.CustomFormModelInfo?alt=com.azure.ai.formrecognizer.training.models.CustomFormModelInfo&text=CustomFormModelInfo\" data-throw-if-not-resolved=\"False\" />&gt;"
type: "class"
desc: "This class provides a synchronous client to connect to the Form Recognizer Azure Cognitive Service.\n\nThis client provides synchronous methods to:\n\n1. Train a custom model: Train a custom model to analyze and extract data from forms and documents specific to your business using the <xref uid=\"com.azure.ai.formrecognizer.training.FormTrainingClient.beginTraining(java.lang.String,boolean)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"beginTraining\"></xref> method.\n2. Copy custom model: Copy a custom Form Recognizer model to a target Form Recognizer resource using the <xref uid=\"com.azure.ai.formrecognizer.training.FormTrainingClient.beginCopyModel(java.lang.String,com.azure.ai.formrecognizer.training.models.CopyAuthorization)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"beginCopyModel\"></xref> method.\n3. List custom models: Get information about all custom models using the <xref uid=\"com.azure.ai.formrecognizer.training.FormTrainingClient.getCustomModel(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"getCustomModel\"></xref> and <xref uid=\"com.azure.ai.formrecognizer.training.FormTrainingClient.listCustomModels()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"listCustomModels\"></xref> methods respectively.\n4. Polling and Callbacks: It includes mechanisms for polling the service to check the status of an analysis operation or registering callbacks to receive notifications when the analysis is complete.\n\n**Note:** This client only supports <xref uid=\"com.azure.ai.formrecognizer.FormRecognizerServiceVersion.V2_1\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FormRecognizerServiceVersion#V2_1\"></xref> and lower. Recommended to use a newer service version, <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.administration.DocumentModelAdministrationAsyncClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"DocumentModelAdministrationAsyncClient\"></xref> and <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.administration.DocumentModelAdministrationClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"DocumentModelAdministrationClient\"></xref>.\n\n**Refer to the [Migration guide][] to use API versions 2022-08-31 and up.**\n\nService clients are the point of interaction for developers to use Azure Form Recognizer. <xref uid=\"com.azure.ai.formrecognizer.training.FormTrainingClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FormTrainingClient\"></xref> is the synchronous service client and <xref uid=\"com.azure.ai.formrecognizer.training.FormTrainingAsyncClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FormTrainingAsyncClient\"></xref> is the asynchronous service client. The examples shown in this document use a credential object named DefaultAzureCredential for authentication, which is appropriate for most scenarios, including local development and production environments. Additionally, we recommend using [managed identity][] for authentication in production environments. You can find more information on different ways of authenticating and their corresponding credential types in the [Azure Identity documentation\"][Azure Identity documentation].\n\n**Sample: Construct a FormTrainingClient with DefaultAzureCredential**\n\nThe following code sample demonstrates the creation of a <xref uid=\"com.azure.ai.formrecognizer.training.FormTrainingClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"FormTrainingClient\"></xref>, using the \\`DefaultAzureCredentialBuilder\\` to configure it.\n\n```java\nFormTrainingClient client = new FormTrainingClientBuilder()\n .endpoint(\"{endpoint}\")\n .credential(new DefaultAzureCredentialBuilder().build())\n .buildClient();\n```\n\nFurther, see the code sample below to use <xref uid=\"com.azure.core.credential.AzureKeyCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AzureKeyCredential\"></xref> for client creation.\n\n```java\nFormTrainingClient formTrainingClient = new FormTrainingClientBuilder()\n .credential(new AzureKeyCredential(\"{key}\"))\n .endpoint(\"{endpoint}\")\n .buildClient();\n```\n\n\n[Migration guide]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/formrecognizer/azure-ai-formrecognizer/migration-guide.md\n[managed identity]: https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/\n[Azure Identity documentation]: https://learn.microsoft.com/java/api/overview/azure/identity-readme"
metadata: {}
package: "com.azure.ai.formrecognizer.training"
artifact: com.azure:azure-ai-formrecognizer:4.1.11