Skip to content

Commit

Permalink
Layout API update in FormRecognzier 2.0-preview (#7581)
Browse files Browse the repository at this point in the history
* Adding FR v2.0 API updates

* PR Validation: Fix typo, missing file ref.

* PR Validation: Fix missed typo

* PR Validation: fixing model verification errors, doc string fixes.

* Fixing model verification, added Receipts endpoints, related examples.

* Fixing semantic validation error

* Update labelFile param

* fixing types

* Fixing model validation errors

* Fixing model verification errors, other fixes.

* Fixing mode verification error.

* Fixing typo.

* Fixing doc strings, Location header update, Change response code for Analyze calls

* Incorporating feedback from Paul.

* Feedback from Florian, verification fix.

* Fixing for merge verification.

* fixing for model verification tests

* fixing model verification errors.

* fixing example file to correct useLabelFile option.

* Update for Layout Analysis

* Update result for layout

* Update for OCRLanguage parameter

* Update from PR comment

* Remove language as a parameter
  • Loading branch information
yungshinlintw authored and ChenTanyi committed Oct 25, 2019
1 parent cd6f6d6 commit c70c560
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,90 @@
}
}
}
},
"/layout/analyze": {
"post": {
"summary": "Analyze Layout",
"description": "Extract text and layout information from a given document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png' or 'image/tiff'. Alternatively, use 'application/json' type to specify the location (Uri or local path) of the document to be analyzed.",
"operationId": "AnalyzeLayoutAsync",
"consumes": [
"application/pdf",
"application/json",
"image/jpeg",
"image/png",
"image/tiff"
],
"produces": [
"application/json"
],
"parameters": [
{
"$ref": "#/parameters/FileStream"
}
],
"responses": {
"202": {
"description": "Request is queued successfully.",
"headers": {
"Operation-Location": {
"type": "string",
"description": "URL containing the resultId used to track the progress and obtain the result of the analyze operation."
}
}
},
"default": {
"description": "Response entity accompanying non-successful responses containing additional details about the error.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"x-ms-examples": {
"Analyze layout": {
"$ref": "./examples/LayoutBatch.json"
}
}
}
},
"/layout/analyzeResults/{resultId}": {
"get": {
"summary": "Get Analyze Layout Result",
"description": "Track the progress and obtain the result of the analyze layout operation",
"operationId": "GetAnalyzeLayoutResult",
"consumes": [],
"produces": [
"application/json"
],
"parameters": [
{
"name": "resultId",
"in": "path",
"description": "Analyze operation result identifier.",
"required": true,
"type": "string",
"format": "uuid"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/AnalyzeOperationResult"
}
},
"default": {
"description": "Response entity accompanying non-successful responses containing additional details about the error.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"x-ms-examples": {
"Get analyze layout result": {
"$ref": "./examples/LayoutBatchResult.json"
}
}
}
}
},
"definitions": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"parameters": {
"endpoint": "{endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"language": "en",
"body": {
}
},
"responses": {
"202": {
"headers": {
"Operation-Location": "{endpoint}/formrecognizer/v2.0-preview/layout/analyzeResults/{resultId}"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"parameters": {
"endpoint": "{endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"modelId": "{model Id}",
"resultId": "{result Id}",
"body": {}
},
"responses": {
"200": {
"body":{
"status": "succeeded",
"createdDateTime": "2019-05-01T10:53:21Z",
"lastUpdatedDateTime": "2019-05-01T10:53:23Z",
"analyzeResult": {
"version":"v2.0",
"readResults":[],
"pageResults":[]
}
}
}
}
}

0 comments on commit c70c560

Please sign in to comment.