Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add tests requested in feedback
  • Loading branch information
kristapratico committed Oct 6, 2020
commit 24b538072b94edd31d2f216477f49c7269e800e3
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ def callback_v2_1(raw_response, _, headers): # pylint: disable=unused-argument

cls = kwargs.pop("cls", None)
display_name = kwargs.pop("display_name", None)
if display_name and self.api_version == "2.0":
raise ValueError("'display_name' is only available for API version v2.1-preview and up")
continuation_token = kwargs.pop("continuation_token", None)
polling_interval = kwargs.pop("polling_interval", self._client._config.polling_interval)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ def callback_v2_1(raw_response, _, headers): # pylint: disable=unused-argument

cls = kwargs.pop("cls", None)
display_name = kwargs.pop("display_name", None)
if display_name and self.api_version == "2.0":
raise ValueError("'display_name' is only available for API version v2.1-preview and up")
continuation_token = kwargs.pop("continuation_token", None)
polling_interval = kwargs.pop("polling_interval", self._client._config.polling_interval)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,283 @@
interactions:
- request:
body: 'b''{"source": "containersasurl", "sourceFilter": {"prefix": "", "includeSubFolders":
false}, "useLabelFile": true}'''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '287'
Content-Type:
- application/json
User-Agent:
- azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0)
method: POST
uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.1/custom/models
response:
body:
string: ''
headers:
apim-request-id:
- a8a0c4b5-c9f9-4074-9717-0313a3650303
content-length:
- '0'
date:
- Tue, 06 Oct 2020 20:45:49 GMT
location:
- https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.1/custom/models/d5cb35f5-5444-4372-92cd-aa74f28c00ad
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- '39'
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.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0)
method: GET
uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.1/custom/models/d5cb35f5-5444-4372-92cd-aa74f28c00ad?includeKeys=true
response:
body:
string: '{"modelInfo": {"modelId": "d5cb35f5-5444-4372-92cd-aa74f28c00ad", "attributes":
{"isComposed": false}, "status": "ready", "createdDateTime": "2020-10-06T20:45:50Z",
"lastUpdatedDateTime": "2020-10-06T20:45:52Z"}, "trainResult": {"averageModelAccuracy":
0.96, "trainingDocuments": [{"documentName": "Form_1.jpg", "pages": 1, "status":
"succeeded"}, {"documentName": "Form_2.jpg", "pages": 1, "status": "succeeded"},
{"documentName": "Form_3.jpg", "pages": 1, "status": "succeeded"}, {"documentName":
"Form_4.jpg", "pages": 1, "status": "succeeded"}, {"documentName": "Form_5.jpg",
"pages": 1, "status": "succeeded"}], "fields": [{"fieldName": "CompanyAddress",
"accuracy": 0.8}, {"fieldName": "CompanyName", "accuracy": 1.0}, {"fieldName":
"CompanyPhoneNumber", "accuracy": 1.0}, {"fieldName": "DatedAs", "accuracy":
1.0}, {"fieldName": "Email", "accuracy": 0.8}, {"fieldName": "Merchant", "accuracy":
1.0}, {"fieldName": "PhoneNumber", "accuracy": 1.0}, {"fieldName": "PurchaseOrderNumber",
"accuracy": 1.0}, {"fieldName": "Quantity", "accuracy": 1.0}, {"fieldName":
"Signature", "accuracy": 0.8}, {"fieldName": "Subtotal", "accuracy": 1.0},
{"fieldName": "Tax", "accuracy": 1.0}, {"fieldName": "Total", "accuracy":
1.0}, {"fieldName": "VendorName", "accuracy": 1.0}, {"fieldName": "Website",
"accuracy": 1.0}], "errors": []}}'
headers:
apim-request-id:
- 0b321762-e949-4c24-8f49-aa171abb2919
content-type:
- application/json; charset=utf-8
date:
- Tue, 06 Oct 2020 20:45:55 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
- chunked
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- '14'
status:
code: 200
message: OK
- request:
body: 'b''{"source": "containersasurl", "sourceFilter": {"prefix": "", "includeSubFolders":
false}, "useLabelFile": true}'''
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '287'
Content-Type:
- application/json
User-Agent:
- azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0)
method: POST
uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.1/custom/models
response:
body:
string: ''
headers:
apim-request-id:
- 52cef737-5bed-4329-8fa4-38ce97838319
content-length:
- '0'
date:
- Tue, 06 Oct 2020 20:45:55 GMT
location:
- https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.1/custom/models/daea8e9f-05d6-4690-aeeb-cdf6113aa988
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- '41'
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.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0)
method: GET
uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.1/custom/models/daea8e9f-05d6-4690-aeeb-cdf6113aa988?includeKeys=true
response:
body:
string: '{"modelInfo": {"modelId": "daea8e9f-05d6-4690-aeeb-cdf6113aa988", "attributes":
{"isComposed": false}, "status": "ready", "createdDateTime": "2020-10-06T20:45:55Z",
"lastUpdatedDateTime": "2020-10-06T20:45:58Z"}, "trainResult": {"averageModelAccuracy":
0.96, "trainingDocuments": [{"documentName": "Form_1.jpg", "pages": 1, "status":
"succeeded"}, {"documentName": "Form_2.jpg", "pages": 1, "status": "succeeded"},
{"documentName": "Form_3.jpg", "pages": 1, "status": "succeeded"}, {"documentName":
"Form_4.jpg", "pages": 1, "status": "succeeded"}, {"documentName": "Form_5.jpg",
"pages": 1, "status": "succeeded"}], "fields": [{"fieldName": "CompanyAddress",
"accuracy": 0.8}, {"fieldName": "CompanyName", "accuracy": 1.0}, {"fieldName":
"CompanyPhoneNumber", "accuracy": 1.0}, {"fieldName": "DatedAs", "accuracy":
1.0}, {"fieldName": "Email", "accuracy": 0.8}, {"fieldName": "Merchant", "accuracy":
1.0}, {"fieldName": "PhoneNumber", "accuracy": 1.0}, {"fieldName": "PurchaseOrderNumber",
"accuracy": 1.0}, {"fieldName": "Quantity", "accuracy": 1.0}, {"fieldName":
"Signature", "accuracy": 0.8}, {"fieldName": "Subtotal", "accuracy": 1.0},
{"fieldName": "Tax", "accuracy": 1.0}, {"fieldName": "Total", "accuracy":
1.0}, {"fieldName": "VendorName", "accuracy": 1.0}, {"fieldName": "Website",
"accuracy": 1.0}], "errors": []}}'
headers:
apim-request-id:
- ebcdd1d1-5800-4d1b-a554-7850866a08f7
content-type:
- application/json; charset=utf-8
date:
- Tue, 06 Oct 2020 20:46:00 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
- chunked
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- '48'
status:
code: 200
message: OK
- request:
body: 'b''{"modelIds": ["d5cb35f5-5444-4372-92cd-aa74f28c00ad", "daea8e9f-05d6-4690-aeeb-cdf6113aa988"]}'''
headers:
Accept:
- application/json, text/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '94'
Content-Type:
- application/json
User-Agent:
- azsdk-python-ai-formrecognizer/3.1.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0)
method: POST
uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.1/custom/models/compose
response:
body:
string: ''
headers:
apim-request-id:
- f89e37b6-8da5-44ff-81e8-a08d1f45e9c6
content-length:
- '0'
date:
- Tue, 06 Oct 2020 20:46:01 GMT
location:
- https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.1/custom/models/922fbbe0-cce4-4527-a324-4e7e109493d9
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- '84'
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.0b1 Python/3.7.3 (Windows-10-10.0.19041-SP0)
method: GET
uri: https://centraluseuap.api.cognitive.microsoft.com/formrecognizer/v2.1-preview.1/custom/models/922fbbe0-cce4-4527-a324-4e7e109493d9?includeKeys=true
response:
body:
string: '{"modelInfo": {"modelId": "922fbbe0-cce4-4527-a324-4e7e109493d9", "attributes":
{"isComposed": true}, "status": "ready", "createdDateTime": "2020-10-06T20:46:01Z",
"lastUpdatedDateTime": "2020-10-06T20:46:01Z"}, "composedTrainResults": [{"averageModelAccuracy":
0.96, "trainingDocuments": [{"documentName": "Form_1.jpg", "pages": 1, "status":
"succeeded"}, {"documentName": "Form_2.jpg", "pages": 1, "status": "succeeded"},
{"documentName": "Form_3.jpg", "pages": 1, "status": "succeeded"}, {"documentName":
"Form_4.jpg", "pages": 1, "status": "succeeded"}, {"documentName": "Form_5.jpg",
"pages": 1, "status": "succeeded"}], "fields": [{"fieldName": "CompanyAddress",
"accuracy": 0.8}, {"fieldName": "CompanyName", "accuracy": 1.0}, {"fieldName":
"CompanyPhoneNumber", "accuracy": 1.0}, {"fieldName": "DatedAs", "accuracy":
1.0}, {"fieldName": "Email", "accuracy": 0.8}, {"fieldName": "Merchant", "accuracy":
1.0}, {"fieldName": "PhoneNumber", "accuracy": 1.0}, {"fieldName": "PurchaseOrderNumber",
"accuracy": 1.0}, {"fieldName": "Quantity", "accuracy": 1.0}, {"fieldName":
"Signature", "accuracy": 0.8}, {"fieldName": "Subtotal", "accuracy": 1.0},
{"fieldName": "Tax", "accuracy": 1.0}, {"fieldName": "Total", "accuracy":
1.0}, {"fieldName": "VendorName", "accuracy": 1.0}, {"fieldName": "Website",
"accuracy": 1.0}], "modelId": "daea8e9f-05d6-4690-aeeb-cdf6113aa988", "errors":
[]}, {"averageModelAccuracy": 0.96, "trainingDocuments": [{"documentName":
"Form_1.jpg", "pages": 1, "status": "succeeded"}, {"documentName": "Form_2.jpg",
"pages": 1, "status": "succeeded"}, {"documentName": "Form_3.jpg", "pages":
1, "status": "succeeded"}, {"documentName": "Form_4.jpg", "pages": 1, "status":
"succeeded"}, {"documentName": "Form_5.jpg", "pages": 1, "status": "succeeded"}],
"fields": [{"fieldName": "CompanyAddress", "accuracy": 0.8}, {"fieldName":
"CompanyName", "accuracy": 1.0}, {"fieldName": "CompanyPhoneNumber", "accuracy":
1.0}, {"fieldName": "DatedAs", "accuracy": 1.0}, {"fieldName": "Email", "accuracy":
0.8}, {"fieldName": "Merchant", "accuracy": 1.0}, {"fieldName": "PhoneNumber",
"accuracy": 1.0}, {"fieldName": "PurchaseOrderNumber", "accuracy": 1.0}, {"fieldName":
"Quantity", "accuracy": 1.0}, {"fieldName": "Signature", "accuracy": 0.8},
{"fieldName": "Subtotal", "accuracy": 1.0}, {"fieldName": "Tax", "accuracy":
1.0}, {"fieldName": "Total", "accuracy": 1.0}, {"fieldName": "VendorName",
"accuracy": 1.0}, {"fieldName": "Website", "accuracy": 1.0}], "modelId": "d5cb35f5-5444-4372-92cd-aa74f28c00ad",
"errors": []}]}'
headers:
apim-request-id:
- 18049688-50ef-40f6-a156-fb765fb974e0
content-type:
- application/json; charset=utf-8
date:
- Tue, 06 Oct 2020 20:46:05 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains; preload
transfer-encoding:
- chunked
x-content-type-options:
- nosniff
x-envoy-upstream-service-time:
- '90'
status:
code: 200
message: OK
version: 1
Loading