-
Notifications
You must be signed in to change notification settings - Fork 223
/
com.azure.ai.formrecognizer.training.FormTrainingClient.yml
297 lines (297 loc) · 53.1 KB
/
com.azure.ai.formrecognizer.training.FormTrainingClient.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
### 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\" /><<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\" />>"
- 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\" /><<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\" />>"
- 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><<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>>"
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\" /><<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\" />>"
- 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><<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>>"
- 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\" /><<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\" />>"
- 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\" /><<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\" />>"
- 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\" /><<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\" />>"
- 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\" /><<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html\">Void</a>>"
- 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\" /><<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.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 = "target-resource-Id";\n String resourceRegion = "target-resource-region";\n CopyAuthorization copyAuthorization = formTrainingClient.getCopyAuthorization(resourceId, resourceRegion);\n System.out.printf("Copy Authorization for model id: %s, access token: %s, expiration time: %s, "\n + "target resource Id; %s, target resource region: %s%n",\n copyAuthorization.getModelId(),\n copyAuthorization.getAccessToken(),\n copyAuthorization.getExpiresOn(),\n copyAuthorization.getResourceId(),\n copyAuthorization.getResourceRegion()\n );\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 = "target-resource-Id";\n String resourceRegion = "target-resource-region";\n Response<CopyAuthorization> copyAuthorizationResponse =\n formTrainingClient.getCopyAuthorizationWithResponse(resourceId, resourceRegion, Context.NONE);\n System.out.printf("Copy Authorization operation returned with status: %s",\n copyAuthorizationResponse.getStatusCode());\n CopyAuthorization copyAuthorization = copyAuthorizationResponse.getValue();\n System.out.printf("Copy model id: %s, access token: %s, expiration time: %s, "\n + "target resource Id; %s, target resource region: %s%n",\n copyAuthorization.getModelId(),\n copyAuthorization.getAccessToken(),\n copyAuthorization.getExpiresOn(),\n copyAuthorization.getResourceId(),\n copyAuthorization.getResourceRegion()\n );\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\" /><<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.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\" /><<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.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\" /><<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\" />>"
- 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\" /><<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\" />>"
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*\" 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=\"com.azure.ai.formrecognizer.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=\"com.azure.ai.formrecognizer.documentanalysis.administration.DocumentModelAdministrationAsyncClient\"></xref> and <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.administration.DocumentModelAdministrationClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.ai.formrecognizer.documentanalysis.administration.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=\"com.azure.ai.formrecognizer.training.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=\"com.azure.ai.formrecognizer.training.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=\"com.azure.ai.formrecognizer.training.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.8