From e135c698aaa43b9494c36a7075e74da305d20fb4 Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Thu, 22 Apr 2021 16:11:35 -0700 Subject: [PATCH] [formrecognizer] add testcases for labeled tables - fixed/variable rows (#18214) * add testcases for labeled tables - fixed/variable rows * fix input param * shorten test variable names * update test-resources.json env var names --- .../tests/preparers.py | 2 + ...from_url.test_label_tables_fixed_rows.yaml | 256 +++++++++++++++++ ...m_url.test_label_tables_variable_rows.yaml | 263 ++++++++++++++++++ ...rl_async.test_label_tables_fixed_rows.yaml | 200 +++++++++++++ ...async.test_label_tables_variable_rows.yaml | 207 ++++++++++++++ .../tests/test_custom_forms_from_url.py | 72 +++++ .../tests/test_custom_forms_from_url_async.py | 77 +++++ .../azure-ai-formrecognizer/tests/testcase.py | 4 + sdk/formrecognizer/test-resources.json | 42 ++- 9 files changed, 1119 insertions(+), 4 deletions(-) create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url.test_label_tables_fixed_rows.yaml create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url.test_label_tables_variable_rows.yaml create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url_async.test_label_tables_fixed_rows.yaml create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url_async.test_label_tables_variable_rows.yaml diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/preparers.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/preparers.py index 9a6f1e917ba7..139aaa100bd8 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/preparers.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/preparers.py @@ -25,6 +25,8 @@ formrecognizer_multipage_storage_container_sas_url="container_sas_url", formrecognizer_multipage_storage_container_sas_url_2="container_sas_url", formrecognizer_selection_mark_storage_container_sas_url="container_sas_url", + formrecognizer_table_variable_rows_container_sas_url="container_sas_url", + formrecognizer_table_fixed_rows_container_sas_url="container_sas_url", formrecognizer_resource_id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.CognitiveServices/accounts/frname", formrecognizer_region="region" ) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url.test_label_tables_fixed_rows.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url.test_label_tables_fixed_rows.yaml new file mode 100644 index 000000000000..16c077481051 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url.test_label_tables_fixed_rows.yaml @@ -0,0 +1,256 @@ +interactions: +- request: + body: 'b''{"source": "container_sas_url", "sourceFilter": {"prefix": "", "includeSubFolders": + false}, "useLabelFile": true}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '302' + Content-Type: + - application/json + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models + response: + body: + string: '' + headers: + apim-request-id: + - fb88ba21-8e3e-4a26-a4d2-ca2173ffc2b5 + content-length: + - '0' + date: + - Thu, 22 Apr 2021 01:29:38 GMT + location: + - https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/d55d7c8d-1f62-43ad-b083-317205e12621 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '533' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/d55d7c8d-1f62-43ad-b083-317205e12621?includeKeys=true + response: + body: + string: '{"modelInfo": {"modelId": "d55d7c8d-1f62-43ad-b083-317205e12621", "attributes": + {"isComposed": false}, "status": "ready", "createdDateTime": "2021-04-22T01:29:38Z", + "lastUpdatedDateTime": "2021-04-22T01:29:41Z"}, "trainResult": {"averageModelAccuracy": + 0.995, "trainingDocuments": [{"documentName": "label_table_fixed_rows1.pdf", + "pages": 1, "status": "succeeded"}, {"documentName": "label_table_fixed_rows2.pdf", + "pages": 1, "status": "succeeded"}, {"documentName": "label_table_fixed_rows3.pdf", + "pages": 1, "status": "succeeded"}, {"documentName": "label_table_fixed_rows4.pdf", + "pages": 1, "status": "succeeded"}, {"documentName": "label_table_fixed_rows5.pdf", + "pages": 1, "status": "succeeded"}], "fields": [{"fieldName": "table", "accuracy": + 0.995}], "errors": []}}' + headers: + apim-request-id: + - 59a83ea2-d358-4620-8d0d-5d569c20b9fd + content-length: + - '720' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 22 Apr 2021 01:29:43 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '17' + status: + code: 200 + message: OK +- request: + body: 'b''{"source": "blob_sas_url"}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '230' + Content-Type: + - application/json + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/d55d7c8d-1f62-43ad-b083-317205e12621/analyze?includeTextDetails=false + response: + body: + string: '' + headers: + apim-request-id: + - 10f98cd9-0aa5-4987-84b1-9cb206208c54 + content-length: + - '0' + date: + - Thu, 22 Apr 2021 01:29:43 GMT + operation-location: + - https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/d55d7c8d-1f62-43ad-b083-317205e12621/analyzeresults/59b6a250-6815-45c3-9029-d67a1a4f6571 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '347' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/d55d7c8d-1f62-43ad-b083-317205e12621/analyzeresults/59b6a250-6815-45c3-9029-d67a1a4f6571 + response: + body: + string: '{"status": "notStarted", "createdDateTime": "2021-04-22T01:29:44Z", + "lastUpdatedDateTime": "2021-04-22T01:29:48Z"}' + headers: + apim-request-id: + - 27da524d-3b74-4832-ac70-2fee5d03f1dd + content-length: + - '109' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 22 Apr 2021 01:29:49 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '15' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/d55d7c8d-1f62-43ad-b083-317205e12621/analyzeresults/59b6a250-6815-45c3-9029-d67a1a4f6571 + response: + body: + string: '{"status": "succeeded", "createdDateTime": "2021-04-22T01:29:44Z", + "lastUpdatedDateTime": "2021-04-22T01:29:51Z", "analyzeResult": {"version": + "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 8.5, "height": 11, + "unit": "inch"}], "pageResults": [{"page": 1, "tables": [{"rows": 5, "columns": + 4, "cells": [{"rowIndex": 0, "columnIndex": 0, "text": "", "boundingBox": + [0.9904, 1.6215, 2.297, 1.6215, 2.297, 1.8221, 0.9958, 1.8272]}, {"rowIndex": + 0, "columnIndex": 1, "text": "Price", "boundingBox": [2.297, 1.6215, 3.5874, + 1.6215, 3.5928, 1.8221, 2.297, 1.8221]}, {"rowIndex": 0, "columnIndex": 2, + "text": "Tax", "boundingBox": [3.5874, 1.6215, 4.8994, 1.6215, 4.8994, 1.8221, + 3.5928, 1.8221]}, {"rowIndex": 0, "columnIndex": 3, "text": "Total", "boundingBox": + [4.8994, 1.6215, 6.1952, 1.6215, 6.1952, 1.8272, 4.8994, 1.8221]}, {"rowIndex": + 1, "columnIndex": 0, "text": "Apple", "boundingBox": [0.9958, 1.8272, 2.297, + 1.8221, 2.297, 2.0078, 0.9958, 2.0128]}, {"rowIndex": 1, "columnIndex": 1, + "text": "5.00", "boundingBox": [2.297, 1.8221, 3.5928, 1.8221, 3.5928, 2.0078, + 2.297, 2.0078]}, {"rowIndex": 1, "columnIndex": 2, "text": "2.00", "boundingBox": + [3.5928, 1.8221, 4.8994, 1.8221, 4.8994, 2.0078, 3.5928, 2.0078]}, {"rowIndex": + 1, "columnIndex": 3, "text": "7.00", "boundingBox": [4.8994, 1.8221, 6.1952, + 1.8272, 6.1952, 2.0128, 4.8994, 2.0078]}, {"rowIndex": 2, "columnIndex": 0, + "text": "Orange", "boundingBox": [0.9958, 2.0128, 2.297, 2.0078, 2.297, 2.2034, + 0.9958, 2.2084]}, {"rowIndex": 2, "columnIndex": 1, "text": "2.00", "boundingBox": + [2.297, 2.0078, 3.5928, 2.0078, 3.5928, 2.2034, 2.297, 2.2034]}, {"rowIndex": + 2, "columnIndex": 2, "text": "1.00", "boundingBox": [3.5928, 2.0078, 4.8994, + 2.0078, 4.8994, 2.2034, 3.5928, 2.2034]}, {"rowIndex": 2, "columnIndex": 3, + "text": "3.00", "boundingBox": [4.8994, 2.0078, 6.1952, 2.0128, 6.1952, 2.2034, + 4.8994, 2.2034]}, {"rowIndex": 3, "columnIndex": 0, "text": "Grapefruit", + "boundingBox": [0.9958, 2.2084, 2.297, 2.2034, 2.297, 2.3991, 0.9958, 2.3991]}, + {"rowIndex": 3, "columnIndex": 1, "text": "1.00", "boundingBox": [2.297, 2.2034, + 3.5928, 2.2034, 3.5928, 2.3991, 2.297, 2.3991]}, {"rowIndex": 3, "columnIndex": + 2, "text": "4.00", "boundingBox": [3.5928, 2.2034, 4.8994, 2.2034, 4.8994, + 2.3991, 3.5928, 2.3991]}, {"rowIndex": 3, "columnIndex": 3, "text": "5.00", + "boundingBox": [4.8994, 2.2034, 6.1952, 2.2034, 6.1952, 2.3991, 4.8994, 2.3991]}, + {"rowIndex": 4, "columnIndex": 0, "text": "Pear", "boundingBox": [0.9958, + 2.3991, 2.297, 2.3991, 2.297, 2.5947, 0.9958, 2.5947]}, {"rowIndex": 4, "columnIndex": + 1, "text": "", "boundingBox": [2.297, 2.3991, 3.5928, 2.3991, 3.5982, 2.5947, + 2.297, 2.5947]}, {"rowIndex": 4, "columnIndex": 2, "text": "2.00", "boundingBox": + [3.5928, 2.3991, 4.8994, 2.3991, 4.8994, 2.5947, 3.5982, 2.5947]}, {"rowIndex": + 4, "columnIndex": 3, "text": "2.00", "boundingBox": [4.8994, 2.3991, 6.1952, + 2.3991, 6.1952, 2.5947, 4.8994, 2.5947]}], "boundingBox": [0.9986, 1.6168, + 6.2004, 1.6179, 6.2004, 2.597, 0.9981, 2.5961]}]}], "documentResults": [{"docType": + "custom:d55d7c8d-1f62-43ad-b083-317205e12621", "modelId": "d55d7c8d-1f62-43ad-b083-317205e12621", + "pageRange": [1, 1], "fields": {"table": {"type": "object", "valueObject": + {"Apple": {"type": "object", "valueObject": {"Price": {"type": "string", "valueString": + "5.00", "text": "5.00", "page": 1, "boundingBox": [2.385, 1.87, 2.645, 1.87, + 2.645, 1.97, 2.385, 1.97]}, "Tax": {"type": "string", "valueString": "2.00", + "text": "2.00", "page": 1, "boundingBox": [3.685, 1.87, 3.945, 1.87, 3.945, + 1.97, 3.685, 1.97]}, "Total": {"type": "string", "valueString": "7.00", "text": + "7.00", "page": 1, "boundingBox": [4.985, 1.87, 5.245, 1.87, 5.245, 1.97, + 4.985, 1.97]}}}, "Orange": {"type": "object", "valueObject": {"Price": {"type": + "string", "valueString": "2.00", "text": "2.00", "page": 1, "boundingBox": + [2.385, 2.065, 2.645, 2.065, 2.645, 2.165, 2.385, 2.165]}, "Tax": {"type": + "string", "valueString": "1.00", "text": "1.00", "page": 1, "boundingBox": + [3.69, 2.065, 3.945, 2.065, 3.945, 2.165, 3.69, 2.165]}, "Total": {"type": + "string", "valueString": "3.00", "text": "3.00", "page": 1, "boundingBox": + [4.985, 2.065, 5.245, 2.065, 5.245, 2.165, 4.985, 2.165]}}}, "Grapefruit": + {"type": "object", "valueObject": {"Price": {"type": "string", "valueString": + "1.00", "text": "1.00", "page": 1, "boundingBox": [2.39, 2.26, 2.645, 2.26, + 2.645, 2.36, 2.39, 2.36]}, "Tax": {"type": "string", "valueString": "4.00", + "text": "4.00", "page": 1, "boundingBox": [3.68, 2.26, 3.945, 2.26, 3.945, + 2.36, 3.68, 2.36]}, "Total": {"type": "string", "valueString": "5.00", "text": + "5.00", "page": 1, "boundingBox": [4.985, 2.26, 5.245, 2.26, 5.245, 2.36, + 4.985, 2.36]}}}, "Pear": {"type": "object", "valueObject": {"Price": null, + "Tax": {"type": "string", "valueString": "2.00", "text": "2.00", "page": 1, + "boundingBox": [3.685, 2.45, 3.945, 2.45, 3.945, 2.55, 3.685, 2.55]}, "Total": + {"type": "string", "valueString": "2.00", "text": "2.00", "page": 1, "boundingBox": + [4.985, 2.45, 5.245, 2.45, 5.245, 2.55, 4.985, 2.55]}}}}}}, "docTypeConfidence": + 0.979}], "errors": []}}' + headers: + apim-request-id: + - 31eb026f-ea60-4f17-8c92-c6673073fd15 + content-length: + - '4533' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 22 Apr 2021 01:29:54 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '19' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url.test_label_tables_variable_rows.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url.test_label_tables_variable_rows.yaml new file mode 100644 index 000000000000..9abb9b38016e --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url.test_label_tables_variable_rows.yaml @@ -0,0 +1,263 @@ +interactions: +- request: + body: 'b''{"source": "container_sas_url", "sourceFilter": {"prefix": "", "includeSubFolders": + false}, "useLabelFile": true}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '303' + Content-Type: + - application/json + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models + response: + body: + string: '' + headers: + apim-request-id: + - c410a514-91d8-4dc6-9778-25084ae4deb9 + content-length: + - '0' + date: + - Thu, 22 Apr 2021 00:22:01 GMT + location: + - https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/901635b3-716b-4bcc-8756-40a90e90498e + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '597' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/901635b3-716b-4bcc-8756-40a90e90498e?includeKeys=true + response: + body: + string: '{"modelInfo": {"modelId": "901635b3-716b-4bcc-8756-40a90e90498e", "attributes": + {"isComposed": false}, "status": "ready", "createdDateTime": "2021-04-22T00:22:01Z", + "lastUpdatedDateTime": "2021-04-22T00:22:05Z"}, "trainResult": {"averageModelAccuracy": + 0.995, "trainingDocuments": [{"documentName": "label_table_variable_rows1.pdf", + "pages": 1, "status": "succeeded"}, {"documentName": "label_table_variable_rows2.pdf", + "pages": 1, "status": "succeeded"}, {"documentName": "label_table_variable_rows3.pdf", + "pages": 1, "status": "succeeded"}, {"documentName": "label_table_variable_rows4.pdf", + "pages": 1, "status": "succeeded"}, {"documentName": "label_table_variable_rows5.pdf", + "pages": 1, "status": "succeeded"}], "fields": [{"fieldName": "table", "accuracy": + 0.995}, {"fieldName": "table: Item", "accuracy": 0.995}, {"fieldName": "table: + Price", "accuracy": 0.995}, {"fieldName": "table: Tax", "accuracy": 0.995}, + {"fieldName": "table: Total", "accuracy": 0.995}], "errors": []}}' + headers: + apim-request-id: + - ce5e7599-bd90-48a5-93b8-1f1220e24c17 + content-length: + - '916' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 22 Apr 2021 00:22:06 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '17' + status: + code: 200 + message: OK +- request: + body: 'b''{"source": "blob_sas_url"}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '233' + Content-Type: + - application/json + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/901635b3-716b-4bcc-8756-40a90e90498e/analyze?includeTextDetails=false + response: + body: + string: '' + headers: + apim-request-id: + - c6516403-eccd-47a2-8cd0-5e13d44600e6 + content-length: + - '0' + date: + - Thu, 22 Apr 2021 00:22:07 GMT + operation-location: + - https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/901635b3-716b-4bcc-8756-40a90e90498e/analyzeresults/76912c56-7159-4705-8bf9-31fccec0a240 + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '337' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/901635b3-716b-4bcc-8756-40a90e90498e/analyzeresults/76912c56-7159-4705-8bf9-31fccec0a240 + response: + body: + string: '{"status": "notStarted", "createdDateTime": "2021-04-22T00:22:07Z", + "lastUpdatedDateTime": "2021-04-22T00:22:12Z"}' + headers: + apim-request-id: + - a14b5adc-8167-491e-9afb-cd23f0f2cb4e + content-length: + - '109' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 22 Apr 2021 00:22:12 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '29' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/901635b3-716b-4bcc-8756-40a90e90498e/analyzeresults/76912c56-7159-4705-8bf9-31fccec0a240 + response: + body: + string: '{"status": "succeeded", "createdDateTime": "2021-04-22T00:22:07Z", + "lastUpdatedDateTime": "2021-04-22T00:22:15Z", "analyzeResult": {"version": + "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 8.5, "height": 11, + "unit": "inch"}], "pageResults": [{"page": 1, "tables": [{"rows": 5, "columns": + 4, "cells": [{"rowIndex": 0, "columnIndex": 0, "text": "Item", "boundingBox": + [0.9965, 1.6215, 2.2935, 1.6215, 2.2935, 1.8221, 0.9965, 1.8221]}, {"rowIndex": + 0, "columnIndex": 1, "text": "Price", "boundingBox": [2.2935, 1.6215, 3.585, + 1.6215, 3.5904, 1.8221, 2.2935, 1.8221]}, {"rowIndex": 0, "columnIndex": 2, + "text": "Tax", "boundingBox": [3.585, 1.6215, 4.8981, 1.6215, 4.8981, 1.8221, + 3.5904, 1.8221]}, {"rowIndex": 0, "columnIndex": 3, "text": "Total", "boundingBox": + [4.8981, 1.6215, 6.1951, 1.6215, 6.1951, 1.8272, 4.8981, 1.8221]}, {"rowIndex": + 1, "columnIndex": 0, "text": "Apple", "boundingBox": [0.9965, 1.8221, 2.2935, + 1.8221, 2.2935, 2.0078, 0.9965, 2.0128]}, {"rowIndex": 1, "columnIndex": 1, + "text": "5.00", "boundingBox": [2.2935, 1.8221, 3.5904, 1.8221, 3.5904, 2.0078, + 2.2935, 2.0078]}, {"rowIndex": 1, "columnIndex": 2, "text": "2.00", "boundingBox": + [3.5904, 1.8221, 4.8981, 1.8221, 4.8981, 2.0078, 3.5904, 2.0078]}, {"rowIndex": + 1, "columnIndex": 3, "text": "7.00", "boundingBox": [4.8981, 1.8221, 6.1951, + 1.8272, 6.1951, 2.0128, 4.8981, 2.0078]}, {"rowIndex": 2, "columnIndex": 0, + "text": "Orange", "boundingBox": [0.9965, 2.0128, 2.2935, 2.0078, 2.2935, + 2.2034, 0.9965, 2.2084]}, {"rowIndex": 2, "columnIndex": 1, "text": "2.00", + "boundingBox": [2.2935, 2.0078, 3.5904, 2.0078, 3.5904, 2.2034, 2.2935, 2.2034]}, + {"rowIndex": 2, "columnIndex": 2, "text": "1.00", "boundingBox": [3.5904, + 2.0078, 4.8981, 2.0078, 4.8981, 2.2034, 3.5904, 2.2034]}, {"rowIndex": 2, + "columnIndex": 3, "text": "3.00", "boundingBox": [4.8981, 2.0078, 6.1951, + 2.0128, 6.1951, 2.2034, 4.8981, 2.2034]}, {"rowIndex": 3, "columnIndex": 0, + "text": "", "boundingBox": [0.9965, 2.2084, 2.2935, 2.2034, 2.2935, 2.3991, + 0.9965, 2.3991]}, {"rowIndex": 3, "columnIndex": 1, "text": "1.00", "boundingBox": + [2.2935, 2.2034, 3.5904, 2.2034, 3.5904, 2.3991, 2.2935, 2.3991]}, {"rowIndex": + 3, "columnIndex": 2, "text": "4.00", "boundingBox": [3.5904, 2.2034, 4.8981, + 2.2034, 4.8981, 2.3991, 3.5904, 2.3991]}, {"rowIndex": 3, "columnIndex": 3, + "text": "5.00", "boundingBox": [4.8981, 2.2034, 6.1951, 2.2034, 6.1951, 2.3991, + 4.8981, 2.3991]}, {"rowIndex": 4, "columnIndex": 0, "text": "Pear", "boundingBox": + [0.9965, 2.3991, 2.2935, 2.3991, 2.2935, 2.5947, 0.9965, 2.5947]}, {"rowIndex": + 4, "columnIndex": 1, "text": "", "boundingBox": [2.2935, 2.3991, 3.5904, 2.3991, + 3.5958, 2.5947, 2.2935, 2.5947]}, {"rowIndex": 4, "columnIndex": 2, "text": + "2.00", "boundingBox": [3.5904, 2.3991, 4.8981, 2.3991, 4.8981, 2.5947, 3.5958, + 2.5947]}, {"rowIndex": 4, "columnIndex": 3, "text": "2.00", "boundingBox": + [4.8981, 2.3991, 6.1951, 2.3991, 6.1951, 2.5947, 4.8981, 2.5947]}], "boundingBox": + [0.9979, 1.6139, 6.2003, 1.6153, 6.1999, 2.5942, 0.9973, 2.5931]}]}], "documentResults": + [{"docType": "custom:901635b3-716b-4bcc-8756-40a90e90498e", "modelId": "901635b3-716b-4bcc-8756-40a90e90498e", + "pageRange": [1, 1], "fields": {"table": {"type": "array", "valueArray": [{"type": + "object", "valueObject": {"Item": {"type": "string", "valueString": "Apple", + "text": "Apple", "page": 1, "boundingBox": [1.08, 1.865, 1.445, 1.865, 1.445, + 1.995, 1.08, 1.995]}, "Price": {"type": "string", "valueString": "5.00", "text": + "5.00", "page": 1, "boundingBox": [2.385, 1.87, 2.645, 1.87, 2.645, 1.97, + 2.385, 1.97]}, "Tax": {"type": "string", "valueString": "2.00", "text": "2.00", + "page": 1, "boundingBox": [3.685, 1.87, 3.945, 1.87, 3.945, 1.97, 3.685, 1.97]}, + "Total": {"type": "string", "valueString": "7.00", "text": "7.00", "page": + 1, "boundingBox": [4.985, 1.87, 5.245, 1.87, 5.245, 1.97, 4.985, 1.97]}}}, + {"type": "object", "valueObject": {"Item": {"type": "string", "valueString": + "Orange", "text": "Orange", "page": 1, "boundingBox": [1.085, 2.065, 1.54, + 2.065, 1.54, 2.19, 1.085, 2.19]}, "Price": {"type": "string", "valueString": + "2.00", "text": "2.00", "page": 1, "boundingBox": [2.385, 2.065, 2.645, 2.065, + 2.645, 2.165, 2.385, 2.165]}, "Tax": {"type": "string", "valueString": "1.00", + "text": "1.00", "page": 1, "boundingBox": [3.69, 2.065, 3.945, 2.065, 3.945, + 2.165, 3.69, 2.165]}, "Total": {"type": "string", "valueString": "3.00", "text": + "3.00", "page": 1, "boundingBox": [4.985, 2.065, 5.245, 2.065, 5.245, 2.165, + 4.985, 2.165]}}}, {"type": "object", "valueObject": {"Item": null, "Price": + {"type": "string", "valueString": "1.00", "text": "1.00", "page": 1, "boundingBox": + [2.39, 2.26, 2.645, 2.26, 2.645, 2.36, 2.39, 2.36]}, "Tax": {"type": "string", + "valueString": "4.00", "text": "4.00", "page": 1, "boundingBox": [3.68, 2.26, + 3.945, 2.26, 3.945, 2.36, 3.68, 2.36]}, "Total": {"type": "string", "valueString": + "5.00", "text": "5.00", "page": 1, "boundingBox": [4.985, 2.26, 5.245, 2.26, + 5.245, 2.36, 4.985, 2.36]}}}, {"type": "object", "valueObject": {"Item": {"type": + "string", "valueString": "Pear", "text": "Pear", "page": 1, "boundingBox": + [1.09, 2.455, 1.365, 2.455, 1.365, 2.55, 1.09, 2.55]}, "Price": null, "Tax": + {"type": "string", "valueString": "2.00", "text": "2.00", "page": 1, "boundingBox": + [3.685, 2.45, 3.945, 2.45, 3.945, 2.55, 3.685, 2.55]}, "Total": {"type": "string", + "valueString": "2.00", "text": "2.00", "page": 1, "boundingBox": [4.985, 2.45, + 5.245, 2.45, 5.245, 2.55, 4.985, 2.55]}}}]}}, "docTypeConfidence": 0.995}], + "errors": []}}' + headers: + apim-request-id: + - 0dc461f2-7db4-4227-bb09-2962772371eb + content-length: + - '4914' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 22 Apr 2021 00:22:17 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '21' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url_async.test_label_tables_fixed_rows.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url_async.test_label_tables_fixed_rows.yaml new file mode 100644 index 000000000000..e45971d70b81 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url_async.test_label_tables_fixed_rows.yaml @@ -0,0 +1,200 @@ +interactions: +- request: + body: 'b''{"source": "container_sas_url", "sourceFilter": {"prefix": "", "includeSubFolders": + false}, "useLabelFile": true}''' + headers: + Accept: + - application/json + Content-Length: + - '302' + Content-Type: + - application/json + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models + response: + body: + string: '' + headers: + apim-request-id: cdcbb978-b4ab-4ccf-8037-ac0d4c43b586 + content-length: '0' + date: Thu, 22 Apr 2021 01:30:01 GMT + location: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/f7ef8ae9-dc04-4218-bcda-f56037485183 + strict-transport-security: max-age=31536000; includeSubDomains; preload + x-content-type-options: nosniff + x-envoy-upstream-service-time: '461' + status: + code: 201 + message: Created + url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/f7ef8ae9-dc04-4218-bcda-f56037485183?includeKeys=true + response: + body: + string: '{"modelInfo": {"modelId": "f7ef8ae9-dc04-4218-bcda-f56037485183", "attributes": + {"isComposed": false}, "status": "ready", "createdDateTime": "2021-04-22T01:30:01Z", + "lastUpdatedDateTime": "2021-04-22T01:30:04Z"}, "trainResult": {"averageModelAccuracy": + 0.995, "trainingDocuments": [{"documentName": "label_table_fixed_rows1.pdf", + "pages": 1, "status": "succeeded"}, {"documentName": "label_table_fixed_rows2.pdf", + "pages": 1, "status": "succeeded"}, {"documentName": "label_table_fixed_rows3.pdf", + "pages": 1, "status": "succeeded"}, {"documentName": "label_table_fixed_rows4.pdf", + "pages": 1, "status": "succeeded"}, {"documentName": "label_table_fixed_rows5.pdf", + "pages": 1, "status": "succeeded"}], "fields": [{"fieldName": "table", "accuracy": + 0.995}], "errors": []}}' + headers: + apim-request-id: 9fbbf165-4475-465d-883b-f2c4ca4834cb + content-length: '720' + content-type: application/json; charset=utf-8 + date: Thu, 22 Apr 2021 01:30:06 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + x-content-type-options: nosniff + x-envoy-upstream-service-time: '15' + status: + code: 200 + message: OK + url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/f7ef8ae9-dc04-4218-bcda-f56037485183?includeKeys=true +- request: + body: 'b''{"source": "blob_sas_url"}''' + headers: + Accept: + - application/json + Content-Length: + - '230' + Content-Type: + - application/json + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/f7ef8ae9-dc04-4218-bcda-f56037485183/analyze?includeTextDetails=false + response: + body: + string: '' + headers: + apim-request-id: 8849c9df-fbe7-46fa-acd5-9539019d84cd + content-length: '0' + date: Thu, 22 Apr 2021 01:30:06 GMT + operation-location: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/f7ef8ae9-dc04-4218-bcda-f56037485183/analyzeresults/aa34dae4-8f5e-486b-9fce-8f0812feaa22 + strict-transport-security: max-age=31536000; includeSubDomains; preload + x-content-type-options: nosniff + x-envoy-upstream-service-time: '336' + status: + code: 202 + message: Accepted + url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/f7ef8ae9-dc04-4218-bcda-f56037485183/analyze?includeTextDetails=false +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/f7ef8ae9-dc04-4218-bcda-f56037485183/analyzeresults/aa34dae4-8f5e-486b-9fce-8f0812feaa22 + response: + body: + string: '{"status": "notStarted", "createdDateTime": "2021-04-22T01:30:07Z", + "lastUpdatedDateTime": "2021-04-22T01:30:12Z"}' + headers: + apim-request-id: 120ca4ae-a2a2-47ac-8f9e-72e137982895 + content-length: '109' + content-type: application/json; charset=utf-8 + date: Thu, 22 Apr 2021 01:30:11 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + x-content-type-options: nosniff + x-envoy-upstream-service-time: '20' + status: + code: 200 + message: OK + url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/f7ef8ae9-dc04-4218-bcda-f56037485183/analyzeresults/aa34dae4-8f5e-486b-9fce-8f0812feaa22 +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/f7ef8ae9-dc04-4218-bcda-f56037485183/analyzeresults/aa34dae4-8f5e-486b-9fce-8f0812feaa22 + response: + body: + string: '{"status": "succeeded", "createdDateTime": "2021-04-22T01:30:07Z", + "lastUpdatedDateTime": "2021-04-22T01:30:15Z", "analyzeResult": {"version": + "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 8.5, "height": 11, + "unit": "inch"}], "pageResults": [{"page": 1, "tables": [{"rows": 5, "columns": + 4, "cells": [{"rowIndex": 0, "columnIndex": 0, "text": "", "boundingBox": + [0.9904, 1.6215, 2.297, 1.6215, 2.297, 1.8221, 0.9958, 1.8272]}, {"rowIndex": + 0, "columnIndex": 1, "text": "Price", "boundingBox": [2.297, 1.6215, 3.5874, + 1.6215, 3.5928, 1.8221, 2.297, 1.8221]}, {"rowIndex": 0, "columnIndex": 2, + "text": "Tax", "boundingBox": [3.5874, 1.6215, 4.8994, 1.6215, 4.8994, 1.8221, + 3.5928, 1.8221]}, {"rowIndex": 0, "columnIndex": 3, "text": "Total", "boundingBox": + [4.8994, 1.6215, 6.1952, 1.6215, 6.1952, 1.8272, 4.8994, 1.8221]}, {"rowIndex": + 1, "columnIndex": 0, "text": "Apple", "boundingBox": [0.9958, 1.8272, 2.297, + 1.8221, 2.297, 2.0078, 0.9958, 2.0128]}, {"rowIndex": 1, "columnIndex": 1, + "text": "5.00", "boundingBox": [2.297, 1.8221, 3.5928, 1.8221, 3.5928, 2.0078, + 2.297, 2.0078]}, {"rowIndex": 1, "columnIndex": 2, "text": "2.00", "boundingBox": + [3.5928, 1.8221, 4.8994, 1.8221, 4.8994, 2.0078, 3.5928, 2.0078]}, {"rowIndex": + 1, "columnIndex": 3, "text": "7.00", "boundingBox": [4.8994, 1.8221, 6.1952, + 1.8272, 6.1952, 2.0128, 4.8994, 2.0078]}, {"rowIndex": 2, "columnIndex": 0, + "text": "Orange", "boundingBox": [0.9958, 2.0128, 2.297, 2.0078, 2.297, 2.2034, + 0.9958, 2.2084]}, {"rowIndex": 2, "columnIndex": 1, "text": "2.00", "boundingBox": + [2.297, 2.0078, 3.5928, 2.0078, 3.5928, 2.2034, 2.297, 2.2034]}, {"rowIndex": + 2, "columnIndex": 2, "text": "1.00", "boundingBox": [3.5928, 2.0078, 4.8994, + 2.0078, 4.8994, 2.2034, 3.5928, 2.2034]}, {"rowIndex": 2, "columnIndex": 3, + "text": "3.00", "boundingBox": [4.8994, 2.0078, 6.1952, 2.0128, 6.1952, 2.2034, + 4.8994, 2.2034]}, {"rowIndex": 3, "columnIndex": 0, "text": "Grapefruit", + "boundingBox": [0.9958, 2.2084, 2.297, 2.2034, 2.297, 2.3991, 0.9958, 2.3991]}, + {"rowIndex": 3, "columnIndex": 1, "text": "1.00", "boundingBox": [2.297, 2.2034, + 3.5928, 2.2034, 3.5928, 2.3991, 2.297, 2.3991]}, {"rowIndex": 3, "columnIndex": + 2, "text": "4.00", "boundingBox": [3.5928, 2.2034, 4.8994, 2.2034, 4.8994, + 2.3991, 3.5928, 2.3991]}, {"rowIndex": 3, "columnIndex": 3, "text": "5.00", + "boundingBox": [4.8994, 2.2034, 6.1952, 2.2034, 6.1952, 2.3991, 4.8994, 2.3991]}, + {"rowIndex": 4, "columnIndex": 0, "text": "Pear", "boundingBox": [0.9958, + 2.3991, 2.297, 2.3991, 2.297, 2.5947, 0.9958, 2.5947]}, {"rowIndex": 4, "columnIndex": + 1, "text": "", "boundingBox": [2.297, 2.3991, 3.5928, 2.3991, 3.5982, 2.5947, + 2.297, 2.5947]}, {"rowIndex": 4, "columnIndex": 2, "text": "2.00", "boundingBox": + [3.5928, 2.3991, 4.8994, 2.3991, 4.8994, 2.5947, 3.5982, 2.5947]}, {"rowIndex": + 4, "columnIndex": 3, "text": "2.00", "boundingBox": [4.8994, 2.3991, 6.1952, + 2.3991, 6.1952, 2.5947, 4.8994, 2.5947]}], "boundingBox": [0.9986, 1.6168, + 6.2004, 1.6179, 6.2004, 2.597, 0.9981, 2.5961]}]}], "documentResults": [{"docType": + "custom:f7ef8ae9-dc04-4218-bcda-f56037485183", "modelId": "f7ef8ae9-dc04-4218-bcda-f56037485183", + "pageRange": [1, 1], "fields": {"table": {"type": "object", "valueObject": + {"Apple": {"type": "object", "valueObject": {"Price": {"type": "string", "valueString": + "5.00", "text": "5.00", "page": 1, "boundingBox": [2.385, 1.87, 2.645, 1.87, + 2.645, 1.97, 2.385, 1.97]}, "Tax": {"type": "string", "valueString": "2.00", + "text": "2.00", "page": 1, "boundingBox": [3.685, 1.87, 3.945, 1.87, 3.945, + 1.97, 3.685, 1.97]}, "Total": {"type": "string", "valueString": "7.00", "text": + "7.00", "page": 1, "boundingBox": [4.985, 1.87, 5.245, 1.87, 5.245, 1.97, + 4.985, 1.97]}}}, "Orange": {"type": "object", "valueObject": {"Price": {"type": + "string", "valueString": "2.00", "text": "2.00", "page": 1, "boundingBox": + [2.385, 2.065, 2.645, 2.065, 2.645, 2.165, 2.385, 2.165]}, "Tax": {"type": + "string", "valueString": "1.00", "text": "1.00", "page": 1, "boundingBox": + [3.69, 2.065, 3.945, 2.065, 3.945, 2.165, 3.69, 2.165]}, "Total": {"type": + "string", "valueString": "3.00", "text": "3.00", "page": 1, "boundingBox": + [4.985, 2.065, 5.245, 2.065, 5.245, 2.165, 4.985, 2.165]}}}, "Grapefruit": + {"type": "object", "valueObject": {"Price": {"type": "string", "valueString": + "1.00", "text": "1.00", "page": 1, "boundingBox": [2.39, 2.26, 2.645, 2.26, + 2.645, 2.36, 2.39, 2.36]}, "Tax": {"type": "string", "valueString": "4.00", + "text": "4.00", "page": 1, "boundingBox": [3.68, 2.26, 3.945, 2.26, 3.945, + 2.36, 3.68, 2.36]}, "Total": {"type": "string", "valueString": "5.00", "text": + "5.00", "page": 1, "boundingBox": [4.985, 2.26, 5.245, 2.26, 5.245, 2.36, + 4.985, 2.36]}}}, "Pear": {"type": "object", "valueObject": {"Price": null, + "Tax": {"type": "string", "valueString": "2.00", "text": "2.00", "page": 1, + "boundingBox": [3.685, 2.45, 3.945, 2.45, 3.945, 2.55, 3.685, 2.55]}, "Total": + {"type": "string", "valueString": "2.00", "text": "2.00", "page": 1, "boundingBox": + [4.985, 2.45, 5.245, 2.45, 5.245, 2.55, 4.985, 2.55]}}}}}}, "docTypeConfidence": + 0.979}], "errors": []}}' + headers: + apim-request-id: 2877cc34-d1ae-4a4e-8e5b-ace383a36b69 + content-length: '4533' + content-type: application/json; charset=utf-8 + date: Thu, 22 Apr 2021 01:30:17 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + x-content-type-options: nosniff + x-envoy-upstream-service-time: '20' + status: + code: 200 + message: OK + url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/f7ef8ae9-dc04-4218-bcda-f56037485183/analyzeresults/aa34dae4-8f5e-486b-9fce-8f0812feaa22 +version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url_async.test_label_tables_variable_rows.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url_async.test_label_tables_variable_rows.yaml new file mode 100644 index 000000000000..da3227a83c7e --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_custom_forms_from_url_async.test_label_tables_variable_rows.yaml @@ -0,0 +1,207 @@ +interactions: +- request: + body: 'b''{"source": "container_sas_url", "sourceFilter": {"prefix": "", "includeSubFolders": + false}, "useLabelFile": true}''' + headers: + Accept: + - application/json + Content-Length: + - '303' + Content-Type: + - application/json + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models + response: + body: + string: '' + headers: + apim-request-id: e0bc4f8c-28d0-40fc-bc46-3b1a8a5604af + content-length: '0' + date: Thu, 22 Apr 2021 01:02:55 GMT + location: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/747bee39-f021-4e7e-81a7-195ef72db354 + strict-transport-security: max-age=31536000; includeSubDomains; preload + x-content-type-options: nosniff + x-envoy-upstream-service-time: '217' + status: + code: 201 + message: Created + url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/747bee39-f021-4e7e-81a7-195ef72db354?includeKeys=true + response: + body: + string: '{"modelInfo": {"modelId": "747bee39-f021-4e7e-81a7-195ef72db354", "attributes": + {"isComposed": false}, "status": "ready", "createdDateTime": "2021-04-22T01:02:55Z", + "lastUpdatedDateTime": "2021-04-22T01:02:57Z"}, "trainResult": {"averageModelAccuracy": + 0.995, "trainingDocuments": [{"documentName": "label_table_variable_rows1.pdf", + "pages": 1, "status": "succeeded"}, {"documentName": "label_table_variable_rows2.pdf", + "pages": 1, "status": "succeeded"}, {"documentName": "label_table_variable_rows3.pdf", + "pages": 1, "status": "succeeded"}, {"documentName": "label_table_variable_rows4.pdf", + "pages": 1, "status": "succeeded"}, {"documentName": "label_table_variable_rows5.pdf", + "pages": 1, "status": "succeeded"}], "fields": [{"fieldName": "table", "accuracy": + 0.995}, {"fieldName": "table: Item", "accuracy": 0.995}, {"fieldName": "table: + Price", "accuracy": 0.995}, {"fieldName": "table: Tax", "accuracy": 0.995}, + {"fieldName": "table: Total", "accuracy": 0.995}], "errors": []}}' + headers: + apim-request-id: ffe7b620-28df-4de7-8aff-4a802d8b0822 + content-length: '916' + content-type: application/json; charset=utf-8 + date: Thu, 22 Apr 2021 01:03:00 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + x-content-type-options: nosniff + x-envoy-upstream-service-time: '15' + status: + code: 200 + message: OK + url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/747bee39-f021-4e7e-81a7-195ef72db354?includeKeys=true +- request: + body: 'b''{"source": "blob_sas_url"}''' + headers: + Accept: + - application/json + Content-Length: + - '233' + Content-Type: + - application/json + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/747bee39-f021-4e7e-81a7-195ef72db354/analyze?includeTextDetails=false + response: + body: + string: '' + headers: + apim-request-id: 83e5e7a2-86b5-4db3-be19-47e6c5a2df79 + content-length: '0' + date: Thu, 22 Apr 2021 01:03:00 GMT + operation-location: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/747bee39-f021-4e7e-81a7-195ef72db354/analyzeresults/fa322829-4150-49c2-80f4-1dc49201aba8 + strict-transport-security: max-age=31536000; includeSubDomains; preload + x-content-type-options: nosniff + x-envoy-upstream-service-time: '376' + status: + code: 202 + message: Accepted + url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/747bee39-f021-4e7e-81a7-195ef72db354/analyze?includeTextDetails=false +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/747bee39-f021-4e7e-81a7-195ef72db354/analyzeresults/fa322829-4150-49c2-80f4-1dc49201aba8 + response: + body: + string: '{"status": "notStarted", "createdDateTime": "2021-04-22T01:03:01Z", + "lastUpdatedDateTime": "2021-04-22T01:03:02Z"}' + headers: + apim-request-id: 5b66c722-0d45-45d2-a807-6793ca89b6f4 + content-length: '109' + content-type: application/json; charset=utf-8 + date: Thu, 22 Apr 2021 01:03:06 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + x-content-type-options: nosniff + x-envoy-upstream-service-time: '18' + status: + code: 200 + message: OK + url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/747bee39-f021-4e7e-81a7-195ef72db354/analyzeresults/fa322829-4150-49c2-80f4-1dc49201aba8 +- request: + body: null + headers: + User-Agent: + - azsdk-python-ai-formrecognizer/3.1.0b5 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/747bee39-f021-4e7e-81a7-195ef72db354/analyzeresults/fa322829-4150-49c2-80f4-1dc49201aba8 + response: + body: + string: '{"status": "succeeded", "createdDateTime": "2021-04-22T01:03:01Z", + "lastUpdatedDateTime": "2021-04-22T01:03:09Z", "analyzeResult": {"version": + "2.1.0", "readResults": [{"page": 1, "angle": 0, "width": 8.5, "height": 11, + "unit": "inch"}], "pageResults": [{"page": 1, "tables": [{"rows": 5, "columns": + 4, "cells": [{"rowIndex": 0, "columnIndex": 0, "text": "Item", "boundingBox": + [0.9965, 1.6215, 2.2935, 1.6215, 2.2935, 1.8221, 0.9965, 1.8221]}, {"rowIndex": + 0, "columnIndex": 1, "text": "Price", "boundingBox": [2.2935, 1.6215, 3.585, + 1.6215, 3.5904, 1.8221, 2.2935, 1.8221]}, {"rowIndex": 0, "columnIndex": 2, + "text": "Tax", "boundingBox": [3.585, 1.6215, 4.8981, 1.6215, 4.8981, 1.8221, + 3.5904, 1.8221]}, {"rowIndex": 0, "columnIndex": 3, "text": "Total", "boundingBox": + [4.8981, 1.6215, 6.1951, 1.6215, 6.1951, 1.8272, 4.8981, 1.8221]}, {"rowIndex": + 1, "columnIndex": 0, "text": "Apple", "boundingBox": [0.9965, 1.8221, 2.2935, + 1.8221, 2.2935, 2.0078, 0.9965, 2.0128]}, {"rowIndex": 1, "columnIndex": 1, + "text": "5.00", "boundingBox": [2.2935, 1.8221, 3.5904, 1.8221, 3.5904, 2.0078, + 2.2935, 2.0078]}, {"rowIndex": 1, "columnIndex": 2, "text": "2.00", "boundingBox": + [3.5904, 1.8221, 4.8981, 1.8221, 4.8981, 2.0078, 3.5904, 2.0078]}, {"rowIndex": + 1, "columnIndex": 3, "text": "7.00", "boundingBox": [4.8981, 1.8221, 6.1951, + 1.8272, 6.1951, 2.0128, 4.8981, 2.0078]}, {"rowIndex": 2, "columnIndex": 0, + "text": "Orange", "boundingBox": [0.9965, 2.0128, 2.2935, 2.0078, 2.2935, + 2.2034, 0.9965, 2.2084]}, {"rowIndex": 2, "columnIndex": 1, "text": "2.00", + "boundingBox": [2.2935, 2.0078, 3.5904, 2.0078, 3.5904, 2.2034, 2.2935, 2.2034]}, + {"rowIndex": 2, "columnIndex": 2, "text": "1.00", "boundingBox": [3.5904, + 2.0078, 4.8981, 2.0078, 4.8981, 2.2034, 3.5904, 2.2034]}, {"rowIndex": 2, + "columnIndex": 3, "text": "3.00", "boundingBox": [4.8981, 2.0078, 6.1951, + 2.0128, 6.1951, 2.2034, 4.8981, 2.2034]}, {"rowIndex": 3, "columnIndex": 0, + "text": "", "boundingBox": [0.9965, 2.2084, 2.2935, 2.2034, 2.2935, 2.3991, + 0.9965, 2.3991]}, {"rowIndex": 3, "columnIndex": 1, "text": "1.00", "boundingBox": + [2.2935, 2.2034, 3.5904, 2.2034, 3.5904, 2.3991, 2.2935, 2.3991]}, {"rowIndex": + 3, "columnIndex": 2, "text": "4.00", "boundingBox": [3.5904, 2.2034, 4.8981, + 2.2034, 4.8981, 2.3991, 3.5904, 2.3991]}, {"rowIndex": 3, "columnIndex": 3, + "text": "5.00", "boundingBox": [4.8981, 2.2034, 6.1951, 2.2034, 6.1951, 2.3991, + 4.8981, 2.3991]}, {"rowIndex": 4, "columnIndex": 0, "text": "Pear", "boundingBox": + [0.9965, 2.3991, 2.2935, 2.3991, 2.2935, 2.5947, 0.9965, 2.5947]}, {"rowIndex": + 4, "columnIndex": 1, "text": "", "boundingBox": [2.2935, 2.3991, 3.5904, 2.3991, + 3.5958, 2.5947, 2.2935, 2.5947]}, {"rowIndex": 4, "columnIndex": 2, "text": + "2.00", "boundingBox": [3.5904, 2.3991, 4.8981, 2.3991, 4.8981, 2.5947, 3.5958, + 2.5947]}, {"rowIndex": 4, "columnIndex": 3, "text": "2.00", "boundingBox": + [4.8981, 2.3991, 6.1951, 2.3991, 6.1951, 2.5947, 4.8981, 2.5947]}], "boundingBox": + [0.9979, 1.6139, 6.2003, 1.6153, 6.1999, 2.5942, 0.9973, 2.5931]}]}], "documentResults": + [{"docType": "custom:747bee39-f021-4e7e-81a7-195ef72db354", "modelId": "747bee39-f021-4e7e-81a7-195ef72db354", + "pageRange": [1, 1], "fields": {"table": {"type": "array", "valueArray": [{"type": + "object", "valueObject": {"Item": {"type": "string", "valueString": "Apple", + "text": "Apple", "page": 1, "boundingBox": [1.08, 1.865, 1.445, 1.865, 1.445, + 1.995, 1.08, 1.995]}, "Price": {"type": "string", "valueString": "5.00", "text": + "5.00", "page": 1, "boundingBox": [2.385, 1.87, 2.645, 1.87, 2.645, 1.97, + 2.385, 1.97]}, "Tax": {"type": "string", "valueString": "2.00", "text": "2.00", + "page": 1, "boundingBox": [3.685, 1.87, 3.945, 1.87, 3.945, 1.97, 3.685, 1.97]}, + "Total": {"type": "string", "valueString": "7.00", "text": "7.00", "page": + 1, "boundingBox": [4.985, 1.87, 5.245, 1.87, 5.245, 1.97, 4.985, 1.97]}}}, + {"type": "object", "valueObject": {"Item": {"type": "string", "valueString": + "Orange", "text": "Orange", "page": 1, "boundingBox": [1.085, 2.065, 1.54, + 2.065, 1.54, 2.19, 1.085, 2.19]}, "Price": {"type": "string", "valueString": + "2.00", "text": "2.00", "page": 1, "boundingBox": [2.385, 2.065, 2.645, 2.065, + 2.645, 2.165, 2.385, 2.165]}, "Tax": {"type": "string", "valueString": "1.00", + "text": "1.00", "page": 1, "boundingBox": [3.69, 2.065, 3.945, 2.065, 3.945, + 2.165, 3.69, 2.165]}, "Total": {"type": "string", "valueString": "3.00", "text": + "3.00", "page": 1, "boundingBox": [4.985, 2.065, 5.245, 2.065, 5.245, 2.165, + 4.985, 2.165]}}}, {"type": "object", "valueObject": {"Item": null, "Price": + {"type": "string", "valueString": "1.00", "text": "1.00", "page": 1, "boundingBox": + [2.39, 2.26, 2.645, 2.26, 2.645, 2.36, 2.39, 2.36]}, "Tax": {"type": "string", + "valueString": "4.00", "text": "4.00", "page": 1, "boundingBox": [3.68, 2.26, + 3.945, 2.26, 3.945, 2.36, 3.68, 2.36]}, "Total": {"type": "string", "valueString": + "5.00", "text": "5.00", "page": 1, "boundingBox": [4.985, 2.26, 5.245, 2.26, + 5.245, 2.36, 4.985, 2.36]}}}, {"type": "object", "valueObject": {"Item": {"type": + "string", "valueString": "Pear", "text": "Pear", "page": 1, "boundingBox": + [1.09, 2.455, 1.365, 2.455, 1.365, 2.55, 1.09, 2.55]}, "Price": null, "Tax": + {"type": "string", "valueString": "2.00", "text": "2.00", "page": 1, "boundingBox": + [3.685, 2.45, 3.945, 2.45, 3.945, 2.55, 3.685, 2.55]}, "Total": {"type": "string", + "valueString": "2.00", "text": "2.00", "page": 1, "boundingBox": [4.985, 2.45, + 5.245, 2.45, 5.245, 2.55, 4.985, 2.55]}}}]}}, "docTypeConfidence": 0.995}], + "errors": []}}' + headers: + apim-request-id: 394d5b4f-ab4a-4733-9b71-f9e90f98a37e + content-length: '4914' + content-type: application/json; charset=utf-8 + date: Thu, 22 Apr 2021 01:03:11 GMT + strict-transport-security: max-age=31536000; includeSubDomains; preload + x-content-type-options: nosniff + x-envoy-upstream-service-time: '19' + status: + code: 200 + message: OK + url: https://region.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.3/custom/models/747bee39-f021-4e7e-81a7-195ef72db354/analyzeresults/fa322829-4150-49c2-80f4-1dc49201aba8 +version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url.py index 8b6a7dbf277f..4291c8420d29 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url.py @@ -448,3 +448,75 @@ def test_pages_kwarg_specified(self, client, formrecognizer_testing_data_contain assert '1' == poller._polling_method._initial_response.http_response.request.query['pages'] result = poller.result() assert result + + @FormRecognizerPreparer() + @GlobalClientPreparer() + def test_label_tables_variable_rows(self, client, formrecognizer_table_variable_rows_container_sas_url): + fr_client = client.get_form_recognizer_client() + + training_poller = client.begin_training(formrecognizer_table_variable_rows_container_sas_url, use_training_labels=True) + model = training_poller.result() + + responses = [] + + def callback(raw_response, _, headers): + analyze_result = fr_client._deserialize(AnalyzeOperationResult, raw_response) + form = prepare_form_result(analyze_result, model.model_id) + responses.append(analyze_result) + responses.append(form) + + poller = fr_client.begin_recognize_custom_forms_from_url( + model.model_id, + self.label_table_variable_row_url_pdf, + cls=callback + ) + form = poller.result() + actual = responses[0] + recognized_form = responses[1] + read_results = actual.analyze_result.read_results + document_results = actual.analyze_result.document_results + + for form, actual in zip(recognized_form, document_results): + self.assertEqual(form.page_range.first_page_number, actual.page_range[0]) + self.assertEqual(form.page_range.last_page_number, actual.page_range[1]) + self.assertEqual(form.form_type, "custom:"+model.model_id) + self.assertIsNotNone(form.form_type_confidence) + self.assertEqual(form.model_id, model.model_id) + self.assertEqual(type(form.fields["table"].value), list) + self.assertFormFieldsTransformCorrect(form.fields, actual.fields, read_results) + + @FormRecognizerPreparer() + @GlobalClientPreparer() + def test_label_tables_fixed_rows(self, client, formrecognizer_table_fixed_rows_container_sas_url): + fr_client = client.get_form_recognizer_client() + + training_poller = client.begin_training(formrecognizer_table_fixed_rows_container_sas_url, use_training_labels=True) + model = training_poller.result() + + responses = [] + + def callback(raw_response, _, headers): + analyze_result = fr_client._deserialize(AnalyzeOperationResult, raw_response) + form = prepare_form_result(analyze_result, model.model_id) + responses.append(analyze_result) + responses.append(form) + + poller = fr_client.begin_recognize_custom_forms_from_url( + model.model_id, + self.label_table_fixed_row_url_pdf, + cls=callback + ) + form = poller.result() + actual = responses[0] + recognized_form = responses[1] + read_results = actual.analyze_result.read_results + document_results = actual.analyze_result.document_results + + for form, actual in zip(recognized_form, document_results): + self.assertEqual(form.page_range.first_page_number, actual.page_range[0]) + self.assertEqual(form.page_range.last_page_number, actual.page_range[1]) + self.assertEqual(form.form_type, "custom:"+model.model_id) + self.assertIsNotNone(form.form_type_confidence) + self.assertEqual(form.model_id, model.model_id) + self.assertEqual(type(form.fields["table"].value), dict) + self.assertFormFieldsTransformCorrect(form.fields, actual.fields, read_results) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url_async.py index 052c41d20d2b..1930f6b82038 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_custom_forms_from_url_async.py @@ -487,3 +487,80 @@ async def test_pages_kwarg_specified(self, client, formrecognizer_testing_data_c assert '1' == poller._polling_method._initial_response.http_response.request.query['pages'] result = await poller.result() assert result + + @FormRecognizerPreparer() + @GlobalClientPreparer() + async def test_label_tables_variable_rows(self, client, formrecognizer_table_variable_rows_container_sas_url): + fr_client = client.get_form_recognizer_client() + + responses = [] + + def callback(raw_response, _, headers): + analyze_result = fr_client._deserialize(AnalyzeOperationResult, raw_response) + form = prepare_form_result(analyze_result, model.model_id) + responses.append(analyze_result) + responses.append(form) + + async with client: + training_poller = await client.begin_training( + formrecognizer_table_variable_rows_container_sas_url, use_training_labels=True) + model = await training_poller.result() + + poller = await fr_client.begin_recognize_custom_forms_from_url( + model.model_id, + self.label_table_variable_row_url_pdf, + cls=callback + ) + form = await poller.result() + + actual = responses[0] + recognized_form = responses[1] + read_results = actual.analyze_result.read_results + document_results = actual.analyze_result.document_results + + for form, actual in zip(recognized_form, document_results): + self.assertEqual(form.page_range.first_page_number, actual.page_range[0]) + self.assertEqual(form.page_range.last_page_number, actual.page_range[1]) + self.assertEqual(form.form_type, "custom:"+model.model_id) + self.assertIsNotNone(form.form_type_confidence) + self.assertEqual(form.model_id, model.model_id) + self.assertEqual(type(form.fields["table"].value), list) + self.assertFormFieldsTransformCorrect(form.fields, actual.fields, read_results) + + @FormRecognizerPreparer() + @GlobalClientPreparer() + async def test_label_tables_fixed_rows(self, client, formrecognizer_table_fixed_rows_container_sas_url): + fr_client = client.get_form_recognizer_client() + + responses = [] + + def callback(raw_response, _, headers): + analyze_result = fr_client._deserialize(AnalyzeOperationResult, raw_response) + form = prepare_form_result(analyze_result, model.model_id) + responses.append(analyze_result) + responses.append(form) + + async with client: + training_poller = await client.begin_training(formrecognizer_table_fixed_rows_container_sas_url, use_training_labels=True) + model = await training_poller.result() + + poller = await fr_client.begin_recognize_custom_forms_from_url( + model.model_id, + self.label_table_fixed_row_url_pdf, + cls=callback + ) + form = await poller.result() + + actual = responses[0] + recognized_form = responses[1] + read_results = actual.analyze_result.read_results + document_results = actual.analyze_result.document_results + + for form, actual in zip(recognized_form, document_results): + self.assertEqual(form.page_range.first_page_number, actual.page_range[0]) + self.assertEqual(form.page_range.last_page_number, actual.page_range[1]) + self.assertEqual(form.form_type, "custom:"+model.model_id) + self.assertIsNotNone(form.form_type_confidence) + self.assertEqual(form.model_id, model.model_id) + self.assertEqual(type(form.fields["table"].value), dict) + self.assertFormFieldsTransformCorrect(form.fields, actual.fields, read_results) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py index 49393ee75975..85af0835c6d7 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py @@ -152,6 +152,8 @@ def __init__(self, method_name): self.multipage_url_pdf = self.get_blob_url(testing_container_sas_url, "testingdata", "multipage_invoice1.pdf") self.multipage_table_url_pdf = self.get_blob_url(testing_container_sas_url, "testingdata", "multipagelayout.pdf") self.selection_mark_url_pdf = self.get_blob_url(testing_container_sas_url, "testingdata", "selection_mark_form.pdf") + self.label_table_variable_row_url_pdf = self.get_blob_url(testing_container_sas_url, "testingdata", "label_table_variable_rows1.pdf") + self.label_table_fixed_row_url_pdf = self.get_blob_url(testing_container_sas_url, "testingdata", "label_table_fixed_rows1.pdf") # file stream samples self.receipt_jpg = os.path.abspath(os.path.join(os.path.abspath(__file__), "..", "./sample_forms/receipt/contoso-allinone.jpg")) @@ -353,6 +355,8 @@ def assertFormFieldsTransformCorrect(self, form_fields, generated_fields, read_r return for label, expected in generated_fields.items(): + if expected is None: # None value occurs with labeled tables and empty cells + continue field_type = expected.type self.assertEqual(adjust_value_type(field_type), form_fields[label].value_type) self.assertEqual(label, form_fields[label].name) diff --git a/sdk/formrecognizer/test-resources.json b/sdk/formrecognizer/test-resources.json index 3b16e0f0fca7..ed991b471483 100644 --- a/sdk/formrecognizer/test-resources.json +++ b/sdk/formrecognizer/test-resources.json @@ -71,10 +71,6 @@ "type": "string", "defaultValue": "testingdata" }, - "selectionMarkTrainingDataContainer": { - "type": "string", - "defaultValue": "selectionmark" - }, "testingDataSasProperties": { "type": "object", "defaultValue": { @@ -110,6 +106,10 @@ "signedResource": "c" } }, + "selectionMarkTrainingDataContainer": { + "type": "string", + "defaultValue": "selectionmark" + }, "selectionMarkTrainingDataSasProperties": { "type": "object", "defaultValue": { @@ -118,6 +118,32 @@ "signedPermission": "rl", "signedResource": "c" } + }, + "labelTablesVariableRowsContainer": { + "type": "string", + "defaultValue": "labeled-tables-variable-rows" + }, + "labelTablesVariableRowsSasProperties": { + "type": "object", + "defaultValue": { + "canonicalizedResource": "[concat('/blob/', parameters('blobStorageAccount'), '/', parameters('labelTablesVariableRowsContainer'))]", + "signedExpiry": "[dateTimeAdd(utcNow('u'), 'PT3H')]", + "signedPermission": "rl", + "signedResource": "c" + } + }, + "labelTablesFixedRowsContainer": { + "type": "string", + "defaultValue": "labeled-tables-fixed-rows" + }, + "labelTablesFixedRowsSasProperties": { + "type": "object", + "defaultValue": { + "canonicalizedResource": "[concat('/blob/', parameters('blobStorageAccount'), '/', parameters('labelTablesFixedRowsContainer'))]", + "signedExpiry": "[dateTimeAdd(utcNow('u'), 'PT3H')]", + "signedPermission": "rl", + "signedResource": "c" + } } }, "variables": { @@ -199,6 +225,14 @@ "type": "string", "value": "[concat(reference(parameters('blobResourceId'), '2019-06-01').primaryEndpoints.blob, parameters('selectionMarkTrainingDataContainer'), '?', listServiceSas(parameters('blobResourceId'), '2019-06-01', parameters('selectionMarkTrainingDataSasProperties')).serviceSasToken)]" }, + "FORMRECOGNIZER_TABLE_VARIABLE_ROWS_CONTAINER_SAS_URL": { + "type": "string", + "value": "[concat(reference(parameters('blobResourceId'), '2019-06-01').primaryEndpoints.blob, parameters('labelTablesVariableRowsContainer'), '?', listServiceSas(parameters('blobResourceId'), '2019-06-01', parameters('labelTablesVariableRowsSasProperties')).serviceSasToken)]" + }, + "FORMRECOGNIZER_TABLE_FIXED_ROWS_CONTAINER_SAS_URL": { + "type": "string", + "value": "[concat(reference(parameters('blobResourceId'), '2019-06-01').primaryEndpoints.blob, parameters('labelTablesFixedRowsContainer'), '?', listServiceSas(parameters('blobResourceId'), '2019-06-01', parameters('labelTablesFixedRowsSasProperties')).serviceSasToken)]" + }, "FORMRECOGNIZER_REGION": { "type": "string", "value": "[parameters('location')]"