diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md index 29a5b4150c7..5f9f0aaccc6 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md @@ -2,6 +2,10 @@ ## 3.1.0b1 (Unreleased) +**New features** + +- Recognize receipt methods now take keyword argument `locale` to optionally indicate the locale of the receipt for +improved results ## 3.0.0 (2020-08-20) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_recognizer_client.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_recognizer_client.py index 544209be1b1..bab857cbfc9 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_recognizer_client.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_form_recognizer_client.py @@ -90,10 +90,14 @@ def begin_recognize_receipts(self, receipt, **kwargs): :keyword int polling_interval: Waiting time between two polls for LRO operations if no Retry-After header is present. Defaults to 5 seconds. :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword str locale: Locale of the receipt. Defaults to en-US. Supported locales include: + en-US, en-AU, en-CA, en-GB, and en-IN. :return: An instance of an LROPoller. Call `result()` on the poller object to return a list[:class:`~azure.ai.formrecognizer.RecognizedForm`]. :rtype: ~azure.core.polling.LROPoller[list[~azure.ai.formrecognizer.RecognizedForm]] :raises ~azure.core.exceptions.HttpResponseError: + .. versionadded:: v2.1-preview + The *locale* keyword argument .. admonition:: Example: @@ -142,10 +146,14 @@ def begin_recognize_receipts_from_url(self, receipt_url, **kwargs): :keyword int polling_interval: Waiting time between two polls for LRO operations if no Retry-After header is present. Defaults to 5 seconds. :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword str locale: Locale of the receipt. Defaults to en-US. Supported locales include: + en-US, en-AU, en-CA, en-GB, and en-IN. :return: An instance of an LROPoller. Call `result()` on the poller object to return a list[:class:`~azure.ai.formrecognizer.RecognizedForm`]. :rtype: ~azure.core.polling.LROPoller[list[~azure.ai.formrecognizer.RecognizedForm]] :raises ~azure.core.exceptions.HttpResponseError: + .. versionadded:: v2.1-preview + The *locale* keyword argument .. admonition:: Example: diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_recognizer_client_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_recognizer_client_async.py index 50cab0a7a2f..0202f8fd0d4 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_recognizer_client_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_recognizer_client_async.py @@ -90,10 +90,14 @@ async def begin_recognize_receipts( :keyword int polling_interval: Waiting time between two polls for LRO operations if no Retry-After header is present. Defaults to 5 seconds. :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword str locale: Locale of the receipt. Defaults to en-US. Supported locales include: + en-US, en-AU, en-CA, en-GB, and en-IN. :return: An instance of an AsyncLROPoller. Call `result()` on the poller object to return a list[:class:`~azure.ai.formrecognizer.RecognizedForm`]. :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.ai.formrecognizer.RecognizedForm]] :raises ~azure.core.exceptions.HttpResponseError: + .. versionadded:: v2.1-preview + The *locale* keyword argument .. admonition:: Example: @@ -145,10 +149,14 @@ async def begin_recognize_receipts_from_url( :keyword int polling_interval: Waiting time between two polls for LRO operations if no Retry-After header is present. Defaults to 5 seconds. :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword str locale: Locale of the receipt. Defaults to en-US. Supported locales include: + en-US, en-AU, en-CA, en-GB, and en-IN. :return: An instance of an AsyncLROPoller. Call `result()` on the poller object to return a list[:class:`~azure.ai.formrecognizer.RecognizedForm`]. :rtype: ~azure.core.polling.AsyncLROPoller[list[~azure.ai.formrecognizer.RecognizedForm]] :raises ~azure.core.exceptions.HttpResponseError: + .. versionadded:: v2.1-preview + The *locale* keyword argument .. admonition:: Example: diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_receipts_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_receipts_async.py index 5b0b0bcf442..99bb4031e4f 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_receipts_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_receipts_async.py @@ -46,7 +46,7 @@ async def recognize_receipts(self): ) as form_recognizer_client: with open(path_to_sample_forms, "rb") as f: - poller = await form_recognizer_client.begin_recognize_receipts(receipt=f) + poller = await form_recognizer_client.begin_recognize_receipts(receipt=f, locale="en-US") receipts = await poller.result() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_receipts.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_receipts.py index 5169076f7e1..12778847ab7 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_receipts.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_receipts.py @@ -44,7 +44,7 @@ def recognize_receipts(self): endpoint=endpoint, credential=AzureKeyCredential(key) ) with open(path_to_sample_forms, "rb") as f: - poller = form_recognizer_client.begin_recognize_receipts(receipt=f) + poller = form_recognizer_client.begin_recognize_receipts(receipt=f, locale="en-US") receipts = poller.result() for idx, receipt in enumerate(receipts):