-
Notifications
You must be signed in to change notification settings - Fork 255
/
com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.yml
137 lines (137 loc) · 31.9 KB
/
com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.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
### YamlMime:JavaType
uid: "com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient"
fullName: "com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient"
name: "DocumentAnalysisAsyncClient"
nameWithType: "DocumentAnalysisAsyncClient"
summary: "This class provides an asynchronous 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 **DocumentAnalysisAsyncClient**"
methods:
- uid: "com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.beginAnalyzeDocument(java.lang.String,com.azure.core.util.BinaryData)"
fullName: "com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.beginAnalyzeDocument(String modelId, BinaryData document)"
name: "beginAnalyzeDocument(String modelId, BinaryData document)"
nameWithType: "DocumentAnalysisAsyncClient.beginAnalyzeDocument(String modelId, BinaryData document)"
summary: "Analyzes data from documents with optical character recognition (OCR) and semantic values from a given document using any of the prebuilt models or a custom-built analysis model."
parameters:
- description: "The unique model ID to be used. Use this to specify the custom model ID or prebuilt model ID.\n Prebuilt model IDs supported can be found <a href=\"https://aka.ms/azsdk/formrecognizer/models\">here</a>"
name: "modelId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The data of the document to analyze information from."
name: "document"
type: "<xref href=\"com.azure.core.util.BinaryData?alt=com.azure.core.util.BinaryData&text=BinaryData\" data-throw-if-not-resolved=\"False\" />"
syntax: "public PollerFlux<OperationResult,AnalyzeResult> beginAnalyzeDocument(String modelId, BinaryData document)"
desc: "Analyzes data from documents with optical character recognition (OCR) and semantic values from a given document using any of the prebuilt models or a custom-built analysis model.\n\nThe service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.\n\nNote that the `data` passed must be replayable if retries are enabled (the default). In other words, the `Flux` must produce the same data each time it is subscribed to.\n\n**Code sample**\n\nAnalyze a document.\n\n```java\nFile document = new File(\"{local/file_path/fileName.jpg}\");\n String modelId = \"{model_id}\";\n // Utility method to convert input stream to Binary Data\n BinaryData buffer = BinaryData.fromStream(new ByteArrayInputStream(Files.readAllBytes(document.toPath())));\n\n documentAnalysisAsyncClient.beginAnalyzeDocument(modelId, buffer)\n // if polling operation completed, retrieve the final result.\n .flatMap(AsyncPollResponse::getFinalResult)\n .subscribe(analyzeResult ->\n analyzeResult.getDocuments()\n .forEach(analyzedDocument ->\n analyzedDocument.getFields()\n .forEach((key, documentField) -> {\n System.out.printf(\"Field text: %s%n\", key);\n System.out.printf(\"Field value data content: %s%n\", documentField.getContent());\n System.out.printf(\"Confidence score: %.2f%n\", documentField.getConfidence());\n })));\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.PollerFlux\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PollerFlux\"></xref> that polls the progress of the analyze document operation until it has completed,\n has failed, or has been cancelled. The completed operation returns an <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeResult\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.PollerFlux?alt=com.azure.core.util.polling.PollerFlux&text=PollerFlux\" data-throw-if-not-resolved=\"False\" /><<xref href=\"com.azure.ai.formrecognizer.documentanalysis.models.OperationResult?alt=com.azure.ai.formrecognizer.documentanalysis.models.OperationResult&text=OperationResult\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult?alt=com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult&text=AnalyzeResult\" data-throw-if-not-resolved=\"False\" />>"
- uid: "com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.beginAnalyzeDocument(java.lang.String,com.azure.core.util.BinaryData,com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeDocumentOptions)"
fullName: "com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.beginAnalyzeDocument(String modelId, BinaryData document, AnalyzeDocumentOptions analyzeDocumentOptions)"
name: "beginAnalyzeDocument(String modelId, BinaryData document, AnalyzeDocumentOptions analyzeDocumentOptions)"
nameWithType: "DocumentAnalysisAsyncClient.beginAnalyzeDocument(String modelId, BinaryData document, AnalyzeDocumentOptions analyzeDocumentOptions)"
summary: "Analyzes data from documents with optical character recognition (OCR) and semantic values from a given document using any of the prebuilt models or a custom-built analysis model."
parameters:
- description: "The unique model ID to be used. Use this to specify the custom model ID or prebuilt model ID.\n Prebuilt model IDs supported can be found <a href=\"https://aka.ms/azsdk/formrecognizer/models\">here</a>"
name: "modelId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The data of the document to analyze information from."
name: "document"
type: "<xref href=\"com.azure.core.util.BinaryData?alt=com.azure.core.util.BinaryData&text=BinaryData\" data-throw-if-not-resolved=\"False\" />"
- description: "The additional configurable <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeDocumentOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref> that may be\n passed when analyzing documents."
name: "analyzeDocumentOptions"
type: "<xref href=\"com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeDocumentOptions?alt=com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeDocumentOptions&text=AnalyzeDocumentOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public PollerFlux<OperationResult,AnalyzeResult> beginAnalyzeDocument(String modelId, BinaryData document, AnalyzeDocumentOptions analyzeDocumentOptions)"
desc: "Analyzes data from documents with optical character recognition (OCR) and semantic values from a given document using any of the prebuilt models or a custom-built analysis model.\n\nThe service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.\n\nNote that the `data` passed must be replayable if retries are enabled (the default). In other words, the `Flux` must produce the same data each time it is subscribed to.\n\n**Code sample**\n\nAnalyze a document with configurable options. .\n\n```java\nFile document = new File(\"{local/file_path/fileName.jpg}\");\n String modelId = \"{model_id}\";\n final AnalyzeDocumentOptions analyzeDocumentOptions =\n new AnalyzeDocumentOptions().setPages(Arrays.asList(\"1\", \"3\")).setDocumentAnalysisFeatures(\n Collections.singletonList(\n DocumentAnalysisFeature.FORMULAS));\n\n // Utility method to convert input stream to Binary Data\n BinaryData buffer = BinaryData.fromStream(new ByteArrayInputStream(Files.readAllBytes(document.toPath())));\n\n documentAnalysisAsyncClient.beginAnalyzeDocument(modelId, buffer, analyzeDocumentOptions)\n // if polling operation completed, retrieve the final result.\n .flatMap(AsyncPollResponse::getFinalResult)\n .subscribe(analyzeResult -> {\n System.out.println(analyzeResult.getModelId());\n analyzeResult.getDocuments()\n .forEach(analyzedDocument ->\n analyzedDocument.getFields()\n .forEach((key, documentField) -> {\n System.out.printf(\"Field text: %s%n\", key);\n System.out.printf(\"Field value data content: %s%n\", documentField.getContent());\n System.out.printf(\"Confidence score: %.2f%n\", documentField.getConfidence());\n }));\n });\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.PollerFlux\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PollerFlux\"></xref> that polls the progress of the analyze document operation until it has completed,\n has failed, or has been cancelled. The completed operation returns an <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeResult\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.PollerFlux?alt=com.azure.core.util.polling.PollerFlux&text=PollerFlux\" data-throw-if-not-resolved=\"False\" /><<xref href=\"com.azure.ai.formrecognizer.documentanalysis.models.OperationResult?alt=com.azure.ai.formrecognizer.documentanalysis.models.OperationResult&text=OperationResult\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult?alt=com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult&text=AnalyzeResult\" data-throw-if-not-resolved=\"False\" />>"
- uid: "com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.beginAnalyzeDocumentFromUrl(java.lang.String,java.lang.String)"
fullName: "com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.beginAnalyzeDocumentFromUrl(String modelId, String documentUrl)"
name: "beginAnalyzeDocumentFromUrl(String modelId, String documentUrl)"
nameWithType: "DocumentAnalysisAsyncClient.beginAnalyzeDocumentFromUrl(String modelId, String documentUrl)"
summary: "Analyzes data from documents with optical character recognition (OCR) and semantic values from a given document using any of the prebuilt models or a custom-built analysis model."
parameters:
- description: "The unique model ID to be used. Use this to specify the custom model ID or prebuilt model ID.\n Prebuilt model IDs supported can be found <a href=\"https://aka.ms/azsdk/formrecognizer/models\">here</a>"
name: "modelId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The URL of the document to analyze."
name: "documentUrl"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public PollerFlux<OperationResult,AnalyzeResult> beginAnalyzeDocumentFromUrl(String modelId, String documentUrl)"
desc: "Analyzes data from documents with optical character recognition (OCR) and semantic values from a given document using any of the prebuilt models or a custom-built analysis model.\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\nAnalyze a document using the URL of the document.\n\n```java\nString documentUrl = \"{document_url}\";\n String modelId = \"{model_id}\";\n documentAnalysisAsyncClient.beginAnalyzeDocumentFromUrl(modelId, documentUrl)\n // if polling operation completed, retrieve the final result.\n .flatMap(AsyncPollResponse::getFinalResult)\n .subscribe(analyzeResult ->\n analyzeResult.getDocuments()\n .forEach(document ->\n document.getFields()\n .forEach((key, documentField) -> {\n System.out.printf(\"Field text: %s%n\", key);\n System.out.printf(\"Field value data content: %s%n\", documentField.getContent());\n System.out.printf(\"Confidence score: %.2f%n\", documentField.getConfidence());\n })));\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.PollerFlux\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PollerFlux\"></xref> that polls the progress of the analyze document operation until it has completed, has failed,\n or has been cancelled. The completed operation returns an <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeResult\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.PollerFlux?alt=com.azure.core.util.polling.PollerFlux&text=PollerFlux\" data-throw-if-not-resolved=\"False\" /><<xref href=\"com.azure.ai.formrecognizer.documentanalysis.models.OperationResult?alt=com.azure.ai.formrecognizer.documentanalysis.models.OperationResult&text=OperationResult\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult?alt=com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult&text=AnalyzeResult\" data-throw-if-not-resolved=\"False\" />>"
- uid: "com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.beginAnalyzeDocumentFromUrl(java.lang.String,java.lang.String,com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeDocumentOptions)"
fullName: "com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.beginAnalyzeDocumentFromUrl(String modelId, String documentUrl, AnalyzeDocumentOptions analyzeDocumentOptions)"
name: "beginAnalyzeDocumentFromUrl(String modelId, String documentUrl, AnalyzeDocumentOptions analyzeDocumentOptions)"
nameWithType: "DocumentAnalysisAsyncClient.beginAnalyzeDocumentFromUrl(String modelId, String documentUrl, AnalyzeDocumentOptions analyzeDocumentOptions)"
summary: "Analyzes data from documents with optical character recognition (OCR) and semantic values from a given document using any of the prebuilt models or a custom-built analysis model."
parameters:
- description: "The unique model ID to be used. Use this to specify the custom model ID or prebuilt model ID.\n Prebuilt model IDs supported can be found <a href=\"https://aka.ms/azsdk/formrecognizer/models\">here</a>"
name: "modelId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The source URL to the input form."
name: "documentUrl"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The additional configurable <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeDocumentOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref>\n that may be passed when analyzing documents."
name: "analyzeDocumentOptions"
type: "<xref href=\"com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeDocumentOptions?alt=com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeDocumentOptions&text=AnalyzeDocumentOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public PollerFlux<OperationResult,AnalyzeResult> beginAnalyzeDocumentFromUrl(String modelId, String documentUrl, AnalyzeDocumentOptions analyzeDocumentOptions)"
desc: "Analyzes data from documents with optical character recognition (OCR) and semantic values from a given document using any of the prebuilt models or a custom-built analysis model.\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\nAnalyze a document using the URL of the document with configurable options.\n\n```java\nString documentUrl = \"{document_url}\";\n // analyze a receipt using prebuilt model\n String modelId = \"prebuilt-receipt\";\n\n documentAnalysisAsyncClient.beginAnalyzeDocumentFromUrl(modelId, documentUrl,\n new AnalyzeDocumentOptions().setPages(Arrays.asList(\"1\", \"3\")))\n // if polling operation completed, retrieve the final result.\n .flatMap(AsyncPollResponse::getFinalResult)\n .subscribe(analyzeResult -> {\n System.out.println(analyzeResult.getModelId());\n analyzeResult.getDocuments()\n .forEach(document ->\n document.getFields()\n .forEach((key, documentField) -> {\n System.out.printf(\"Field text: %s%n\", key);\n System.out.printf(\"Field value data content: %s%n\", documentField.getContent());\n System.out.printf(\"Confidence score: %.2f%n\", documentField.getConfidence());\n }));\n });\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.PollerFlux\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PollerFlux\"></xref> that polls progress of the analyze document operation until it has completed,\n has failed, or has been cancelled. The completed operation returns an <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeResult\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.PollerFlux?alt=com.azure.core.util.polling.PollerFlux&text=PollerFlux\" data-throw-if-not-resolved=\"False\" /><<xref href=\"com.azure.ai.formrecognizer.documentanalysis.models.OperationResult?alt=com.azure.ai.formrecognizer.documentanalysis.models.OperationResult&text=OperationResult\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult?alt=com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult&text=AnalyzeResult\" data-throw-if-not-resolved=\"False\" />>"
- uid: "com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.beginClassifyDocument(java.lang.String,com.azure.core.util.BinaryData)"
fullName: "com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.beginClassifyDocument(String classifierId, BinaryData document)"
name: "beginClassifyDocument(String classifierId, BinaryData document)"
nameWithType: "DocumentAnalysisAsyncClient.beginClassifyDocument(String classifierId, BinaryData document)"
summary: "Classify a given document using a document classifier."
parameters:
- description: "The unique classifier ID to be used. Use this to specify the custom classifier ID."
name: "classifierId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The data of the document to analyze information from. For service supported file types, see:\n <a href=\"https://aka.ms/azsdk/formrecognizer/supportedfiles\"></a>"
name: "document"
type: "<xref href=\"com.azure.core.util.BinaryData?alt=com.azure.core.util.BinaryData&text=BinaryData\" data-throw-if-not-resolved=\"False\" />"
syntax: "public PollerFlux<OperationResult,AnalyzeResult> beginClassifyDocument(String classifierId, BinaryData document)"
desc: "Classify a given document using a document classifier. For more information on how to build a custom classifier model, see \n\nThe service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.\n\nNote that the `data` passed must be replayable if retries are enabled (the default). In other words, the `Flux` must produce the same data each time it is subscribed to.\n\n**Code sample**\n\nAnalyze a document with configurable options.\n\n```java\nFile document = new File(\"{local/file_path/fileName.jpg}\");\n String classifierId = \"{model_id}\";\n\n // Utility method to convert input stream to Binary Data\n BinaryData buffer = BinaryData.fromStream(new ByteArrayInputStream(Files.readAllBytes(document.toPath())));\n\n documentAnalysisAsyncClient.beginClassifyDocument(classifierId, buffer)\n // if polling operation completed, retrieve the final result.\n .flatMap(AsyncPollResponse::getFinalResult)\n .subscribe(analyzeResult -> {\n System.out.println(analyzeResult.getModelId());\n analyzeResult.getDocuments()\n .forEach(analyzedDocument -> System.out.printf(\"Doc Type: %s%n\", analyzedDocument.getDocType()));\n });\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.PollerFlux\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PollerFlux\"></xref> that polls the progress of the analyze document operation until it has completed,\n has failed, or has been cancelled. The completed operation returns an <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeResult\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.PollerFlux?alt=com.azure.core.util.polling.PollerFlux&text=PollerFlux\" data-throw-if-not-resolved=\"False\" /><<xref href=\"com.azure.ai.formrecognizer.documentanalysis.models.OperationResult?alt=com.azure.ai.formrecognizer.documentanalysis.models.OperationResult&text=OperationResult\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult?alt=com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult&text=AnalyzeResult\" data-throw-if-not-resolved=\"False\" />>"
- uid: "com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.beginClassifyDocumentFromUrl(java.lang.String,java.lang.String)"
fullName: "com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.beginClassifyDocumentFromUrl(String classifierId, String documentUrl)"
name: "beginClassifyDocumentFromUrl(String classifierId, String documentUrl)"
nameWithType: "DocumentAnalysisAsyncClient.beginClassifyDocumentFromUrl(String classifierId, String documentUrl)"
summary: "Classify a given document using a document classifier."
parameters:
- description: "The unique classifier ID to be used. Use this to specify the custom classifier ID."
name: "classifierId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The URL of the document to analyze."
name: "documentUrl"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public PollerFlux<OperationResult,AnalyzeResult> beginClassifyDocumentFromUrl(String classifierId, String documentUrl)"
desc: "Classify a given document using a document classifier. For more information on how to build a custom classifier model, see \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\nAnalyze a document using the URL of the document.\n\n```java\nString documentUrl = \"{document_url}\";\n String classifierId = \"custom-trained-classifier-id\";\n\n documentAnalysisAsyncClient.beginClassifyDocumentFromUrl(classifierId, documentUrl)\n // if polling operation completed, retrieve the final result.\n .flatMap(AsyncPollResponse::getFinalResult)\n .subscribe(analyzeResult -> {\n System.out.println(analyzeResult.getModelId());\n analyzeResult.getDocuments()\n .forEach(analyzedDocument -> System.out.printf(\"Doc Type: %s%n\", analyzedDocument.getDocType()));\n });\n```"
returns:
description: "A <xref uid=\"com.azure.core.util.polling.PollerFlux\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PollerFlux\"></xref> that polls the progress of the analyze document operation until it has completed, has failed,\n or has been cancelled. The completed operation returns an <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AnalyzeResult\"></xref>."
type: "<xref href=\"com.azure.core.util.polling.PollerFlux?alt=com.azure.core.util.polling.PollerFlux&text=PollerFlux\" data-throw-if-not-resolved=\"False\" /><<xref href=\"com.azure.ai.formrecognizer.documentanalysis.models.OperationResult?alt=com.azure.ai.formrecognizer.documentanalysis.models.OperationResult&text=OperationResult\" data-throw-if-not-resolved=\"False\" />,<xref href=\"com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult?alt=com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult&text=AnalyzeResult\" data-throw-if-not-resolved=\"False\" />>"
type: "class"
desc: "This class provides an asynchronous client to connect to the Form Recognizer Azure Cognitive Service.\n\nThis client provides asynchronous methods to perform:\n\n1. Custom Document Analysis: Classification, extraction and analysis of data from forms and documents specific to distinct business data and use cases. Use the custom trained model by passing its modelId into the <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.beginAnalyzeDocument*\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient#beginAnalyzeDocument(String, BinaryData)\"></xref> method.\n2. General Document Analysis: Extract text, tables, structure, and key-value pairs. Use general document model provided by the Form Recognizer service by passing modelId=\"rebuilt-document\" into the <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.beginAnalyzeDocument*\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient#beginAnalyzeDocument(String, BinaryData)\"></xref> method.\n3. Prebuilt Model Analysis: Analyze receipts, business cards, invoices, ID's, W2's and other documents with [supported prebuilt models. Use the prebuilt receipt model provided by passing modelId=\"prebuilt-receipt\" into the <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.beginAnalyzeDocument*\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient#beginAnalyzeDocument(String, BinaryData)\"></xref> method.][supported prebuilt models. Use the prebuilt receipt model provided by passing modelId_prebuilt-receipt_ into the _xref uid_com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.beginAnalyzeDocument_ data-throw-if-not-resolved_false_ data-raw-source_com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient_beginAnalyzeDocument_String_ BinaryData_xref_ method.]\n4. Layout Analysis: Extract text, selection marks, and tables structures, along with their bounding box coordinates, from forms and documents. Use the layout analysis model provided the service by passing modelId=\"prebuilt-layout\" into the <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.beginAnalyzeDocument*\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient#beginAnalyzeDocument(String, BinaryData)\"></xref> method.\n5. 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\nThis client also provides different methods based on inputs from a URL and inputs from a stream.\n\n**Note:** This client only supports <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisServiceVersion.V2022_08_31\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisServiceVersion#V2022_08_31\"></xref> and newer. To use an older service version, <xref uid=\"com.azure.ai.formrecognizer.FormRecognizerClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.ai.formrecognizer.FormRecognizerClient\"></xref> and <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\".formrecognizer.training.FormTrainingClient\"></xref>.\n\nService clients are the point of interaction for developers to use Azure Form Recognizer. <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisClient\"></xref> is the synchronous service client and <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient\"></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 DocumentAnalysisAsyncClient with DefaultAzureCredential**\n\nThe following code sample demonstrates the creation of a <xref uid=\"com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient\"></xref>, using the \\`DefaultAzureCredentialBuilder\\` to configure it.\n\n```java\nDocumentAnalysisAsyncClient documentAnalysisAsyncClient = new DocumentAnalysisClientBuilder()\n .endpoint(\"{endpoint}\")\n .credential(new DefaultAzureCredentialBuilder().build())\n .buildAsyncClient();\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\nDocumentAnalysisAsyncClient documentAnalysisAsyncClient = new DocumentAnalysisClientBuilder()\n .credential(new AzureKeyCredential(\"{key}\"))\n .endpoint(\"{endpoint}\")\n .buildAsyncClient();\n```\n\n\n[supported prebuilt models. Use the prebuilt receipt model provided by passing modelId_prebuilt-receipt_ into the _xref uid_com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient.beginAnalyzeDocument_ data-throw-if-not-resolved_false_ data-raw-source_com.azure.ai.formrecognizer.documentanalysis.DocumentAnalysisAsyncClient_beginAnalyzeDocument_String_ BinaryData_xref_ method.]: https://aka.ms/azsdk/formrecognizer/models\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.documentanalysis"
artifact: com.azure:azure-ai-formrecognizer:4.1.9