-
Notifications
You must be signed in to change notification settings - Fork 5.7k
FormRecognizerReceipt - Initial Commit. #6042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c30a385
00e4cf3
8dbcee7
90946c6
5812674
843f2f7
2c78f40
3840cae
29ea35b
6efacb5
292f8ba
781f7db
10c7f52
e137884
3753fc5
5ed88d4
9864cca
da9d7d3
81b6743
4d75131
29e2bc7
4e65e77
3ae0d35
4c99141
8385975
9b1f37a
355ce60
afc041b
c5ddd4b
0f9441c
6b2d1b2
0c0e7b2
96cb967
9e59952
a85c578
af8009b
fb11a90
4748bc0
e588f2f
8b27a4e
e8cce48
c73dbf1
808aa67
011ff10
2da631e
68cd858
f7634c2
4a2ffc9
a41344c
9fc0310
0070fb5
967a5e8
d526807
abdd49f
5f88348
9b2e05f
a5efc53
9c2b0e4
b93b646
e83304c
abd110f
f346e31
bf2cd12
e6f6927
67e3772
ef8d9f6
1dca244
f2a1c72
6b22120
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,258 @@ | ||
| { | ||
| "swagger": "2.0", | ||
| "info": { | ||
| "version": "1.0-preview", | ||
| "title": "Form Recognizer Client", | ||
| "description": "Extracts information from forms and images into structured data based on a model created by a set of representative training forms." | ||
| }, | ||
| "securityDefinitions": { | ||
| "apim_key": { | ||
| "type": "apiKey", | ||
| "name": "Ocp-Apim-Subscription-Key", | ||
| "in": "header" | ||
| } | ||
| }, | ||
| "security": [ | ||
| { | ||
| "apim_key": [] | ||
| } | ||
| ], | ||
| "x-ms-parameterized-host": { | ||
| "hostTemplate": "{Endpoint}/formrecognizer/v1.0-preview", | ||
| "useSchemePrefix": false, | ||
| "parameters": [ | ||
| { | ||
| "$ref": "FormRecognizerReceiptOcr.json#/parameters/Endpoint" | ||
| } | ||
| ] | ||
| }, | ||
| "schemes": [ | ||
| "https" | ||
| ], | ||
| "paths": { | ||
| "/prebuilt/receipt/asyncBatchAnalyze": { | ||
| "post": { | ||
| "description": "Batch Read Receipt operation. The response contains a field called 'Operation-Location', which contains the URL that you must use for your 'Get Read Receipt Result' operation.", | ||
| "operationId": "BatchReadReceipt", | ||
ramparab marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "parameters": [ | ||
| { | ||
| "$ref": "FormRecognizerReceiptOcr.json#/parameters/ImageUrl" | ||
| } | ||
| ], | ||
| "consumes": [ | ||
| "application/json" | ||
| ], | ||
| "produces": [ | ||
| "application/json" | ||
| ], | ||
| "responses": { | ||
| "202": { | ||
| "description": "The service has accepted the request and will start processing later. It will return 'Accepted' immediately and include an 'Operation-Location' header. Client side should further query the operation status using the URL specified in this header. The 'Operation-Location' URL will expire in 48 hours.", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like a long running operation
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is. Due to consistency with existing Cognitive Service APIs, we are not able to adopt the latest conventions. The API review board has agreed with this design. |
||
| "headers": { | ||
| "Operation-Location": { | ||
| "description": "URL to query for status of the operation. The URL will expire in 48 hours. ", | ||
| "type": "string" | ||
| } | ||
| } | ||
| }, | ||
| "default": { | ||
| "description": "Error response.", | ||
| "schema": { | ||
| "$ref": "FormRecognizerReceiptOcr.json#/definitions/ComputerVisionError" | ||
| } | ||
| } | ||
| }, | ||
| "x-ms-examples": { | ||
| "Successful 'Batch Read Receipt' request": { | ||
| "$ref": "./examples/SuccessfulBatchReadReceiptWithUrl.json" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "/prebuilt/receipt/operations/{operationId}": { | ||
| "get": { | ||
| "description": "This interface is used for getting the analysis results of a 'Batch Read Receipt' operation. The URL to this interface should be retrieved from the 'Operation-Location' field returned from the 'Batch Read Receipt' operation.", | ||
| "operationId": "GetReadReceiptResult", | ||
| "parameters": [ | ||
| { | ||
| "name": "operationId", | ||
| "in": "path", | ||
| "description": "Id of read operation returned in the response of a 'Batch Read Receipt' operation.", | ||
| "required": true, | ||
| "type": "string" | ||
| } | ||
| ], | ||
| "produces": [ | ||
| "application/json" | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "Returns the read operation status.", | ||
| "schema": { | ||
| "$ref": "#/definitions/readReceiptResult" | ||
| } | ||
| }, | ||
| "default": { | ||
| "description": "Error response.", | ||
| "schema": { | ||
| "$ref": "FormRecognizerReceiptOcr.json#/definitions/ComputerVisionError" | ||
| } | ||
| } | ||
| }, | ||
| "x-ms-examples": { | ||
| "Successful 'Get Read Receipt Result' request": { | ||
| "$ref": "./examples/SuccessfulReadReceiptResult.json" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "x-ms-paths": { | ||
| "/prebuilt/receipt/asyncBatchAnalyze?overload=stream": { | ||
| "post": { | ||
| "description": "Read Receipt operation. When you use the 'Batch Read Receipt' interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your 'Get Read Receipt Result' operation.", | ||
| "operationId": "BatchReadReceiptInStream", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "FormRecognizerReceiptOcr.json#/parameters/ImageStream" | ||
| } | ||
| ], | ||
| "consumes": [ | ||
| "application/octet-stream" | ||
| ], | ||
| "produces": [ | ||
| "application/json" | ||
| ], | ||
| "responses": { | ||
| "202": { | ||
| "description": "The service has accepted the request and will start processing later. It will return 'Accepted' immediately and include an 'Operation-Location' header. Client side should further query the operation status using the URL specified in this header. The 'Operation-Location' URL will expire in 48 hours.", | ||
| "headers": { | ||
| "Operation-Location": { | ||
| "description": "URL to query for status of the operation. The URL will expire in 48 hours. ", | ||
| "type": "string" | ||
| } | ||
| } | ||
| }, | ||
| "default": { | ||
| "description": "Error response.", | ||
| "schema": { | ||
| "$ref": "FormRecognizerReceiptOcr.json#/definitions/ComputerVisionError" | ||
| } | ||
| } | ||
| }, | ||
| "x-ms-examples": { | ||
| "Successful 'Batch Read Receipt' request": { | ||
| "$ref": "./examples/SuccessfulBatchReadReceiptWithStream.json" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "definitions": { | ||
| "readReceiptResult": { | ||
| "type": "object", | ||
| "description": "Analysis result of the 'Batch Read Receipt' operation.", | ||
| "properties": { | ||
| "status": { | ||
| "description": "Status of the read operation.", | ||
| "$ref": "FormRecognizerReceiptOcr.json#/definitions/OperationStatus" | ||
| }, | ||
| "recognitionResults": { | ||
| "description": "Text recognition result of the 'Batch Read Receipt' operation.", | ||
| "type": "array", | ||
| "items": { | ||
| "$ref": "FormRecognizerReceiptOcr.json#/definitions/TextRecognitionResult" | ||
| } | ||
| }, | ||
| "understandingResults": { | ||
| "description": "Semantic understanding result of the 'Batch Read Receipt' operation.", | ||
| "type": "array", | ||
| "items": { | ||
| "$ref": "#/definitions/understandingResult" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "understandingResult": { | ||
ramparab marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "description" : "A set of extracted fields corresponding to a semantic object, such as a receipt, in the input document.", | ||
| "properties": { | ||
| "pages": { | ||
| "description": "List of pages where the document is found.", | ||
| "type": "array", | ||
| "items": { | ||
| "type": "integer", | ||
| "x-nullable": false | ||
| } | ||
| }, | ||
| "fields": { | ||
| "description": "Dictionary of recognized field values.", | ||
| "type": "object", | ||
| "additionalProperties": { | ||
| "$ref": "#/definitions/fieldValue" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "elementReference": { | ||
| "description": "Reference to an OCR word.", | ||
| "properties": { | ||
| "$ref": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| }, | ||
| "fieldValue": { | ||
| "description": "Base class representing a recognized field value.", | ||
ramparab marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "type": "object", | ||
| "discriminator": "valueType", | ||
| "required": [ | ||
| "valueType" | ||
| ], | ||
| "properties": { | ||
| "valueType": { | ||
| "description": "Discriminator for derived types.", | ||
| "type": "string" | ||
| }, | ||
| "text": { | ||
| "description": "OCR text content of the recognized field.", | ||
| "type": "string" | ||
| }, | ||
| "elements": { | ||
| "description": "List of references to OCR words comprising the recognized field value.", | ||
| "type": "array", | ||
| "items": { | ||
| "$ref": "#/definitions/elementReference" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "stringValue": { | ||
| "description": "Recognized string field value.", | ||
| "allOf": [ | ||
| { | ||
| "$ref": "#/definitions/fieldValue" | ||
| } | ||
| ], | ||
| "properties": { | ||
| "value": { | ||
| "description": "String value of the recognized field.", | ||
| "type": "string" | ||
| } | ||
| } | ||
| }, | ||
| "numberValue": { | ||
| "description": "Recognized numeric field value.", | ||
| "allOf": [ | ||
| { | ||
| "$ref": "#/definitions/fieldValue" | ||
| } | ||
| ], | ||
| "properties": { | ||
| "value": { | ||
| "description": "Numeric value of the recognized field.", | ||
| "type": "number" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are URLs dependent on api version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is the convention for Cognitive Services.