forked from Azure/azure-docs-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeInvoicesFromUrl.yml
39 lines (39 loc) · 8.43 KB
/
com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeInvoicesFromUrl.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
### YamlMime:JavaMember
uid: "com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeInvoicesFromUrl*"
fullName: "com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeInvoicesFromUrl"
name: "beginRecognizeInvoicesFromUrl"
nameWithType: "FormRecognizerAsyncClient.beginRecognizeInvoicesFromUrl"
members:
- uid: "com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeInvoicesFromUrl(java.lang.String)"
fullName: "com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeInvoicesFromUrl(String invoiceUrl)"
name: "beginRecognizeInvoicesFromUrl(String invoiceUrl)"
nameWithType: "FormRecognizerAsyncClient.beginRecognizeInvoicesFromUrl(String invoiceUrl)"
summary: "Recognizes invoice data using optical character recognition (OCR) and a prebuilt invoice trained 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\nSee [here][] for fields found on a invoice.\n\n**Code sample**\n\n```java\nString invoiceUrl = \"invoice_url\";\n // if training polling operation completed, retrieve the final result.\n formRecognizerAsyncClient.beginRecognizeInvoicesFromUrl(invoiceUrl)\n .flatMap(AsyncPollResponse::getFinalResult)\n .subscribe(recognizedInvoices -> {\n for (int i = 0; i < recognizedInvoices.size(); i++) {\n RecognizedForm recognizedForm = recognizedInvoices.get(i);\n Map<String, FormField> recognizedFields = recognizedForm.getFields();\n FormField customAddrFormField = recognizedFields.get(\"CustomerAddress\");\n if (customAddrFormField != null) {\n if (FieldValueType.STRING == customAddrFormField.getValue().getValueType()) {\n System.out.printf(\"Customer Address: %s%n\", customAddrFormField.getValue().asString());\n }\n }\n FormField invoiceDateFormField = recognizedFields.get(\"InvoiceDate\");\n if (invoiceDateFormField != null) {\n if (FieldValueType.DATE == invoiceDateFormField.getValue().getValueType()) {\n LocalDate invoiceDate = invoiceDateFormField.getValue().asDate();\n System.out.printf(\"Invoice Date: %s, confidence: %.2f%n\",\n invoiceDate, invoiceDateFormField.getConfidence());\n }\n }\n }\n });\n```\n\n\n[here]: https://aka.ms/formrecognizer/invoicefields"
parameters:
- description: "The URL of the invoice to analyze."
name: "invoiceUrl"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
syntax: "public PollerFlux<FormRecognizerOperationResult,List<RecognizedForm>> beginRecognizeInvoicesFromUrl(String invoiceUrl)"
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 recognize invoice operation until it has completed, has failed,\n or has been cancelled. The completed operation returns a list of <xref uid=\"com.azure.ai.formrecognizer.models.RecognizedForm\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RecognizedForm\"></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.models.FormRecognizerOperationResult?alt=com.azure.ai.formrecognizer.models.FormRecognizerOperationResult&text=FormRecognizerOperationResult\" data-throw-if-not-resolved=\"False\" />,<xref href=\"java.util.List?alt=java.util.List&text=List\" data-throw-if-not-resolved=\"False\" /><<xref href=\"com.azure.ai.formrecognizer.models.RecognizedForm?alt=com.azure.ai.formrecognizer.models.RecognizedForm&text=RecognizedForm\" data-throw-if-not-resolved=\"False\" />>>"
- uid: "com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeInvoicesFromUrl(java.lang.String,com.azure.ai.formrecognizer.models.RecognizeInvoicesOptions)"
fullName: "com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeInvoicesFromUrl(String invoiceUrl, RecognizeInvoicesOptions recognizeInvoicesOptions)"
name: "beginRecognizeInvoicesFromUrl(String invoiceUrl, RecognizeInvoicesOptions recognizeInvoicesOptions)"
nameWithType: "FormRecognizerAsyncClient.beginRecognizeInvoicesFromUrl(String invoiceUrl, RecognizeInvoicesOptions recognizeInvoicesOptions)"
summary: "Recognizes invoice data using optical character recognition (OCR) and a prebuilt invoice trained 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\n```java\nString invoiceUrl = \"invoice_url\";\n boolean includeFieldElements = true;\n // if training polling operation completed, retrieve the final result.\n formRecognizerAsyncClient.beginRecognizeInvoicesFromUrl(invoiceUrl,\n new RecognizeInvoicesOptions()\n .setFieldElementsIncluded(includeFieldElements))\n .setPollInterval(Duration.ofSeconds(5))\n .flatMap(AsyncPollResponse::getFinalResult)\n .subscribe(recognizedInvoices -> {\n for (int i = 0; i < recognizedInvoices.size(); i++) {\n RecognizedForm recognizedForm = recognizedInvoices.get(i);\n Map<String, FormField> recognizedFields = recognizedForm.getFields();\n FormField customAddrFormField = recognizedFields.get(\"CustomerAddress\");\n if (customAddrFormField != null) {\n if (FieldValueType.STRING == customAddrFormField.getValue().getValueType()) {\n System.out.printf(\"Customer Address: %s%n\", customAddrFormField.getValue().asString());\n }\n }\n FormField invoiceDateFormField = recognizedFields.get(\"InvoiceDate\");\n if (invoiceDateFormField != null) {\n if (FieldValueType.DATE == invoiceDateFormField.getValue().getValueType()) {\n LocalDate invoiceDate = invoiceDateFormField.getValue().asDate();\n System.out.printf(\"Invoice Date: %s, confidence: %.2f%n\",\n invoiceDate, invoiceDateFormField.getConfidence());\n }\n }\n }\n });\n```"
parameters:
- description: "The source URL to the input invoice."
name: "invoiceUrl"
type: "<xref href=\"java.lang.String?alt=java.lang.String&text=String\" data-throw-if-not-resolved=\"False\" />"
- description: "The additional configurable <xref uid=\"com.azure.ai.formrecognizer.models.RecognizeInvoicesOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"options\"></xref>\n that may be passed when analyzing a invoice."
name: "recognizeInvoicesOptions"
type: "<xref href=\"com.azure.ai.formrecognizer.models.RecognizeInvoicesOptions?alt=com.azure.ai.formrecognizer.models.RecognizeInvoicesOptions&text=RecognizeInvoicesOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public PollerFlux<FormRecognizerOperationResult,List<RecognizedForm>> beginRecognizeInvoicesFromUrl(String invoiceUrl, RecognizeInvoicesOptions recognizeInvoicesOptions)"
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 recognize invoice operation until it has completed, has failed,\n or has been cancelled. The completed operation returns a list of <xref uid=\"com.azure.ai.formrecognizer.models.RecognizedForm\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RecognizedForm\"></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.models.FormRecognizerOperationResult?alt=com.azure.ai.formrecognizer.models.FormRecognizerOperationResult&text=FormRecognizerOperationResult\" data-throw-if-not-resolved=\"False\" />,<xref href=\"java.util.List?alt=java.util.List&text=List\" data-throw-if-not-resolved=\"False\" /><<xref href=\"com.azure.ai.formrecognizer.models.RecognizedForm?alt=com.azure.ai.formrecognizer.models.RecognizedForm&text=RecognizedForm\" data-throw-if-not-resolved=\"False\" />>>"
type: "method"
metadata: {}
package: "com.azure.ai.formrecognizer"
artifact: com.azure:azure-ai-formrecognizer:3.1.10