From ccbf217a49776f93ffd1d55c3c0dec1fc2976ffd Mon Sep 17 00:00:00 2001 From: Sandeep Parab Date: Tue, 15 Sep 2020 22:50:44 -0700 Subject: [PATCH 01/19] Initial update for .preview.2 release. --- .../v2.1-preview.2/FormRecognizer.json | 2081 +++++++++++++++++ .../v2.1-preview.2/examples/AnalyzeBatch.json | 16 + .../examples/AnalyzeOperationResult.json | 25 + .../examples/BusinessCardBatch.json | 17 + .../examples/BusinessCardBatchResult.json | 24 + .../examples/ComposeModels.json | 21 + .../v2.1-preview.2/examples/CopyModel.json | 25 + .../examples/CopyModelAuthorization.json | 20 + .../examples/CopyOperationResult.json | 23 + .../CopyOperationResultWithErrors.json | 28 + .../v2.1-preview.2/examples/DeleteModel.json | 11 + .../v2.1-preview.2/examples/GetModel.json | 59 + .../v2.1-preview.2/examples/GetModels.json | 43 + .../examples/GetModelsSummary.json | 20 + .../v2.1-preview.2/examples/InvoiceBatch.json | 15 + .../examples/InvoiceBatchResult.json | 24 + .../v2.1-preview.2/examples/LayoutBatch.json | 16 + .../examples/LayoutBatchResult.json | 22 + .../examples/ReceiptsBatch.json | 15 + .../examples/ReceiptsBatchResult.json | 24 + .../v2.1-preview.2/examples/TrainBatch.json | 18 + .../examples/TrainBatchWithSubFolders.json | 23 + 22 files changed, 2570 insertions(+) create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/AnalyzeBatch.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/AnalyzeOperationResult.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/BusinessCardBatch.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/BusinessCardBatchResult.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/ComposeModels.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/CopyModel.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/CopyModelAuthorization.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/CopyOperationResult.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/CopyOperationResultWithErrors.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/DeleteModel.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/GetModel.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/GetModels.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/GetModelsSummary.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/InvoiceBatch.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/InvoiceBatchResult.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/LayoutBatch.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/LayoutBatchResult.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/ReceiptsBatch.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/ReceiptsBatchResult.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/TrainBatch.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/TrainBatchWithSubFolders.json diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json new file mode 100644 index 000000000000..7db85c6df910 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json @@ -0,0 +1,2081 @@ +{ + "swagger": "2.0", + "info": { + "version": "2.1-preview.2", + "title": "Form Recognizer Client", + "description": "Extracts information from forms and images into structured data." + }, + "securityDefinitions": { + "apim_key": { + "type": "apiKey", + "name": "Ocp-Apim-Subscription-Key", + "in": "header" + } + }, + "security": [ + { + "apim_key": [] + } + ], + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}/formrecognizer/v2.1-preview.2", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "#/parameters/Endpoint" + } + ] + }, + "schemes": [ + "https" + ], + "paths": { + "/custom/models": { + "post": { + "summary": "Train Custom Model", + "description": "Create and train a custom model. The request must include a source parameter that is either an externally accessible Azure storage blob container Uri (preferably a Shared Access Signature Uri) or valid path to a data folder in a locally mounted drive. When local paths are specified, they must follow the Linux/Unix path format and be an absolute path rooted to the input mount configuration setting value e.g., if '{Mounts:Input}' configuration setting value is '/input' then a valid source path would be '/input/contosodataset'. All data to be trained is expected to be under the source folder or sub folders under it. Models are trained using documents that are of the following content type - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff'. Other type of content is ignored.", + "operationId": "TrainCustomModelAsync", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "trainRequest", + "in": "body", + "description": "Training request parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/TrainRequest" + } + } + ], + "responses": { + "201": { + "description": "Request is queued successfully.", + "headers": { + "Location": { + "type": "string", + "description": "Location and ID of the model being trained. The status of model training is specified in the status property at the model location." + } + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Train custom model": { + "$ref": "./examples/TrainBatch.json" + }, + "Train custom model with subfolder filter options": { + "$ref": "./examples/TrainBatchWithSubFolders.json" + } + }, + "x-ms-long-running-operation": true + } + }, + "/custom/models/{modelId}": { + "get": { + "summary": "Get Custom Model", + "description": "Get detailed information about a custom model.", + "operationId": "GetCustomModel", + "consumes": [], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "modelId", + "in": "path", + "description": "Model identifier.", + "required": true, + "type": "string", + "format": "uuid" + }, + { + "name": "includeKeys", + "in": "query", + "description": "Include list of extracted keys in model information.", + "required": false, + "default": false, + "type": "boolean", + "x-nullable": false + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Model" + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get custom model": { + "$ref": "./examples/GetModel.json" + } + } + }, + "delete": { + "summary": "Delete Custom Model", + "description": "Mark model for deletion. Model artifacts will be permanently removed within a predetermined period.", + "operationId": "DeleteCustomModel", + "consumes": [], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "modelId", + "in": "path", + "description": "Model identifier.", + "required": true, + "type": "string", + "format": "uuid" + } + ], + "responses": { + "204": { + "description": "Successfully marked model for deletion. Model artifacts will be removed within a predefined time period." + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete custom model": { + "$ref": "./examples/DeleteModel.json" + } + } + } + }, + "/custom/models/{modelId}/analyze": { + "post": { + "summary": "Analyze Form", + "description": "Extract key-value pairs, tables, and semantic values 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": "AnalyzeWithCustomModel", + "consumes": [ + "application/pdf", + "application/json", + "image/jpeg", + "image/png", + "image/tiff", + "image/bmp" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "modelId", + "in": "path", + "description": "Model identifier.", + "required": true, + "type": "string", + "format": "uuid" + }, + { + "name": "includeTextDetails", + "in": "query", + "description": "Include text lines and element references in the result.", + "required": false, + "default": false, + "type": "boolean", + "x-nullable": false + }, + { + "$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 form with custom model": { + "$ref": "./examples/AnalyzeBatch.json" + } + }, + "x-ms-long-running-operation": true + } + }, + "/custom/models/{modelId}/analyzeResults/{resultId}": { + "get": { + "summary": "Get Analyze Form Result", + "description": "Obtain current status and the result of the analyze form operation.", + "operationId": "GetAnalyzeFormResult", + "consumes": [], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "modelId", + "in": "path", + "description": "Model identifier.", + "required": true, + "type": "string", + "format": "uuid" + }, + { + "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 form result": { + "$ref": "./examples/AnalyzeOperationResult.json" + } + } + } + }, + "/custom/models/{modelId}/copy": { + "post": { + "summary": "Copy Custom Model", + "description": "Copy custom model stored in this resource (the source) to user specified target Form Recognizer resource.", + "operationId": "CopyCustomModel", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "modelId", + "in": "path", + "description": "Model identifier.", + "required": true, + "type": "string", + "format": "uuid" + }, + { + "name": "copyRequest", + "in": "body", + "description": "Copy request parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/CopyRequest" + } + } + ], + "responses": { + "202": { + "description": "Copy 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 copy operation." + } + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Copy custom model": { + "$ref": "./examples/CopyModel.json" + } + }, + "x-ms-long-running-operation": true + } + }, + "/custom/models/{modelId}/copyResults/{resultId}": { + "get": { + "summary": "Get Custom Model Copy Result", + "description": "Obtain current status and the result of a custom model copy operation.", + "operationId": "GetCustomModelCopyResult", + "consumes": [], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "modelId", + "in": "path", + "description": "Model identifier.", + "required": true, + "type": "string", + "format": "uuid" + }, + { + "name": "resultId", + "in": "path", + "description": "Copy operation result identifier.", + "required": true, + "type": "string", + "format": "uuid" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/CopyOperationResult" + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get copy custom model result": { + "$ref": "./examples/CopyOperationResult.json" + }, + "Get copy custom model result with failures": { + "$ref": "./examples/CopyOperationResultWithErrors.json" + } + } + } + }, + "/custom/models/copyAuthorization": { + "post": { + "summary": "Generate Copy Authorization", + "description": "Generate authorization to copy a model into the target Form Recognizer resource.", + "operationId": "GenerateModelCopyAuthorization", + "consumes": [], + "produces": [ + "application/json" + ], + "parameters": [], + "responses": { + "201": { + "description": "Copy request is authorized successfully.", + "headers": { + "Location": { + "type": "string", + "description": "Location and ID of the model being copied. The status of model copy is specified in the status property at the model location." + } + }, + "schema": { + "$ref": "#/definitions/CopyAuthorizationResult" + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Copy custom model": { + "$ref": "./examples/CopyModelAuthorization.json" + } + } + } + }, + "/custom/models/compose": { + "post": { + "tags": [ + "Form" + ], + "summary": "Compose trained with labels models into one composed model.", + "description": "Compose request would include list of models ids.\r\nIt would validate what all models either trained with labels model or composed model.\r\nIt would validate limit of models put together.", + "operationId": "ComposeCustomModelsAsync", + "consumes": [], + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "composeRequest", + "in": "body", + "description": "Compose models", + "required": true, + "schema": { + "$ref": "#/definitions/ComposeRequest" + } + } + ], + "responses": { + "201": { + "description": "Request is queued successfully.", + "headers": { + "Location": { + "type": "string", + "description": "Location and ID of the composed model. The status of composed model is specified in the status property at the model location." + } + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Compose custom models": { + "$ref": "./examples/ComposeModels.json" + } + }, + "x-ms-long-running-operation": true + } + }, + "/prebuilt/businessCard/analyze": { + "post": { + "summary": "Analyze Business Card", + "description": "Extract field text and semantic values from a given business card 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) of the document to be analyzed.", + "operationId": "AnalyzeBusinessCardAsync", + "consumes": [ + "application/pdf", + "application/json", + "image/jpeg", + "image/png", + "image/tiff", + "image/bmp" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "includeTextDetails", + "in": "query", + "description": "Include text lines and element references in the result.", + "required": false, + "default": false, + "type": "boolean", + "x-nullable": false + }, + { + "name": "locale", + "in": "query", + "description": "Locale of the business card. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default).", + "required": false, + "type": "string" + }, + { + "$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 Business Card": { + "$ref": "./examples/BusinessCardBatch.json" + } + }, + "x-ms-long-running-operation": true + } + }, + "/prebuilt/businessCard/analyzeResults/{resultId}": { + "get": { + "summary": "Get Analyze Business Card Result", + "description": "Track the progress and obtain the result of the analyze business card operation.", + "operationId": "GetAnalyzeBusinessCardResult", + "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 business card result": { + "$ref": "./examples/BusinessCardBatchResult.json" + } + } + } + }, + "/prebuilt/invoice/analyze": { + "post": { + "summary": "Analyze Invoice Document", + "description": "Extract field text and semantic values from a given invoice 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) of the document to be analyzed.", + "operationId": "AnalyzeInvoiceAsync", + "consumes": [ + "application/pdf", + "application/json", + "image/jpeg", + "image/png", + "image/tiff", + "image/bmp" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "includeTextDetails", + "in": "query", + "description": "Include text lines and element references in the result.", + "required": false, + "default": false, + "type": "boolean", + "x-nullable": false + }, + { + "name": "locale", + "in": "query", + "description": "Locale of the invoice. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default).", + "required": false, + "type": "string" + }, + { + "$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 receipt": { + "$ref": "./examples/InvoiceBatch.json" + } + }, + "x-ms-long-running-operation": true + } + }, + "/prebuilt/invoice/analyzeResults/{resultId}": { + "get": { + "summary": "Get Analyze Invoice Result", + "description": "Track the progress and obtain the result of the analyze invoice operation.", + "operationId": "GetAnalyzeInvoiceResult", + "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 receipt result": { + "$ref": "./examples/InvoiceBatchResult.json" + } + } + } + }, + "/prebuilt/receipt/analyze": { + "post": { + "summary": "Analyze Receipt", + "description": "Extract field text and semantic values from a given receipt 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) of the document to be analyzed.", + "operationId": "AnalyzeReceiptAsync", + "consumes": [ + "application/pdf", + "application/json", + "image/jpeg", + "image/png", + "image/tiff", + "image/bmp" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "includeTextDetails", + "in": "query", + "description": "Include text lines and element references in the result.", + "required": false, + "default": false, + "type": "boolean", + "x-nullable": false + }, + { + "name": "locale", + "in": "query", + "description": "Locale of the receipt. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default).", + "required": false, + "type": "string" + }, + { + "$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 receipt": { + "$ref": "./examples/ReceiptsBatch.json" + } + }, + "x-ms-long-running-operation": true + } + }, + "/prebuilt/receipt/analyzeResults/{resultId}": { + "get": { + "summary": "Get Analyze Receipt Result", + "description": "Track the progress and obtain the result of the analyze receipt operation.", + "operationId": "GetAnalyzeReceiptResult", + "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 receipt result": { + "$ref": "./examples/ReceiptsBatchResult.json" + } + } + } + }, + "/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", + "image/bmp" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/FileStream" + }, + { + "name": "pageRange", + "in": "query", + "description": "Specify page number or range of page numbers to process, e.g: 1, 5 , 7, 9-10", + "required": false, + "type": "string" + } + ], + "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" + } + }, + "x-ms-long-running-operation": true + } + }, + "/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" + } + } + } + } + }, + "x-ms-paths": { + "/custom/models?op=full": { + "get": { + "summary": "List Custom Models", + "description": "Get information about all custom models", + "operationId": "ListCustomModels", + "consumes": [], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "op", + "in": "query", + "description": "Specify whether to return summary or full list of models.", + "required": true, + "type": "string", + "enum": [ + "full" + ] + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Models" + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink", + "itemName": "modelList" + }, + "x-ms-examples": { + "List custom models": { + "$ref": "./examples/GetModels.json" + } + } + } + }, + "/custom/models?op=summary": { + "get": { + "summary": "Get Custom Models", + "description": "Get information about all custom models", + "operationId": "GetCustomModels", + "consumes": [], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "op", + "in": "query", + "description": "Specify whether to return summary or full list of models.", + "required": true, + "type": "string", + "enum": [ + "summary" + ] + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Models" + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get models summary": { + "$ref": "./examples/GetModelsSummary.json" + } + } + } + } + }, + "definitions": { + "OperationStatus": { + "type": "string", + "description": "Status of the queued operation.", + "enum": [ + "notStarted", + "running", + "succeeded", + "failed", + "partiallyCompleted" + ], + "x-ms-enum": { + "name": "OperationStatus", + "modelAsString": false + }, + "x-nullable": false + }, + "CopyAuthorizationResult": { + "description": "Request parameter that contains authorization claims for copy operation.", + "required": [ + "modelId", + "accessToken", + "expirationDateTimeTicks" + ], + "type": "object", + "properties": { + "modelId": { + "description": "Model identifier.", + "type": "string" + }, + "accessToken": { + "description": "Token claim used to authorize the request.", + "type": "string" + }, + "expirationDateTimeTicks": { + "description": "The time when the access token expires. The date is represented as the number of seconds from 1970-01-01T0:0:0Z UTC until the expiration time.", + "type": "integer", + "format": "int64" + } + } + }, + "CopyRequest": { + "description": "Request parameter to copy an existing custom model from the source resource to a target resource referenced by the resource ID.", + "required": [ + "targetResourceId", + "targetResourceRegion", + "copyAuthorization" + ], + "type": "object", + "properties": { + "targetResourceId": { + "description": "Azure Resource Id of the target Form Recognizer resource where the model is copied to.", + "maxLength": 1024, + "type": "string", + "pattern": "^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.CognitiveServices/accounts/[^/]*$", + "x-ms-azure-resource": true + }, + "targetResourceRegion": { + "description": "Location of the target Azure resource. A valid Azure region name supported by Cognitive Services.", + "type": "string", + "pattern": "^[a-z0-9]+$", + "minLength": 1, + "maxLength": 24 + }, + "copyAuthorization": { + "description": "Entity that encodes claims to authorize the copy request.", + "$ref": "#/definitions/CopyAuthorizationResult" + } + } + }, + "CopyOperationResult": { + "description": "Status and result of the queued copy operation.", + "type": "object", + "required": [ + "status", + "createdDateTime", + "lastUpdatedDateTime" + ], + "properties": { + "status": { + "description": "Operation status.", + "$ref": "#/definitions/OperationStatus" + }, + "createdDateTime": { + "format": "date-time", + "description": "Date and time (UTC) when the copy operation was submitted.", + "type": "string", + "x-nullable": false + }, + "lastUpdatedDateTime": { + "format": "date-time", + "description": "Date and time (UTC) when the status was last updated.", + "type": "string", + "x-nullable": false + }, + "copyResult": { + "description": "Results of the copy operation.", + "$ref": "#/definitions/CopyResult" + } + } + }, + "CopyResult": { + "description": "Custom model copy result.", + "type": "object", + "required": [ + "modelId" + ], + "properties": { + "modelId": { + "description": "Identifier of the target model.", + "type": "string", + "format": "uuid" + }, + "errors": { + "description": "Errors returned during the copy operation.", + "type": "array", + "items": { + "$ref": "#/definitions/ErrorInformation" + } + } + } + }, + "AnalyzeOperationResult": { + "description": "Status and result of the queued analyze operation.", + "type": "object", + "required": [ + "status", + "createdDateTime", + "lastUpdatedDateTime" + ], + "properties": { + "status": { + "description": "Operation status.", + "$ref": "#/definitions/OperationStatus" + }, + "createdDateTime": { + "format": "date-time", + "description": "Date and time (UTC) when the analyze operation was submitted.", + "type": "string", + "x-nullable": false + }, + "lastUpdatedDateTime": { + "format": "date-time", + "description": "Date and time (UTC) when the status was last updated.", + "type": "string", + "x-nullable": false + }, + "analyzeResult": { + "description": "Results of the analyze operation.", + "$ref": "#/definitions/AnalyzeResult" + } + } + }, + "ModelName": { + "description": "Optional user defined model name (max length: 1024).", + "type": "string", + "x-nullable": false + }, + "TrainRequest": { + "description": "Request parameter to train a new custom model.", + "required": [ + "source" + ], + "type": "object", + "properties": { + "source": { + "description": "Source path containing the training documents.", + "maxLength": 2048, + "minLength": 0, + "type": "string" + }, + "sourceFilter": { + "$ref": "#/definitions/TrainSourceFilter", + "description": "Filter to apply to the documents in the source path for training." + }, + "useLabelFile": { + "description": "Use label file for training a model.", + "type": "boolean", + "default": false + }, + "modelName": { + "$ref": "#/definitions/ModelName" + } + } + }, + "TrainSourceFilter": { + "description": "Filter to apply to the documents in the source path for training.", + "type": "object", + "properties": { + "prefix": { + "description": "A case-sensitive prefix string to filter documents in the source path for training. For example, when using a Azure storage blob Uri, use the prefix to restrict sub folders for training.", + "maxLength": 1024, + "minLength": 0, + "type": "string" + }, + "includeSubFolders": { + "description": "A flag to indicate if sub folders within the set of prefix folders will also need to be included when searching for content to be preprocessed.", + "type": "boolean", + "default": false, + "x-nullable": false + } + } + }, + "TrainResult": { + "description": "Custom model training result.", + "type": "object", + "required": [ + "trainingDocuments" + ], + "properties": { + "trainingDocuments": { + "description": "List of the documents used to train the model and any errors reported in each document.", + "type": "array", + "items": { + "$ref": "#/definitions/TrainingDocumentInfo" + } + }, + "fields": { + "description": "List of fields used to train the model and the train operation error reported by each.", + "type": "array", + "items": { + "$ref": "#/definitions/FormFieldsReport" + } + }, + "averageModelAccuracy": { + "description": "Average accuracy.", + "type": "number", + "x-nullable": false + }, + "modelId": { + "description": "Model identifier.", + "type": "string", + "format": "uuid", + "x-nullable": false + }, + "errors": { + "description": "Errors returned during the training operation.", + "type": "array", + "items": { + "$ref": "#/definitions/ErrorInformation" + } + } + } + }, + "SourcePath": { + "description": "Uri or local path to source data.", + "type": "object", + "properties": { + "source": { + "description": "File source path.", + "maxLength": 2048, + "minLength": 0, + "type": "string" + } + } + }, + "Attributes": { + "description": "Optional model attributes.", + "type": "object", + "properties": { + "isComposed": { + "description": "Is this model composed? (default: false).", + "type": "boolean", + "default": false, + "x-nullable": false + } + } + }, + "ModelInfo": { + "description": "Basic custom model information.", + "type": "object", + "required": [ + "modelId", + "status", + "createdDateTime", + "lastUpdatedDateTime" + ], + "properties": { + "modelId": { + "description": "Model identifier.", + "type": "string", + "format": "uuid", + "x-nullable": false + }, + "status": { + "description": "Status of the model.", + "enum": [ + "creating", + "ready", + "invalid" + ], + "type": "string", + "x-ms-enum": { + "name": "ModelStatus", + "modelAsString": false + }, + "x-nullable": false + }, + "createdDateTime": { + "format": "date-time", + "description": "Date and time (UTC) when the model was created.", + "type": "string", + "x-nullable": false + }, + "lastUpdatedDateTime": { + "format": "date-time", + "description": "Date and time (UTC) when the status was last updated.", + "type": "string", + "x-nullable": false + }, + "modelName": { + "$ref": "#/definitions/ModelName" + }, + "attributes": { + "$ref": "#/definitions/Attributes" + } + } + }, + "Models": { + "description": "Response to the list custom models operation.", + "type": "object", + "properties": { + "summary": { + "description": "Summary of all trained custom models.", + "type": "object", + "required": [ + "count", + "limit", + "lastUpdatedDateTime" + ], + "properties": { + "count": { + "description": "Current count of trained custom models.", + "type": "integer", + "x-nullable": false + }, + "limit": { + "description": "Max number of models that can be trained for this account.", + "type": "integer", + "x-nullable": false + }, + "lastUpdatedDateTime": { + "format": "date-time", + "description": "Date and time (UTC) when the summary was last updated.", + "type": "string", + "x-nullable": false + } + } + }, + "modelList": { + "description": "Collection of trained custom models.", + "type": "array", + "items": { + "$ref": "#/definitions/ModelInfo" + } + }, + "nextLink": { + "description": "Link to the next page of custom models.", + "type": "string" + } + } + }, + "Model": { + "description": "Response to the get custom model operation.", + "type": "object", + "required": [ + "modelInfo" + ], + "properties": { + "modelInfo": { + "$ref": "#/definitions/ModelInfo" + }, + "keys": { + "$ref": "#/definitions/KeysResult" + }, + "trainResult": { + "description": "Training result for custom model.", + "$ref": "#/definitions/TrainResult" + }, + "composedTrainResults": { + "type": "array", + "description": "Training result for composed model.", + "items": { + "$ref": "#/definitions/TrainResult" + } + } + } + }, + "KeysResult": { + "description": "Keys extracted by the custom model.", + "type": "object", + "required": [ + "clusters" + ], + "properties": { + "clusters": { + "description": "Object mapping clusterIds to a list of keys.", + "type": "object", + "additionalProperties": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string" + } + } + } + } + }, + "TrainingDocumentInfo": { + "description": "Report for a custom model training document.", + "type": "object", + "required": [ + "documentName", + "pages", + "errors", + "status" + ], + "properties": { + "documentName": { + "description": "Training document name.", + "type": "string" + }, + "pages": { + "format": "int32", + "description": "Total number of pages trained.", + "type": "integer", + "x-nullable": false + }, + "errors": { + "description": "List of errors.", + "type": "array", + "items": { + "$ref": "#/definitions/ErrorInformation" + } + }, + "status": { + "description": "Status of the training operation.", + "enum": [ + "succeeded", + "partiallySucceeded", + "failed" + ], + "type": "string", + "x-ms-enum": { + "name": "TrainStatus", + "modelAsString": false + }, + "x-nullable": false + } + } + }, + "FormFieldsReport": { + "description": "Report for a custom model training field.", + "type": "object", + "required": [ + "fieldName", + "accuracy" + ], + "properties": { + "fieldName": { + "description": "Training field name.", + "type": "string" + }, + "accuracy": { + "description": "Estimated extraction accuracy for this field.", + "type": "number", + "x-nullable": false + } + } + }, + "ErrorResponse": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "$ref": "#/definitions/ErrorInformation" + } + } + }, + "ErrorInformation": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, + "ComposeRequest": { + "description": "Request contract for compose operation.", + "required": [ + "modelIds" + ], + "type": "object", + "properties": { + "modelIds": { + "description": "List of model ids to compose.", + "uniqueItems": false, + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "modelName": { + "$ref": "#/definitions/ModelName" + } + } + }, + "AnalyzeResult": { + "description": "Analyze operation result.", + "type": "object", + "required": [ + "version", + "readResults" + ], + "properties": { + "version": { + "description": "Version of schema used for this result.", + "type": "string" + }, + "readResults": { + "description": "Text extracted from the input.", + "type": "array", + "items": { + "$ref": "#/definitions/ReadResult" + } + }, + "pageResults": { + "description": "Page-level information extracted from the input.", + "type": "array", + "items": { + "$ref": "#/definitions/PageResult" + } + }, + "documentResults": { + "description": "Document-level information extracted from the input.", + "type": "array", + "items": { + "$ref": "#/definitions/DocumentResult" + } + }, + "errors": { + "description": "List of errors reported during the analyze operation.", + "type": "array", + "items": { + "$ref": "#/definitions/ErrorInformation" + } + } + } + }, + "ReadResult": { + "description": "Text extracted from a page in the input document.", + "type": "object", + "required": [ + "page", + "angle", + "width", + "height", + "unit" + ], + "properties": { + "page": { + "description": "The 1-based page number in the input document.", + "type": "integer", + "minimum": 1, + "x-nullable": false + }, + "angle": { + "description": "The general orientation of the text in clockwise direction, measured in degrees between (-180, 180].", + "type": "number", + "minimum": -180, + "maximum": 180, + "exclusiveMinimum": true, + "x-nullable": false + }, + "width": { + "description": "The width of the image/PDF in pixels/inches, respectively.", + "type": "number", + "minimum": 0, + "x-nullable": false + }, + "height": { + "description": "The height of the image/PDF in pixels/inches, respectively.", + "type": "number", + "minimum": 0, + "x-nullable": false + }, + "unit": { + "description": "The unit used by the width, height and boundingBox properties. For images, the unit is \"pixel\". For PDF, the unit is \"inch\".", + "type": "string", + "enum": [ + "pixel", + "inch" + ], + "x-ms-enum": { + "name": "LengthUnit", + "modelAsString": false + }, + "x-nullable": false + }, + "language": { + "description": "The detected language on the page overall.", + "$ref": "#/definitions/Language" + }, + "lines": { + "description": "When includeTextDetails is set to true, a list of recognized text lines. The maximum number of lines returned is 300 per page. The lines are sorted top to bottom, left to right, although in certain cases proximity is treated with higher priority. As the sorting order depends on the detected text, it may change across images and OCR version updates. Thus, business logic should be built upon the actual line location instead of order.", + "type": "array", + "items": { + "$ref": "#/definitions/TextLine" + } + }, + "selectionMarks": { + "description": "List of selection marks extracted from the page.", + "type": "array", + "items": { + "$ref": "#/definitions/SelectionMark" + } + } + } + }, + "Language": { + "description": "Language code", + "type": "string", + "enum": [ + "en", + "es" + ], + "x-ms-enum": { + "name": "Language", + "modelAsString": true + }, + "x-nullable": false + }, + "TextLine": { + "description": "An object representing an extracted text line.", + "type": "object", + "required": [ + "text", + "boundingBox", + "words" + ], + "properties": { + "text": { + "description": "The text content of the line.", + "type": "string" + }, + "boundingBox": { + "description": "Bounding box of an extracted line.", + "$ref": "#/definitions/BoundingBox" + }, + "language": { + "description": "The detected language of this line, if different from the overall page language.", + "$ref": "#/definitions/Language" + }, + "words": { + "description": "List of words in the text line.", + "type": "array", + "items": { + "$ref": "#/definitions/TextWord" + } + } + } + }, + "TextWord": { + "description": "An object representing a word.", + "type": "object", + "required": [ + "boundingBox", + "text" + ], + "properties": { + "text": { + "description": "The text content of the word.", + "type": "string" + }, + "boundingBox": { + "description": "Bounding box of an extracted word.", + "$ref": "#/definitions/BoundingBox" + }, + "confidence": { + "description": "Confidence value.", + "$ref": "#/definitions/Confidence" + } + } + }, + "BoundingBox": { + "description": "Quadrangle bounding box, with coordinates specified relative to the top-left of the original image. The eight numbers represent the four points, clockwise from the top-left corner relative to the text orientation. For image, the (x, y) coordinates are measured in pixels. For PDF, the (x, y) coordinates are measured in inches.", + "type": "array", + "minItems": 8, + "maxItems": 8, + "items": { + "type": "number", + "x-nullable": false + } + }, + "PageResult": { + "description": "Extracted information from a single page.", + "type": "object", + "required": [ + "page" + ], + "properties": { + "page": { + "description": "Page number.", + "type": "integer", + "format": "int32", + "minimum": 1, + "x-nullable": false + }, + "clusterId": { + "description": "Cluster identifier.", + "type": "integer", + "format": "int32", + "minimum": 0, + "x-nullable": false + }, + "keyValuePairs": { + "description": "List of key-value pairs extracted from the page.", + "type": "array", + "items": { + "$ref": "#/definitions/KeyValuePair" + } + }, + "tables": { + "description": "List of data tables extracted from the page.", + "type": "array", + "items": { + "$ref": "#/definitions/DataTable" + } + } + } + }, + "KeyValuePair": { + "description": "Information about the extracted key-value pair.", + "type": "object", + "required": [ + "key", + "value", + "confidence" + ], + "properties": { + "label": { + "description": "A user defined label for the key/value pair entry.", + "type": "string" + }, + "key": { + "description": "Information about the extracted key in a key-value pair.", + "$ref": "#/definitions/KeyValueElement" + }, + "value": { + "description": "Information about the extracted value in a key-value pair.", + "$ref": "#/definitions/KeyValueElement" + }, + "confidence": { + "description": "Confidence value.", + "$ref": "#/definitions/Confidence" + } + } + }, + "KeyValueElement": { + "description": "Information about the extracted key or value in a key-value pair.", + "type": "object", + "required": [ + "text" + ], + "properties": { + "type": { + "$ref": "#/definitions/KeyValueType" + }, + "text": { + "description": "The text content of the key or value.", + "type": "string" + }, + "boundingBox": { + "description": "Bounding box of the key or value.", + "$ref": "#/definitions/BoundingBox" + }, + "elements": { + "description": "When includeTextDetails is set to true, a list of references to the text elements constituting this key or value.", + "type": "array", + "items": { + "$ref": "#/definitions/ElementReference" + } + } + } + }, + "KeyValueType": { + "type": "string", + "description": "Semantic data type of the key value element.", + "enum": [ + "string", + "selectionMark" + ], + "x-ms-enum": { + "name": "KeyValueType", + "modelAsString": true + }, + "x-nullable": false + }, + "ElementReference": { + "description": "Reference to a line, word or selection mark.", + "type": "string" + }, + "SelectionMark": { + "description": "Information about the extracted selection mark.", + "type": "object", + "required": [ + "boundingBox", + "confidence", + "state" + ], + "properties": { + "boundingBox": { + "description": "Bounding box of the selection mark.", + "$ref": "#/definitions/BoundingBox" + }, + "confidence": { + "description": "Confidence value.", + "$ref": "#/definitions/Confidence" + }, + "state": { + "description": "State of the selection mark.", + "type": "string", + "enum": [ + "selected", + "unselected" + ] + } + } + }, + "DataTable": { + "description": "Information about the extracted table contained in a page.", + "type": "object", + "required": [ + "rows", + "columns", + "cells" + ], + "properties": { + "rows": { + "description": "Number of rows.", + "type": "integer", + "minimum": 1, + "x-nullable": false + }, + "columns": { + "description": "Number of columns.", + "type": "integer", + "minimum": 1, + "x-nullable": false + }, + "cells": { + "description": "List of cells contained in the table.", + "type": "array", + "items": { + "$ref": "#/definitions/DataTableCell" + } + } + } + }, + "DataTableCell": { + "description": "Information about the extracted cell in a table.", + "type": "object", + "required": [ + "rowIndex", + "columnIndex", + "text", + "boundingBox", + "confidence" + ], + "properties": { + "rowIndex": { + "description": "Row index of the cell.", + "type": "integer", + "minimum": 0, + "x-nullable": false + }, + "columnIndex": { + "description": "Column index of the cell.", + "type": "integer", + "minimum": 0, + "x-nullable": false + }, + "rowSpan": { + "description": "Number of rows spanned by this cell.", + "type": "integer", + "minimum": 1, + "default": 1, + "x-nullable": false + }, + "columnSpan": { + "description": "Number of columns spanned by this cell.", + "type": "integer", + "minimum": 1, + "default": 1, + "x-nullable": false + }, + "text": { + "description": "Text content of the cell.", + "type": "string" + }, + "boundingBox": { + "description": "Bounding box of the cell.", + "$ref": "#/definitions/BoundingBox" + }, + "confidence": { + "description": "Confidence value.", + "$ref": "#/definitions/Confidence" + }, + "elements": { + "description": "When includeTextDetails is set to true, a list of references to the text elements constituting this table cell.", + "type": "array", + "items": { + "$ref": "#/definitions/ElementReference" + } + }, + "isHeader": { + "description": "Is the current cell a header cell?", + "type": "boolean", + "default": false, + "x-nullable": false + }, + "isFooter": { + "description": "Is the current cell a footer cell?", + "type": "boolean", + "default": false, + "x-nullable": false + } + } + }, + "DocumentResult": { + "description": "A set of extracted fields corresponding to the input document.", + "type": "object", + "required": [ + "docType", + "pageRange", + "fields" + ], + "properties": { + "docType": { + "description": "Document type.", + "type": "string" + }, + "modelId": { + "description": "Model identifier.", + "type": "string", + "format": "uuid", + "x-nullable": false + }, + "pageRange": { + "description": "First and last page number where the document is found.", + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": { + "type": "integer", + "minimum": 1, + "x-nullable": false + } + }, + "docTypeConfidence": { + "description": "Confidence score.", + "$ref": "#/definitions/Confidence" + }, + "fields": { + "description": "Dictionary of named field values.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/FieldValue" + } + } + } + }, + "FieldValue": { + "description": "Recognized field value.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "description": "Type of field value.", + "$ref": "#/definitions/FieldValueType" + }, + "valueString": { + "description": "String value.", + "type": "string" + }, + "valueDate": { + "description": "Date value.", + "format": "date", + "type": "string", + "x-nullable": false + }, + "valueTime": { + "description": "Time value.", + "format": "time", + "type": "string", + "x-nullable": false + }, + "valuePhoneNumber": { + "description": "Phone number value.", + "type": "string" + }, + "valueNumber": { + "description": "Floating point value.", + "type": "number", + "x-nullable": false + }, + "valueInteger": { + "description": "Integer value.", + "type": "integer", + "x-nullable": false + }, + "valueArray": { + "description": "Array of field values.", + "type": "array", + "items": { + "$ref": "#/definitions/FieldValue" + } + }, + "valueObject": { + "description": "Dictionary of named field values.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/FieldValue" + } + }, + "valueSelectionMark": { + "description": "Selection mark value.", + "type": "string", + "enum": [ + "selected", + "unselected" + ], + "x-nullable": false + }, + "text": { + "description": "Text content of the extracted field.", + "type": "string" + }, + "boundingBox": { + "description": "Bounding box of the field value, if appropriate.", + "$ref": "#/definitions/BoundingBox" + }, + "confidence": { + "description": "Confidence score.", + "$ref": "#/definitions/Confidence" + }, + "elements": { + "description": "When includeTextDetails is set to true, a list of references to the text elements constituting this field.", + "type": "array", + "items": { + "$ref": "#/definitions/ElementReference" + } + }, + "page": { + "description": "The 1-based page number in the input document.", + "type": "integer", + "minimum": 1, + "x-nullable": false + } + } + }, + "FieldValueType": { + "type": "string", + "description": "Semantic data type of the field value.", + "enum": [ + "string", + "date", + "time", + "phoneNumber", + "number", + "integer", + "array", + "object", + "selectionMark" + ], + "x-ms-enum": { + "name": "FieldValueType", + "modelAsString": false + }, + "x-nullable": false + }, + "Confidence": { + "description": "Confidence value.", + "type": "number", + "minimum": 0, + "maximum": 1, + "x-nullable": false + } + }, + "parameters": { + "Endpoint": { + "name": "endpoint", + "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).", + "x-ms-parameter-location": "client", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + }, + "FileStream": { + "name": "fileStream", + "description": ".json, .pdf, .jpg, .png or .tiff type file stream.", + "x-ms-parameter-location": "method", + "in": "body", + "schema": { + "$ref": "#/definitions/SourcePath" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/AnalyzeBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/AnalyzeBatch.json new file mode 100644 index 000000000000..1950c21a1d9b --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/AnalyzeBatch.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "{modelId}", + "body": {} + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.2/custom/models/{modelId}/analyzeResults/{resultId}" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/AnalyzeOperationResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/AnalyzeOperationResult.json new file mode 100644 index 000000000000..5b8a65ac0a6b --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/AnalyzeOperationResult.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "{modelId}", + "resultId": "{result Id}", + "body": {} + }, + "responses": { + "200": { + "body": { + "status": "running", + "createdDateTime": "2019-05-01T10:53:21Z", + "lastUpdatedDateTime": "2019-05-01T10:53:23Z", + "analyzeResult": { + "version": "v2.1", + "readResults": [], + "pageResults": [], + "documentResults": [], + "errors": [] + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/BusinessCardBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/BusinessCardBatch.json new file mode 100644 index 000000000000..a24f25f8a686 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/BusinessCardBatch.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": { + "source": "http://www.example.com/image.jpg" + } + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.2/prebuilt/businessCard/analyzeResults/{resultId}" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/BusinessCardBatchResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/BusinessCardBatchResult.json new file mode 100644 index 000000000000..2cf7aa15db22 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/BusinessCardBatchResult.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "resultId": "{result Id}", + "body": {} + }, + "responses": { + "200": { + "body": { + "status": "running", + "createdDateTime": "2019-05-01T10:53:21Z", + "lastUpdatedDateTime": "2019-05-01T10:53:23Z", + "analyzeResult": { + "version": "v2.1", + "readResults": [], + "pageResults": [], + "documentResults": [], + "errors": [] + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/ComposeModels.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/ComposeModels.json new file mode 100644 index 000000000000..e0ec5f4b91b4 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/ComposeModels.json @@ -0,0 +1,21 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": {}, + "composeRequest": { + "modelIds": [ + "4afb20d6-3ed0-4cde-ba40-dbd6207268dd", + "6f841356-aa32-42c9-a739-2182c47b79c9" + ] + } + }, + "responses": { + "201": { + "headers": { + "Location": "{endpoint}/formrecognizer/v2.1-preview.2/custom/models/{modelId}" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/CopyModel.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/CopyModel.json new file mode 100644 index 000000000000..6d4b89fe7708 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/CopyModel.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "{modelId}", + "body": {}, + "copyRequest": { + "targetResourceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{resourceName}", + "targetResourceRegion": "westus2", + "copyAuthorization": { + "modelId": "{modelId}", + "accessToken": "{accessToken}", + "expirationDateTimeTicks": 637190189980000000 + } + } + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.2/custom/models/{modelId}/copyResults/{resultId}" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/CopyModelAuthorization.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/CopyModelAuthorization.json new file mode 100644 index 000000000000..247663f31ab3 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/CopyModelAuthorization.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": {} + }, + "responses": { + "201": { + "headers": { + "Location": "{endpoint}/formrecognizer/v2.1-preview.2/custom/models/{modelId}" + }, + "body": { + "modelId": "{modelId}", + "accessToken": "{accessToken}", + "expirationDateTimeTicks": 637190189980000000 + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/CopyOperationResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/CopyOperationResult.json new file mode 100644 index 000000000000..f7b7b1163884 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/CopyOperationResult.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "{modelId}", + "resultId": "{resultId}", + "body": {} + }, + "responses": { + "200": { + "body": { + "status": "succeeded", + "createdDateTime": "2020-01-01T00:00:00Z", + "lastUpdatedDateTime": "2020-01-01T00:01:00Z", + "copyResult": { + "modelId": "{modelId}", + "errors": [] + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/CopyOperationResultWithErrors.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/CopyOperationResultWithErrors.json new file mode 100644 index 000000000000..853dd73e595e --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/CopyOperationResultWithErrors.json @@ -0,0 +1,28 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "{modelId}", + "resultId": "{resultId}", + "body": {} + }, + "responses": { + "200": { + "body": { + "status": "failed", + "createdDateTime": "2020-01-01T00:00:00Z", + "lastUpdatedDateTime": "2020-01-01T00:01:00Z", + "copyResult": { + "modelId": "{modelId}", + "errors": [ + { + "code": "ResourceResolverError", + "message": "{ErrorMessage}" + } + ] + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/DeleteModel.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/DeleteModel.json new file mode 100644 index 000000000000..c945ec953dd4 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/DeleteModel.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "{modelId}", + "body": {} + }, + "responses": { + "204": {} + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/GetModel.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/GetModel.json new file mode 100644 index 000000000000..df1c4b66b252 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/GetModel.json @@ -0,0 +1,59 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "{modelId}", + "body": {} + }, + "responses": { + "200": { + "body": { + "modelInfo": { + "modelId": "f973e3c1-1148-43bb-bea8-49d0603ab3a8", + "modelName": "my composed model", + "status": "ready", + "createdDateTime": "2019-05-01T10:53:21Z", + "lastUpdatedDateTime": "2019-05-01T10:53:23Z", + "attributes": { + "isComposed": true + } + }, + "keys": { + "clusters": { + "0": [ + "Invoice", + "123112313" + ], + "1": [ + "Please remit payment to:", + "Microsoft" + ] + } + }, + "trainResult": { + "trainingDocuments": [], + "fields": [], + "averageModelAccuracy": 0, + "errors": [] + }, + "composedTrainResults": [ + { + "modelId": "4afb20d6-3ed0-4cde-ba40-dbd6207268dd", + "trainingDocuments": [], + "fields": [], + "averageModelAccuracy": 0, + "errors": [] + }, + { + "modelId": "6f841356-aa32-42c9-a739-2182c47b79c9", + "trainingDocuments": [], + "fields": [], + "averageModelAccuracy": 0, + "errors": [] + } + ] + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/GetModels.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/GetModels.json new file mode 100644 index 000000000000..36ee11465e4f --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/GetModels.json @@ -0,0 +1,43 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "op": "full", + "body": {} + }, + "responses": { + "200": { + "body": { + "summary": { + "count": 2, + "limit": 5000, + "lastUpdatedDateTime": "2019-05-01T10:53:21Z" + }, + "modelList": [ + { + "modelId": "f973e3c1-1148-43bb-bea8-49d0603ab3a8", + "modelName": "test model 1", + "status": "ready", + "createdDateTime": "2019-05-01T10:53:21Z", + "lastUpdatedDateTime": "2019-05-01T10:53:23Z", + "attributes": { + "isComposed": false + } + }, + { + "modelId": "f973e3c1-0001-43bb-bea8-49d0603ab3a8", + "modelName": "test model 2", + "status": "ready", + "createdDateTime": "2019-05-01T10:53:21Z", + "lastUpdatedDateTime": "2019-05-01T10:53:23Z", + "attributes": { + "isComposed": true + } + } + ], + "nextLink": "" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/GetModelsSummary.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/GetModelsSummary.json new file mode 100644 index 000000000000..507495b78206 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/GetModelsSummary.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "op": "summary", + "body": {} + }, + "responses": { + "200": { + "body": { + "summary": { + "count": 5, + "limit": 5000, + "lastUpdatedDateTime": "2019-05-01T10:53:21Z" + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/InvoiceBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/InvoiceBatch.json new file mode 100644 index 000000000000..268375d0bee2 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/InvoiceBatch.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": {} + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.2/prebuilt/invoice/analyzeResults/{resultId}" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/InvoiceBatchResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/InvoiceBatchResult.json new file mode 100644 index 000000000000..2cf7aa15db22 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/InvoiceBatchResult.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "resultId": "{result Id}", + "body": {} + }, + "responses": { + "200": { + "body": { + "status": "running", + "createdDateTime": "2019-05-01T10:53:21Z", + "lastUpdatedDateTime": "2019-05-01T10:53:23Z", + "analyzeResult": { + "version": "v2.1", + "readResults": [], + "pageResults": [], + "documentResults": [], + "errors": [] + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/LayoutBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/LayoutBatch.json new file mode 100644 index 000000000000..e7cf3aa2a6e7 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/LayoutBatch.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "language": "en", + "body": {} + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.2/layout/analyzeResults/{resultId}" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/LayoutBatchResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/LayoutBatchResult.json new file mode 100644 index 000000000000..2a258bfe71bc --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/LayoutBatchResult.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "resultId": "{result Id}", + "body": {} + }, + "responses": { + "200": { + "body": { + "status": "succeeded", + "createdDateTime": "2019-05-01T10:53:21Z", + "lastUpdatedDateTime": "2019-05-01T10:53:23Z", + "analyzeResult": { + "version": "v2.1", + "readResults": [], + "pageResults": [] + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/ReceiptsBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/ReceiptsBatch.json new file mode 100644 index 000000000000..4dc6f98a2ace --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/ReceiptsBatch.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": {} + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.2/prebuilt/receipt/analyzeResults/{resultId}" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/ReceiptsBatchResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/ReceiptsBatchResult.json new file mode 100644 index 000000000000..2cf7aa15db22 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/ReceiptsBatchResult.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "resultId": "{result Id}", + "body": {} + }, + "responses": { + "200": { + "body": { + "status": "running", + "createdDateTime": "2019-05-01T10:53:21Z", + "lastUpdatedDateTime": "2019-05-01T10:53:23Z", + "analyzeResult": { + "version": "v2.1", + "readResults": [], + "pageResults": [], + "documentResults": [], + "errors": [] + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/TrainBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/TrainBatch.json new file mode 100644 index 000000000000..6b843c1cf075 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/TrainBatch.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": {}, + "trainRequest": { + "source": "/input/data1" + } + }, + "responses": { + "201": { + "headers": { + "Location": "{endpoint}/formrecognizer/v2.1-preview.2/custom/models/{modelId}" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/TrainBatchWithSubFolders.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/TrainBatchWithSubFolders.json new file mode 100644 index 000000000000..0c3af38f33b1 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/examples/TrainBatchWithSubFolders.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": {}, + "trainRequest": { + "source": "/input/data1", + "sourceFilter": { + "prefix": "", + "includeSubFolders": false + }, + "useLabelFile": false + } + }, + "responses": { + "201": { + "headers": { + "Location": "{endpoint}/formrecognizer/v2.1-preview.2/custom/models/{modelId}" + } + } + } +} From 834567318f7c3d4c99e595047b68acf49778cecf Mon Sep 17 00:00:00 2001 From: Sandeep Parab Date: Wed, 16 Sep 2020 08:22:46 -0700 Subject: [PATCH 02/19] Standardized Errors, sample list. --- .../data-plane/Common/StandardizedErrors.json | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 specification/cognitiveservices/data-plane/Common/StandardizedErrors.json diff --git a/specification/cognitiveservices/data-plane/Common/StandardizedErrors.json b/specification/cognitiveservices/data-plane/Common/StandardizedErrors.json new file mode 100644 index 000000000000..3e7e35d3c748 --- /dev/null +++ b/specification/cognitiveservices/data-plane/Common/StandardizedErrors.json @@ -0,0 +1,92 @@ +{ + "info": { + "version": "Sep2020", + "discription": "Cognitive Services - Error Categories and Error codes" + }, + "cognitiveServiceErrors": [ + { + "code": "JsonProcessingError", + "message": "Error occured while processing json.", + "innerErrors": [ + { + "code": "JsonParsingError", + "message": "Unable to parse json file.", + }, + { + "code": "JsonConversionFailed", + "message": "Failed to convert data\object to json format.", + } + ] + }, + { + "code": "DoumentProcessingError", + "message": "Error encountered during processing input document.", + "innerErrors": [ + { + "code": "PdfParsingError", + "message": "Unable to parse input pdf file.", + }, + { + "code": "", + "message": "", + } + ] + }, + { + "code": "MediaProcessingError", + "message": "Error encountered during processing of media file.", + "innerErrors": [ + { + "code": "MpegFileTooLargeError", + "message": "Failed to load file due to its size.", + }, + { + "code": "WavCodecError", + "message": "Unsupported CODEC encountered.", + } + ] + }, + { + "code": "DependentServiceDependencyError", + "message": "Dependent service reported error.", + "innerErrors": [ + { + "code": "BlobStorageAccessError", + "message": "Failed to access Azure Blob storage.", + }, + { + "code": "OcrTimeoutError", + "message": "Request to Ocr service timed out.", + } + ] + }, + { + "code": "ServiceSpecificError", + "message": "Cognitive service specific error has occured.", + "innerErrors": [ + { + "code": "InternalScoringError", + "message": "Unexpected document scoring error.", + }, + { + "code": "ModelComposeError", + "message": "Failed to compose model.", + } + ] + }, + { + "code": "GenericError", + "message": "Service encountered generic system error.", + "innerErrors": [ + { + "code": "LocalFileIOError", + "message": "Unable to read local file.", + }, + { + "code": "OutOfMemoryError", + "message": "Unable to allocate additional memory to complete scoring.", + } + ] + } + ] +} \ No newline at end of file From 04bcbe78d7f4251a0c7659bd788a1c6db7e096a9 Mon Sep 17 00:00:00 2001 From: Sandeep Parab Date: Wed, 16 Sep 2020 08:24:24 -0700 Subject: [PATCH 03/19] removing from master from now as this is just a proposal --- .../data-plane/Common/StandardizedErrors.json | 92 ------------------- 1 file changed, 92 deletions(-) delete mode 100644 specification/cognitiveservices/data-plane/Common/StandardizedErrors.json diff --git a/specification/cognitiveservices/data-plane/Common/StandardizedErrors.json b/specification/cognitiveservices/data-plane/Common/StandardizedErrors.json deleted file mode 100644 index 3e7e35d3c748..000000000000 --- a/specification/cognitiveservices/data-plane/Common/StandardizedErrors.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "info": { - "version": "Sep2020", - "discription": "Cognitive Services - Error Categories and Error codes" - }, - "cognitiveServiceErrors": [ - { - "code": "JsonProcessingError", - "message": "Error occured while processing json.", - "innerErrors": [ - { - "code": "JsonParsingError", - "message": "Unable to parse json file.", - }, - { - "code": "JsonConversionFailed", - "message": "Failed to convert data\object to json format.", - } - ] - }, - { - "code": "DoumentProcessingError", - "message": "Error encountered during processing input document.", - "innerErrors": [ - { - "code": "PdfParsingError", - "message": "Unable to parse input pdf file.", - }, - { - "code": "", - "message": "", - } - ] - }, - { - "code": "MediaProcessingError", - "message": "Error encountered during processing of media file.", - "innerErrors": [ - { - "code": "MpegFileTooLargeError", - "message": "Failed to load file due to its size.", - }, - { - "code": "WavCodecError", - "message": "Unsupported CODEC encountered.", - } - ] - }, - { - "code": "DependentServiceDependencyError", - "message": "Dependent service reported error.", - "innerErrors": [ - { - "code": "BlobStorageAccessError", - "message": "Failed to access Azure Blob storage.", - }, - { - "code": "OcrTimeoutError", - "message": "Request to Ocr service timed out.", - } - ] - }, - { - "code": "ServiceSpecificError", - "message": "Cognitive service specific error has occured.", - "innerErrors": [ - { - "code": "InternalScoringError", - "message": "Unexpected document scoring error.", - }, - { - "code": "ModelComposeError", - "message": "Failed to compose model.", - } - ] - }, - { - "code": "GenericError", - "message": "Service encountered generic system error.", - "innerErrors": [ - { - "code": "LocalFileIOError", - "message": "Unable to read local file.", - }, - { - "code": "OutOfMemoryError", - "message": "Unable to allocate additional memory to complete scoring.", - } - ] - } - ] -} \ No newline at end of file From 7a0672f134a3b83be8d3c8005a264a0d3b00a549 Mon Sep 17 00:00:00 2001 From: Sandeep Parab Date: Sun, 20 Sep 2020 16:02:40 -0700 Subject: [PATCH 04/19] Add support for preview.3 --- .../v2.1-preview.2/FormRecognizer.json | 28 +- .../v2.1-preview.3/FormRecognizer.json | 2174 +++++++++++++++++ .../v2.1-preview.3/examples/AnalyzeBatch.json | 16 + .../examples/AnalyzeOperationResult.json | 25 + .../examples/BusinessCardBatch.json | 17 + .../examples/BusinessCardBatchResult.json | 24 + .../examples/ComposeModels.json | 21 + .../v2.1-preview.3/examples/CopyModel.json | 25 + .../examples/CopyModelAuthorization.json | 20 + .../examples/CopyOperationResult.json | 23 + .../CopyOperationResultWithErrors.json | 28 + .../v2.1-preview.3/examples/DeleteModel.json | 11 + .../v2.1-preview.3/examples/GetModel.json | 59 + .../v2.1-preview.3/examples/GetModels.json | 43 + .../examples/GetModelsSummary.json | 20 + .../v2.1-preview.3/examples/IdBatch.json | 15 + .../examples/IdBatchResult.json | 24 + .../v2.1-preview.3/examples/InvoiceBatch.json | 15 + .../examples/InvoiceBatchResult.json | 24 + .../v2.1-preview.3/examples/LayoutBatch.json | 16 + .../examples/LayoutBatchResult.json | 22 + .../examples/ReceiptsBatch.json | 15 + .../examples/ReceiptsBatchResult.json | 24 + .../v2.1-preview.3/examples/TrainBatch.json | 18 + .../examples/TrainBatchWithSubFolders.json | 23 + 25 files changed, 2711 insertions(+), 19 deletions(-) create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/AnalyzeBatch.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/AnalyzeOperationResult.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/BusinessCardBatch.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/BusinessCardBatchResult.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ComposeModels.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyModel.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyModelAuthorization.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyOperationResult.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyOperationResultWithErrors.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/DeleteModel.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModel.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModels.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModelsSummary.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/IdBatch.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/IdBatchResult.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/InvoiceBatch.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/InvoiceBatchResult.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/LayoutBatch.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/LayoutBatchResult.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ReceiptsBatch.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ReceiptsBatchResult.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/TrainBatch.json create mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/TrainBatchWithSubFolders.json diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json index 7db85c6df910..b04a543924a5 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json @@ -174,8 +174,7 @@ "application/json", "image/jpeg", "image/png", - "image/tiff", - "image/bmp" + "image/tiff" ], "produces": [ "application/json" @@ -477,8 +476,7 @@ "application/json", "image/jpeg", "image/png", - "image/tiff", - "image/bmp" + "image/tiff" ], "produces": [ "application/json" @@ -579,8 +577,7 @@ "application/json", "image/jpeg", "image/png", - "image/tiff", - "image/bmp" + "image/tiff" ], "produces": [ "application/json" @@ -681,8 +678,7 @@ "application/json", "image/jpeg", "image/png", - "image/tiff", - "image/bmp" + "image/tiff" ], "produces": [ "application/json" @@ -776,15 +772,9 @@ "/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.", + "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', 'image/tiff' or 'image/bmp'. 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", - "image/bmp" ], "produces": [ "application/json" @@ -796,9 +786,10 @@ { "name": "pageRange", "in": "query", - "description": "Specify page number or range of page numbers to process, e.g: 1, 5 , 7, 9-10", + "description": "Specify page number or range of page numbers to process, e.g: 1, 5, 7, 9-10", "required": false, - "type": "string" + "type": "string", + "pattern": "^\d+(-\d+)?$" } ], "responses": { @@ -965,8 +956,7 @@ "notStarted", "running", "succeeded", - "failed", - "partiallyCompleted" + "failed" ], "x-ms-enum": { "name": "OperationStatus", diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json new file mode 100644 index 000000000000..e4595507ac0e --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json @@ -0,0 +1,2174 @@ +{ + "swagger": "2.0", + "info": { + "version": "2.1-preview.3", + "title": "Form Recognizer Client", + "description": "Extracts information from forms and images into structured data." + }, + "securityDefinitions": { + "apim_key": { + "type": "apiKey", + "name": "Ocp-Apim-Subscription-Key", + "in": "header" + } + }, + "security": [ + { + "apim_key": [] + } + ], + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}/formrecognizer/v2.1-preview.3", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "#/parameters/Endpoint" + } + ] + }, + "schemes": [ + "https" + ], + "paths": { + "/custom/models": { + "post": { + "summary": "Train Custom Model", + "description": "Create and train a custom model. The request must include a source parameter that is either an externally accessible Azure storage blob container Uri (preferably a Shared Access Signature Uri) or valid path to a data folder in a locally mounted drive. When local paths are specified, they must follow the Linux/Unix path format and be an absolute path rooted to the input mount configuration setting value e.g., if '{Mounts:Input}' configuration setting value is '/input' then a valid source path would be '/input/contosodataset'. All data to be trained is expected to be under the source folder or sub folders under it. Models are trained using documents that are of the following content type - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' or 'image/bmp'. Other type of content is ignored.", + "operationId": "TrainCustomModelAsync", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "trainRequest", + "in": "body", + "description": "Training request parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/TrainRequest" + } + } + ], + "responses": { + "201": { + "description": "Request is queued successfully.", + "headers": { + "Location": { + "type": "string", + "description": "Location and ID of the model being trained. The status of model training is specified in the status property at the model location." + } + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Train custom model": { + "$ref": "./examples/TrainBatch.json" + }, + "Train custom model with subfolder filter options": { + "$ref": "./examples/TrainBatchWithSubFolders.json" + } + }, + "x-ms-long-running-operation": true + } + }, + "/custom/models/{modelId}": { + "get": { + "summary": "Get Custom Model", + "description": "Get detailed information about a custom model.", + "operationId": "GetCustomModel", + "consumes": [], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "modelId", + "in": "path", + "description": "Model identifier.", + "required": true, + "type": "string", + "format": "uuid" + }, + { + "name": "includeKeys", + "in": "query", + "description": "Include list of extracted keys in model information.", + "required": false, + "default": false, + "type": "boolean", + "x-nullable": false + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Model" + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get custom model": { + "$ref": "./examples/GetModel.json" + } + } + }, + "delete": { + "summary": "Delete Custom Model", + "description": "Mark model for deletion. Model artifacts will be permanently removed within a predetermined period.", + "operationId": "DeleteCustomModel", + "consumes": [], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "modelId", + "in": "path", + "description": "Model identifier.", + "required": true, + "type": "string", + "format": "uuid" + } + ], + "responses": { + "204": { + "description": "Successfully marked model for deletion. Model artifacts will be removed within a predefined time period." + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete custom model": { + "$ref": "./examples/DeleteModel.json" + } + } + } + }, + "/custom/models/{modelId}/analyze": { + "post": { + "summary": "Analyze Form", + "description": "Extract key-value pairs, tables, and semantic values from a given document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location (Uri or local path) of the document to be analyzed.", + "operationId": "AnalyzeWithCustomModel", + "consumes": [ + + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "modelId", + "in": "path", + "description": "Model identifier.", + "required": true, + "type": "string", + "format": "uuid" + }, + { + "name": "includeTextDetails", + "in": "query", + "description": "Include text lines and element references in the result.", + "required": false, + "default": false, + "type": "boolean", + "x-nullable": false + }, + { + "name": "pageRange", + "in": "query", + "description": "Specify page number or range of page numbers to process, e.g: 1, 5, 7, 9-10", + "required": false, + "type": "string", + "pattern": "^\d+(-\d+)?$", + "x-nullable": false + }, + { + "$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 form with custom model": { + "$ref": "./examples/AnalyzeBatch.json" + } + }, + "x-ms-long-running-operation": true + } + }, + "/custom/models/{modelId}/analyzeResults/{resultId}": { + "get": { + "summary": "Get Analyze Form Result", + "description": "Obtain current status and the result of the analyze form operation.", + "operationId": "GetAnalyzeFormResult", + "consumes": [], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "modelId", + "in": "path", + "description": "Model identifier.", + "required": true, + "type": "string", + "format": "uuid" + }, + { + "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 form result": { + "$ref": "./examples/AnalyzeOperationResult.json" + } + } + } + }, + "/custom/models/{modelId}/copy": { + "post": { + "summary": "Copy Custom Model", + "description": "Copy custom model stored in this resource (the source) to user specified target Form Recognizer resource.", + "operationId": "CopyCustomModel", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "modelId", + "in": "path", + "description": "Model identifier.", + "required": true, + "type": "string", + "format": "uuid" + }, + { + "name": "copyRequest", + "in": "body", + "description": "Copy request parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/CopyRequest" + } + } + ], + "responses": { + "202": { + "description": "Copy 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 copy operation." + } + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Copy custom model": { + "$ref": "./examples/CopyModel.json" + } + }, + "x-ms-long-running-operation": true + } + }, + "/custom/models/{modelId}/copyResults/{resultId}": { + "get": { + "summary": "Get Custom Model Copy Result", + "description": "Obtain current status and the result of a custom model copy operation.", + "operationId": "GetCustomModelCopyResult", + "consumes": [], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "modelId", + "in": "path", + "description": "Model identifier.", + "required": true, + "type": "string", + "format": "uuid" + }, + { + "name": "resultId", + "in": "path", + "description": "Copy operation result identifier.", + "required": true, + "type": "string", + "format": "uuid" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/CopyOperationResult" + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get copy custom model result": { + "$ref": "./examples/CopyOperationResult.json" + }, + "Get copy custom model result with failures": { + "$ref": "./examples/CopyOperationResultWithErrors.json" + } + } + } + }, + "/custom/models/copyAuthorization": { + "post": { + "summary": "Generate Copy Authorization", + "description": "Generate authorization to copy a model into the target Form Recognizer resource.", + "operationId": "GenerateModelCopyAuthorization", + "consumes": [], + "produces": [ + "application/json" + ], + "parameters": [], + "responses": { + "201": { + "description": "Copy request is authorized successfully.", + "headers": { + "Location": { + "type": "string", + "description": "Location and ID of the model being copied. The status of model copy is specified in the status property at the model location." + } + }, + "schema": { + "$ref": "#/definitions/CopyAuthorizationResult" + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Copy custom model": { + "$ref": "./examples/CopyModelAuthorization.json" + } + } + } + }, + "/custom/models/compose": { + "post": { + "tags": [ + "Form" + ], + "summary": "Compose trained with labels models into one composed model.", + "description": "Compose request would include list of models ids.\r\nIt would validate what all models either trained with labels model or composed model.\r\nIt would validate limit of models put together.", + "operationId": "ComposeCustomModelsAsync", + "consumes": [], + "produces": [ + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "composeRequest", + "in": "body", + "description": "Compose models", + "required": true, + "schema": { + "$ref": "#/definitions/ComposeRequest" + } + } + ], + "responses": { + "201": { + "description": "Request is queued successfully.", + "headers": { + "Location": { + "type": "string", + "description": "Location and ID of the composed model. The status of composed model is specified in the status property at the model location." + } + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Compose custom models": { + "$ref": "./examples/ComposeModels.json" + } + }, + "x-ms-long-running-operation": true + } + }, + "/prebuilt/businessCard/analyze": { + "post": { + "summary": "Analyze Business Card", + "description": "Extract field text and semantic values from a given business card document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location (Uri) of the document to be analyzed.", + "operationId": "AnalyzeBusinessCardAsync", + "consumes": [ + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "includeTextDetails", + "in": "query", + "description": "Include text lines and element references in the result.", + "required": false, + "default": false, + "type": "boolean", + "x-nullable": false + }, + { + "name": "locale", + "in": "query", + "description": "Locale of the business card. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default).", + "required": false, + "type": "string" + }, + { + "name": "pageRange", + "in": "query", + "description": "Specify page number or range of page numbers to process, e.g: 1, 5, 7, 9-10", + "required": false, + "type": "string", + "pattern": "^\d+(-\d+)?$" + }, + { + "$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 Business Card": { + "$ref": "./examples/BusinessCardBatch.json" + } + }, + "x-ms-long-running-operation": true + } + }, + "/prebuilt/businessCard/analyzeResults/{resultId}": { + "get": { + "summary": "Get Analyze Business Card Result", + "description": "Track the progress and obtain the result of the analyze business card operation.", + "operationId": "GetAnalyzeBusinessCardResult", + "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 business card result": { + "$ref": "./examples/BusinessCardBatchResult.json" + } + } + } + }, + "/prebuilt/invoice/analyze": { + "post": { + "summary": "Analyze Invoice Document", + "description": "Extract field text and semantic values from a given invoice document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' or "image/bmp". Alternatively, use 'application/json' type to specify the location (Uri) of the document to be analyzed.", + "operationId": "AnalyzeInvoiceAsync", + "consumes": [ + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "includeTextDetails", + "in": "query", + "description": "Include text lines and element references in the result.", + "required": false, + "default": false, + "type": "boolean", + "x-nullable": false + }, + { + "name": "locale", + "in": "query", + "description": "Locale of the invoice. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default).", + "required": false, + "type": "string" + }, + { + "name": "pageRange", + "in": "query", + "description": "Specify page number or range of page numbers to process, e.g: 1, 5, 7, 9-10", + "required": false, + "type": "string", + "pattern": "^\d+(-\d+)?$" + }, + { + "$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 receipt": { + "$ref": "./examples/InvoiceBatch.json" + } + }, + "x-ms-long-running-operation": true + } + }, + "/prebuilt/invoice/analyzeResults/{resultId}": { + "get": { + "summary": "Get Analyze Invoice Result", + "description": "Track the progress and obtain the result of the analyze invoice operation.", + "operationId": "GetAnalyzeInvoiceResult", + "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 receipt result": { + "$ref": "./examples/InvoiceBatchResult.json" + } + } + } + }, + "/prebuilt/id/analyze": { + "post": { + "summary": "Analyze ID", + "description": "Extract field text and semantic values from a given ID document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location (Uri) of the document to be analyzed.", + "operationId": "AnalyzeIdAsync", + "consumes": [ + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "includeTextDetails", + "in": "query", + "description": "Include text lines and element references in the result.", + "required": false, + "default": false, + "type": "boolean", + "x-nullable": false + }, + { + "$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 Id": { + "$ref": "./examples/IdsBatch.json" + } + }, + "x-ms-long-running-operation": true + } + }, + "/prebuilt/id/analyzeResults/{resultId}": { + "get": { + "summary": "Get Analyze ID Result", + "description": "Track the progress and obtain the result of the analyze ID operation.", + "operationId": "GetAnalyzeIdResult", + "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 id result": { + "$ref": "./examples/IdsBatchResult.json" + } + } + } + }, + "/prebuilt/receipt/analyze": { + "post": { + "summary": "Analyze Receipt", + "description": "Extract field text and semantic values from a given receipt document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location (Uri) of the document to be analyzed.", + "operationId": "AnalyzeReceiptAsync", + "consumes": [ + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "includeTextDetails", + "in": "query", + "description": "Include text lines and element references in the result.", + "required": false, + "default": false, + "type": "boolean", + "x-nullable": false + }, + { + "name": "locale", + "in": "query", + "description": "Locale of the receipt. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default).", + "required": false, + "type": "string" + }, + { + "name": "pageRange", + "in": "query", + "description": "Specify page number or range of page numbers to process, e.g: 1, 5, 7, 9-10", + "required": false, + "type": "string", + "pattern": "^\d+(-\d+)?$" + }, + { + "$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 receipt": { + "$ref": "./examples/ReceiptsBatch.json" + } + }, + "x-ms-long-running-operation": true + } + }, + "/prebuilt/receipt/analyzeResults/{resultId}": { + "get": { + "summary": "Get Analyze Receipt Result", + "description": "Track the progress and obtain the result of the analyze receipt operation.", + "operationId": "GetAnalyzeReceiptResult", + "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 receipt result": { + "$ref": "./examples/ReceiptsBatchResult.json" + } + } + } + }, + "/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', 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location (Uri or local path) of the document to be analyzed.", + "operationId": "AnalyzeLayoutAsync", + "consumes": [ + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/FileStream" + }, + { + "name": "pageRange", + "in": "query", + "description": "Specify page number or range of page numbers to process, e.g: 1, 5, 7, 9-10", + "required": false, + "type": "string", + "pattern": "^\d+(-\d+)?$" + } + ], + "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" + } + }, + "x-ms-long-running-operation": true + } + }, + "/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" + } + } + } + } + }, + "x-ms-paths": { + "/custom/models?op=full": { + "get": { + "summary": "List Custom Models", + "description": "Get information about all custom models", + "operationId": "ListCustomModels", + "consumes": [], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "op", + "in": "query", + "description": "Specify whether to return summary or full list of models.", + "required": true, + "type": "string", + "enum": [ + "full" + ] + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Models" + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink", + "itemName": "modelList" + }, + "x-ms-examples": { + "List custom models": { + "$ref": "./examples/GetModels.json" + } + } + } + }, + "/custom/models?op=summary": { + "get": { + "summary": "Get Custom Models", + "description": "Get information about all custom models", + "operationId": "GetCustomModels", + "consumes": [], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "op", + "in": "query", + "description": "Specify whether to return summary or full list of models.", + "required": true, + "type": "string", + "enum": [ + "summary" + ] + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Models" + } + }, + "default": { + "description": "Response entity accompanying non-successful responses containing additional details about the error.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get models summary": { + "$ref": "./examples/GetModelsSummary.json" + } + } + } + } + }, + "definitions": { + "OperationStatus": { + "type": "string", + "description": "Status of the queued operation.", + "enum": [ + "notStarted", + "running", + "succeeded", + "failed" + ], + "x-ms-enum": { + "name": "OperationStatus", + "modelAsString": false + }, + "x-nullable": false + }, + "CopyAuthorizationResult": { + "description": "Request parameter that contains authorization claims for copy operation.", + "required": [ + "modelId", + "accessToken", + "expirationDateTimeTicks" + ], + "type": "object", + "properties": { + "modelId": { + "description": "Model identifier.", + "type": "string" + }, + "accessToken": { + "description": "Token claim used to authorize the request.", + "type": "string" + }, + "expirationDateTimeTicks": { + "description": "The time when the access token expires. The date is represented as the number of seconds from 1970-01-01T0:0:0Z UTC until the expiration time.", + "type": "integer", + "format": "int64" + } + } + }, + "CopyRequest": { + "description": "Request parameter to copy an existing custom model from the source resource to a target resource referenced by the resource ID.", + "required": [ + "targetResourceId", + "targetResourceRegion", + "copyAuthorization" + ], + "type": "object", + "properties": { + "targetResourceId": { + "description": "Azure Resource Id of the target Form Recognizer resource where the model is copied to.", + "maxLength": 1024, + "type": "string", + "pattern": "^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.CognitiveServices/accounts/[^/]*$", + "x-ms-azure-resource": true + }, + "targetResourceRegion": { + "description": "Location of the target Azure resource. A valid Azure region name supported by Cognitive Services.", + "type": "string", + "pattern": "^[a-z0-9]+$", + "minLength": 1, + "maxLength": 24 + }, + "copyAuthorization": { + "description": "Entity that encodes claims to authorize the copy request.", + "$ref": "#/definitions/CopyAuthorizationResult" + } + } + }, + "CopyOperationResult": { + "description": "Status and result of the queued copy operation.", + "type": "object", + "required": [ + "status", + "createdDateTime", + "lastUpdatedDateTime" + ], + "properties": { + "status": { + "description": "Operation status.", + "$ref": "#/definitions/OperationStatus" + }, + "createdDateTime": { + "format": "date-time", + "description": "Date and time (UTC) when the copy operation was submitted.", + "type": "string", + "x-nullable": false + }, + "lastUpdatedDateTime": { + "format": "date-time", + "description": "Date and time (UTC) when the status was last updated.", + "type": "string", + "x-nullable": false + }, + "copyResult": { + "description": "Results of the copy operation.", + "$ref": "#/definitions/CopyResult" + } + } + }, + "CopyResult": { + "description": "Custom model copy result.", + "type": "object", + "required": [ + "modelId" + ], + "properties": { + "modelId": { + "description": "Identifier of the target model.", + "type": "string", + "format": "uuid" + }, + "errors": { + "description": "Errors returned during the copy operation.", + "type": "array", + "items": { + "$ref": "#/definitions/ErrorInformation" + } + } + } + }, + "AnalyzeOperationResult": { + "description": "Status and result of the queued analyze operation.", + "type": "object", + "required": [ + "status", + "createdDateTime", + "lastUpdatedDateTime" + ], + "properties": { + "status": { + "description": "Operation status.", + "$ref": "#/definitions/OperationStatus" + }, + "createdDateTime": { + "format": "date-time", + "description": "Date and time (UTC) when the analyze operation was submitted.", + "type": "string", + "x-nullable": false + }, + "lastUpdatedDateTime": { + "format": "date-time", + "description": "Date and time (UTC) when the status was last updated.", + "type": "string", + "x-nullable": false + }, + "analyzeResult": { + "description": "Results of the analyze operation.", + "$ref": "#/definitions/AnalyzeResult" + } + } + }, + "ModelName": { + "description": "Optional user defined model name (max length: 1024).", + "type": "string", + "x-nullable": false + }, + "TrainRequest": { + "description": "Request parameter to train a new custom model.", + "required": [ + "source" + ], + "type": "object", + "properties": { + "source": { + "description": "Source path containing the training documents.", + "maxLength": 2048, + "minLength": 0, + "type": "string" + }, + "sourceFilter": { + "$ref": "#/definitions/TrainSourceFilter", + "description": "Filter to apply to the documents in the source path for training." + }, + "useLabelFile": { + "description": "Use label file for training a model.", + "type": "boolean", + "default": false + }, + "modelName": { + "$ref": "#/definitions/ModelName" + } + } + }, + "TrainSourceFilter": { + "description": "Filter to apply to the documents in the source path for training.", + "type": "object", + "properties": { + "prefix": { + "description": "A case-sensitive prefix string to filter documents in the source path for training. For example, when using a Azure storage blob Uri, use the prefix to restrict sub folders for training.", + "maxLength": 1024, + "minLength": 0, + "type": "string" + }, + "includeSubFolders": { + "description": "A flag to indicate if sub folders within the set of prefix folders will also need to be included when searching for content to be preprocessed.", + "type": "boolean", + "default": false, + "x-nullable": false + } + } + }, + "TrainResult": { + "description": "Custom model training result.", + "type": "object", + "required": [ + "trainingDocuments" + ], + "properties": { + "trainingDocuments": { + "description": "List of the documents used to train the model and any errors reported in each document.", + "type": "array", + "items": { + "$ref": "#/definitions/TrainingDocumentInfo" + } + }, + "fields": { + "description": "List of fields used to train the model and the train operation error reported by each.", + "type": "array", + "items": { + "$ref": "#/definitions/FormFieldsReport" + } + }, + "averageModelAccuracy": { + "description": "Average accuracy.", + "type": "number", + "x-nullable": false + }, + "modelId": { + "description": "Model identifier.", + "type": "string", + "format": "uuid", + "x-nullable": false + }, + "errors": { + "description": "Errors returned during the training operation.", + "type": "array", + "items": { + "$ref": "#/definitions/ErrorInformation" + } + } + } + }, + "SourcePath": { + "description": "Uri or local path to source data.", + "type": "object", + "properties": { + "source": { + "description": "File source path.", + "maxLength": 2048, + "minLength": 0, + "type": "string" + } + } + }, + "Attributes": { + "description": "Optional model attributes.", + "type": "object", + "properties": { + "isComposed": { + "description": "Is this model composed? (default: false).", + "type": "boolean", + "default": false, + "x-nullable": false + } + } + }, + "ModelInfo": { + "description": "Basic custom model information.", + "type": "object", + "required": [ + "modelId", + "status", + "createdDateTime", + "lastUpdatedDateTime" + ], + "properties": { + "modelId": { + "description": "Model identifier.", + "type": "string", + "format": "uuid", + "x-nullable": false + }, + "status": { + "description": "Status of the model.", + "enum": [ + "creating", + "ready", + "invalid" + ], + "type": "string", + "x-ms-enum": { + "name": "ModelStatus", + "modelAsString": false + }, + "x-nullable": false + }, + "createdDateTime": { + "format": "date-time", + "description": "Date and time (UTC) when the model was created.", + "type": "string", + "x-nullable": false + }, + "lastUpdatedDateTime": { + "format": "date-time", + "description": "Date and time (UTC) when the status was last updated.", + "type": "string", + "x-nullable": false + }, + "modelName": { + "$ref": "#/definitions/ModelName" + }, + "attributes": { + "$ref": "#/definitions/Attributes" + } + } + }, + "Models": { + "description": "Response to the list custom models operation.", + "type": "object", + "properties": { + "summary": { + "description": "Summary of all trained custom models.", + "type": "object", + "required": [ + "count", + "limit", + "lastUpdatedDateTime" + ], + "properties": { + "count": { + "description": "Current count of trained custom models.", + "type": "integer", + "x-nullable": false + }, + "limit": { + "description": "Max number of models that can be trained for this account.", + "type": "integer", + "x-nullable": false + }, + "lastUpdatedDateTime": { + "format": "date-time", + "description": "Date and time (UTC) when the summary was last updated.", + "type": "string", + "x-nullable": false + } + } + }, + "modelList": { + "description": "Collection of trained custom models.", + "type": "array", + "items": { + "$ref": "#/definitions/ModelInfo" + } + }, + "nextLink": { + "description": "Link to the next page of custom models.", + "type": "string" + } + } + }, + "Model": { + "description": "Response to the get custom model operation.", + "type": "object", + "required": [ + "modelInfo" + ], + "properties": { + "modelInfo": { + "$ref": "#/definitions/ModelInfo" + }, + "keys": { + "$ref": "#/definitions/KeysResult" + }, + "trainResult": { + "description": "Training result for custom model.", + "$ref": "#/definitions/TrainResult" + }, + "composedTrainResults": { + "type": "array", + "description": "Training result for composed model.", + "items": { + "$ref": "#/definitions/TrainResult" + } + } + } + }, + "KeysResult": { + "description": "Keys extracted by the custom model.", + "type": "object", + "required": [ + "clusters" + ], + "properties": { + "clusters": { + "description": "Object mapping clusterIds to a list of keys.", + "type": "object", + "additionalProperties": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string" + } + } + } + } + }, + "TrainingDocumentInfo": { + "description": "Report for a custom model training document.", + "type": "object", + "required": [ + "documentName", + "pages", + "errors", + "status" + ], + "properties": { + "documentName": { + "description": "Training document name.", + "type": "string" + }, + "pages": { + "format": "int32", + "description": "Total number of pages trained.", + "type": "integer", + "x-nullable": false + }, + "errors": { + "description": "List of errors.", + "type": "array", + "items": { + "$ref": "#/definitions/ErrorInformation" + } + }, + "status": { + "description": "Status of the training operation.", + "enum": [ + "succeeded", + "partiallySucceeded", + "failed" + ], + "type": "string", + "x-ms-enum": { + "name": "TrainStatus", + "modelAsString": false + }, + "x-nullable": false + } + } + }, + "FormFieldsReport": { + "description": "Report for a custom model training field.", + "type": "object", + "required": [ + "fieldName", + "accuracy" + ], + "properties": { + "fieldName": { + "description": "Training field name.", + "type": "string" + }, + "accuracy": { + "description": "Estimated extraction accuracy for this field.", + "type": "number", + "x-nullable": false + } + } + }, + "ErrorResponse": { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "$ref": "#/definitions/ErrorInformation" + } + } + }, + "ErrorInformation": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, + "ComposeRequest": { + "description": "Request contract for compose operation.", + "required": [ + "modelIds" + ], + "type": "object", + "properties": { + "modelIds": { + "description": "List of model ids to compose.", + "uniqueItems": false, + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "modelName": { + "$ref": "#/definitions/ModelName" + } + } + }, + "AnalyzeResult": { + "description": "Analyze operation result.", + "type": "object", + "required": [ + "version", + "readResults" + ], + "properties": { + "version": { + "description": "Version of schema used for this result.", + "type": "string" + }, + "readResults": { + "description": "Text extracted from the input.", + "type": "array", + "items": { + "$ref": "#/definitions/ReadResult" + } + }, + "pageResults": { + "description": "Page-level information extracted from the input.", + "type": "array", + "items": { + "$ref": "#/definitions/PageResult" + } + }, + "documentResults": { + "description": "Document-level information extracted from the input.", + "type": "array", + "items": { + "$ref": "#/definitions/DocumentResult" + } + }, + "errors": { + "description": "List of errors reported during the analyze operation.", + "type": "array", + "items": { + "$ref": "#/definitions/ErrorInformation" + } + } + } + }, + "ReadResult": { + "description": "Text extracted from a page in the input document.", + "type": "object", + "required": [ + "page", + "angle", + "width", + "height", + "unit" + ], + "properties": { + "page": { + "description": "The 1-based page number in the input document.", + "type": "integer", + "minimum": 1, + "x-nullable": false + }, + "angle": { + "description": "The general orientation of the text in clockwise direction, measured in degrees between (-180, 180].", + "type": "number", + "minimum": -180, + "maximum": 180, + "exclusiveMinimum": true, + "x-nullable": false + }, + "width": { + "description": "The width of the image/PDF in pixels/inches, respectively.", + "type": "number", + "minimum": 0, + "x-nullable": false + }, + "height": { + "description": "The height of the image/PDF in pixels/inches, respectively.", + "type": "number", + "minimum": 0, + "x-nullable": false + }, + "unit": { + "description": "The unit used by the width, height and boundingBox properties. For images, the unit is \"pixel\". For PDF, the unit is \"inch\".", + "type": "string", + "enum": [ + "pixel", + "inch" + ], + "x-ms-enum": { + "name": "LengthUnit", + "modelAsString": false + }, + "x-nullable": false + }, + "language": { + "description": "The detected language on the page overall.", + "$ref": "#/definitions/Language" + }, + "lines": { + "description": "When includeTextDetails is set to true, a list of recognized text lines. The maximum number of lines returned is 300 per page. The lines are sorted top to bottom, left to right, although in certain cases proximity is treated with higher priority. As the sorting order depends on the detected text, it may change across images and OCR version updates. Thus, business logic should be built upon the actual line location instead of order.", + "type": "array", + "items": { + "$ref": "#/definitions/TextLine" + } + }, + "selectionMarks": { + "description": "List of selection marks extracted from the page.", + "type": "array", + "items": { + "$ref": "#/definitions/SelectionMark" + } + } + } + }, + "Language": { + "description": "Language code", + "type": "string", + "enum": [ + "en", + "es" + ], + "x-ms-enum": { + "name": "Language", + "modelAsString": true + }, + "x-nullable": false + }, + "TextLine": { + "description": "An object representing an extracted text line.", + "type": "object", + "required": [ + "text", + "boundingBox", + "words" + ], + "properties": { + "text": { + "description": "The text content of the line.", + "type": "string" + }, + "boundingBox": { + "description": "Bounding box of an extracted line.", + "$ref": "#/definitions/BoundingBox" + }, + "language": { + "description": "The detected language of this line, if different from the overall page language.", + "$ref": "#/definitions/Language" + }, + "words": { + "description": "List of words in the text line.", + "type": "array", + "items": { + "$ref": "#/definitions/TextWord" + } + } + } + }, + "TextWord": { + "description": "An object representing a word.", + "type": "object", + "required": [ + "boundingBox", + "text" + ], + "properties": { + "text": { + "description": "The text content of the word.", + "type": "string" + }, + "boundingBox": { + "description": "Bounding box of an extracted word.", + "$ref": "#/definitions/BoundingBox" + }, + "confidence": { + "description": "Confidence value.", + "$ref": "#/definitions/Confidence" + } + } + }, + "BoundingBox": { + "description": "Quadrangle bounding box, with coordinates specified relative to the top-left of the original image. The eight numbers represent the four points, clockwise from the top-left corner relative to the text orientation. For image, the (x, y) coordinates are measured in pixels. For PDF, the (x, y) coordinates are measured in inches.", + "type": "array", + "minItems": 8, + "maxItems": 8, + "items": { + "type": "number", + "x-nullable": false + } + }, + "PageResult": { + "description": "Extracted information from a single page.", + "type": "object", + "required": [ + "page" + ], + "properties": { + "page": { + "description": "Page number.", + "type": "integer", + "format": "int32", + "minimum": 1, + "x-nullable": false + }, + "clusterId": { + "description": "Cluster identifier.", + "type": "integer", + "format": "int32", + "minimum": 0, + "x-nullable": false + }, + "keyValuePairs": { + "description": "List of key-value pairs extracted from the page.", + "type": "array", + "items": { + "$ref": "#/definitions/KeyValuePair" + } + }, + "tables": { + "description": "List of data tables extracted from the page.", + "type": "array", + "items": { + "$ref": "#/definitions/DataTable" + } + } + } + }, + "KeyValuePair": { + "description": "Information about the extracted key-value pair.", + "type": "object", + "required": [ + "key", + "value", + "confidence" + ], + "properties": { + "label": { + "description": "A user defined label for the key/value pair entry.", + "type": "string" + }, + "key": { + "description": "Information about the extracted key in a key-value pair.", + "$ref": "#/definitions/KeyValueElement" + }, + "value": { + "description": "Information about the extracted value in a key-value pair.", + "$ref": "#/definitions/KeyValueElement" + }, + "confidence": { + "description": "Confidence value.", + "$ref": "#/definitions/Confidence" + } + } + }, + "KeyValueElement": { + "description": "Information about the extracted key or value in a key-value pair.", + "type": "object", + "required": [ + "text" + ], + "properties": { + "type": { + "$ref": "#/definitions/KeyValueType" + }, + "text": { + "description": "The text content of the key or value.", + "type": "string" + }, + "boundingBox": { + "description": "Bounding box of the key or value.", + "$ref": "#/definitions/BoundingBox" + }, + "elements": { + "description": "When includeTextDetails is set to true, a list of references to the text elements constituting this key or value.", + "type": "array", + "items": { + "$ref": "#/definitions/ElementReference" + } + } + } + }, + "KeyValueType": { + "type": "string", + "description": "Semantic data type of the key value element.", + "enum": [ + "string", + "selectionMark" + ], + "x-ms-enum": { + "name": "KeyValueType", + "modelAsString": true + }, + "x-nullable": false + }, + "ElementReference": { + "description": "Reference to a line, word or selection mark.", + "type": "string" + }, + "SelectionMark": { + "description": "Information about the extracted selection mark.", + "type": "object", + "required": [ + "boundingBox", + "confidence", + "state" + ], + "properties": { + "boundingBox": { + "description": "Bounding box of the selection mark.", + "$ref": "#/definitions/BoundingBox" + }, + "confidence": { + "description": "Confidence value.", + "$ref": "#/definitions/Confidence" + }, + "state": { + "description": "State of the selection mark.", + "type": "string", + "enum": [ + "selected", + "unselected" + ] + } + } + }, + "DataTable": { + "description": "Information about the extracted table contained in a page.", + "type": "object", + "required": [ + "rows", + "columns", + "cells" + ], + "properties": { + "rows": { + "description": "Number of rows.", + "type": "integer", + "minimum": 1, + "x-nullable": false + }, + "columns": { + "description": "Number of columns.", + "type": "integer", + "minimum": 1, + "x-nullable": false + }, + "cells": { + "description": "List of cells contained in the table.", + "type": "array", + "items": { + "$ref": "#/definitions/DataTableCell" + } + } + } + }, + "DataTableCell": { + "description": "Information about the extracted cell in a table.", + "type": "object", + "required": [ + "rowIndex", + "columnIndex", + "text", + "boundingBox", + "confidence" + ], + "properties": { + "rowIndex": { + "description": "Row index of the cell.", + "type": "integer", + "minimum": 0, + "x-nullable": false + }, + "columnIndex": { + "description": "Column index of the cell.", + "type": "integer", + "minimum": 0, + "x-nullable": false + }, + "rowSpan": { + "description": "Number of rows spanned by this cell.", + "type": "integer", + "minimum": 1, + "default": 1, + "x-nullable": false + }, + "columnSpan": { + "description": "Number of columns spanned by this cell.", + "type": "integer", + "minimum": 1, + "default": 1, + "x-nullable": false + }, + "text": { + "description": "Text content of the cell.", + "type": "string" + }, + "boundingBox": { + "description": "Bounding box of the cell.", + "$ref": "#/definitions/BoundingBox" + }, + "confidence": { + "description": "Confidence value.", + "$ref": "#/definitions/Confidence" + }, + "elements": { + "description": "When includeTextDetails is set to true, a list of references to the text elements constituting this table cell.", + "type": "array", + "items": { + "$ref": "#/definitions/ElementReference" + } + }, + "isHeader": { + "description": "Is the current cell a header cell?", + "type": "boolean", + "default": false, + "x-nullable": false + }, + "isFooter": { + "description": "Is the current cell a footer cell?", + "type": "boolean", + "default": false, + "x-nullable": false + } + } + }, + "DocumentResult": { + "description": "A set of extracted fields corresponding to the input document.", + "type": "object", + "required": [ + "docType", + "pageRange", + "fields" + ], + "properties": { + "docType": { + "description": "Document type.", + "type": "string" + }, + "modelId": { + "description": "Model identifier.", + "type": "string", + "format": "uuid", + "x-nullable": false + }, + "pageRange": { + "description": "First and last page number where the document is found.", + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": { + "type": "integer", + "minimum": 1, + "x-nullable": false + } + }, + "docTypeConfidence": { + "description": "Confidence score.", + "$ref": "#/definitions/Confidence" + }, + "fields": { + "description": "Dictionary of named field values.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/FieldValue" + } + } + } + }, + "FieldValue": { + "description": "Recognized field value.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "description": "Type of field value.", + "$ref": "#/definitions/FieldValueType" + }, + "valueString": { + "description": "String value.", + "type": "string" + }, + "valueDate": { + "description": "Date value.", + "format": "date", + "type": "string", + "x-nullable": false + }, + "valueTime": { + "description": "Time value.", + "format": "time", + "type": "string", + "x-nullable": false + }, + "valuePhoneNumber": { + "description": "Phone number value.", + "type": "string" + }, + "valueNumber": { + "description": "Floating point value.", + "type": "number", + "x-nullable": false + }, + "valueInteger": { + "description": "Integer value.", + "type": "integer", + "x-nullable": false + }, + "valueArray": { + "description": "Array of field values.", + "type": "array", + "items": { + "$ref": "#/definitions/FieldValue" + } + }, + "valueObject": { + "description": "Dictionary of named field values.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/FieldValue" + } + }, + "valueSelectionMark": { + "description": "Selection mark value.", + "type": "string", + "enum": [ + "selected", + "unselected" + ], + "x-nullable": false + }, + "text": { + "description": "Text content of the extracted field.", + "type": "string" + }, + "boundingBox": { + "description": "Bounding box of the field value, if appropriate.", + "$ref": "#/definitions/BoundingBox" + }, + "confidence": { + "description": "Confidence score.", + "$ref": "#/definitions/Confidence" + }, + "elements": { + "description": "When includeTextDetails is set to true, a list of references to the text elements constituting this field.", + "type": "array", + "items": { + "$ref": "#/definitions/ElementReference" + } + }, + "page": { + "description": "The 1-based page number in the input document.", + "type": "integer", + "minimum": 1, + "x-nullable": false + } + } + }, + "FieldValueType": { + "type": "string", + "description": "Semantic data type of the field value.", + "enum": [ + "string", + "date", + "time", + "phoneNumber", + "number", + "integer", + "array", + "object", + "selectionMark" + ], + "x-ms-enum": { + "name": "FieldValueType", + "modelAsString": false + }, + "x-nullable": false + }, + "Confidence": { + "description": "Confidence value.", + "type": "number", + "minimum": 0, + "maximum": 1, + "x-nullable": false + } + }, + "parameters": { + "Endpoint": { + "name": "endpoint", + "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).", + "x-ms-parameter-location": "client", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + }, + "FileStream": { + "name": "fileStream", + "description": ".json, .pdf, .jpg, .png or .tiff type file stream.", + "x-ms-parameter-location": "method", + "in": "body", + "schema": { + "$ref": "#/definitions/SourcePath" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/AnalyzeBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/AnalyzeBatch.json new file mode 100644 index 000000000000..fb60f1c7873d --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/AnalyzeBatch.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "{modelId}", + "body": {} + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.3/custom/models/{modelId}/analyzeResults/{resultId}" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/AnalyzeOperationResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/AnalyzeOperationResult.json new file mode 100644 index 000000000000..5b8a65ac0a6b --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/AnalyzeOperationResult.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "{modelId}", + "resultId": "{result Id}", + "body": {} + }, + "responses": { + "200": { + "body": { + "status": "running", + "createdDateTime": "2019-05-01T10:53:21Z", + "lastUpdatedDateTime": "2019-05-01T10:53:23Z", + "analyzeResult": { + "version": "v2.1", + "readResults": [], + "pageResults": [], + "documentResults": [], + "errors": [] + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/BusinessCardBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/BusinessCardBatch.json new file mode 100644 index 000000000000..2060d64fd112 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/BusinessCardBatch.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": { + "source": "http://www.example.com/image.jpg" + } + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.3/prebuilt/businessCard/analyzeResults/{resultId}" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/BusinessCardBatchResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/BusinessCardBatchResult.json new file mode 100644 index 000000000000..2cf7aa15db22 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/BusinessCardBatchResult.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "resultId": "{result Id}", + "body": {} + }, + "responses": { + "200": { + "body": { + "status": "running", + "createdDateTime": "2019-05-01T10:53:21Z", + "lastUpdatedDateTime": "2019-05-01T10:53:23Z", + "analyzeResult": { + "version": "v2.1", + "readResults": [], + "pageResults": [], + "documentResults": [], + "errors": [] + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ComposeModels.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ComposeModels.json new file mode 100644 index 000000000000..395c16efd5bf --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ComposeModels.json @@ -0,0 +1,21 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": {}, + "composeRequest": { + "modelIds": [ + "4afb20d6-3ed0-4cde-ba40-dbd6207268dd", + "6f841356-aa32-42c9-a739-2182c47b79c9" + ] + } + }, + "responses": { + "201": { + "headers": { + "Location": "{endpoint}/formrecognizer/v2.1-preview.3/custom/models/{modelId}" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyModel.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyModel.json new file mode 100644 index 000000000000..02c65d9fd975 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyModel.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "{modelId}", + "body": {}, + "copyRequest": { + "targetResourceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{resourceName}", + "targetResourceRegion": "westus2", + "copyAuthorization": { + "modelId": "{modelId}", + "accessToken": "{accessToken}", + "expirationDateTimeTicks": 637190189980000000 + } + } + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.3/custom/models/{modelId}/copyResults/{resultId}" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyModelAuthorization.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyModelAuthorization.json new file mode 100644 index 000000000000..64d05f18e03e --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyModelAuthorization.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": {} + }, + "responses": { + "201": { + "headers": { + "Location": "{endpoint}/formrecognizer/v2.1-preview.3/custom/models/{modelId}" + }, + "body": { + "modelId": "{modelId}", + "accessToken": "{accessToken}", + "expirationDateTimeTicks": 637190189980000000 + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyOperationResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyOperationResult.json new file mode 100644 index 000000000000..f7b7b1163884 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyOperationResult.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "{modelId}", + "resultId": "{resultId}", + "body": {} + }, + "responses": { + "200": { + "body": { + "status": "succeeded", + "createdDateTime": "2020-01-01T00:00:00Z", + "lastUpdatedDateTime": "2020-01-01T00:01:00Z", + "copyResult": { + "modelId": "{modelId}", + "errors": [] + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyOperationResultWithErrors.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyOperationResultWithErrors.json new file mode 100644 index 000000000000..853dd73e595e --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyOperationResultWithErrors.json @@ -0,0 +1,28 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "{modelId}", + "resultId": "{resultId}", + "body": {} + }, + "responses": { + "200": { + "body": { + "status": "failed", + "createdDateTime": "2020-01-01T00:00:00Z", + "lastUpdatedDateTime": "2020-01-01T00:01:00Z", + "copyResult": { + "modelId": "{modelId}", + "errors": [ + { + "code": "ResourceResolverError", + "message": "{ErrorMessage}" + } + ] + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/DeleteModel.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/DeleteModel.json new file mode 100644 index 000000000000..c945ec953dd4 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/DeleteModel.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "{modelId}", + "body": {} + }, + "responses": { + "204": {} + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModel.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModel.json new file mode 100644 index 000000000000..df1c4b66b252 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModel.json @@ -0,0 +1,59 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "modelId": "{modelId}", + "body": {} + }, + "responses": { + "200": { + "body": { + "modelInfo": { + "modelId": "f973e3c1-1148-43bb-bea8-49d0603ab3a8", + "modelName": "my composed model", + "status": "ready", + "createdDateTime": "2019-05-01T10:53:21Z", + "lastUpdatedDateTime": "2019-05-01T10:53:23Z", + "attributes": { + "isComposed": true + } + }, + "keys": { + "clusters": { + "0": [ + "Invoice", + "123112313" + ], + "1": [ + "Please remit payment to:", + "Microsoft" + ] + } + }, + "trainResult": { + "trainingDocuments": [], + "fields": [], + "averageModelAccuracy": 0, + "errors": [] + }, + "composedTrainResults": [ + { + "modelId": "4afb20d6-3ed0-4cde-ba40-dbd6207268dd", + "trainingDocuments": [], + "fields": [], + "averageModelAccuracy": 0, + "errors": [] + }, + { + "modelId": "6f841356-aa32-42c9-a739-2182c47b79c9", + "trainingDocuments": [], + "fields": [], + "averageModelAccuracy": 0, + "errors": [] + } + ] + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModels.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModels.json new file mode 100644 index 000000000000..36ee11465e4f --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModels.json @@ -0,0 +1,43 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "op": "full", + "body": {} + }, + "responses": { + "200": { + "body": { + "summary": { + "count": 2, + "limit": 5000, + "lastUpdatedDateTime": "2019-05-01T10:53:21Z" + }, + "modelList": [ + { + "modelId": "f973e3c1-1148-43bb-bea8-49d0603ab3a8", + "modelName": "test model 1", + "status": "ready", + "createdDateTime": "2019-05-01T10:53:21Z", + "lastUpdatedDateTime": "2019-05-01T10:53:23Z", + "attributes": { + "isComposed": false + } + }, + { + "modelId": "f973e3c1-0001-43bb-bea8-49d0603ab3a8", + "modelName": "test model 2", + "status": "ready", + "createdDateTime": "2019-05-01T10:53:21Z", + "lastUpdatedDateTime": "2019-05-01T10:53:23Z", + "attributes": { + "isComposed": true + } + } + ], + "nextLink": "" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModelsSummary.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModelsSummary.json new file mode 100644 index 000000000000..507495b78206 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModelsSummary.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "op": "summary", + "body": {} + }, + "responses": { + "200": { + "body": { + "summary": { + "count": 5, + "limit": 5000, + "lastUpdatedDateTime": "2019-05-01T10:53:21Z" + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/IdBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/IdBatch.json new file mode 100644 index 000000000000..632a915d9127 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/IdBatch.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": {} + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.3/prebuilt/id/analyzeResults/{resultId}" + } + } + } +} \ No newline at end of file diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/IdBatchResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/IdBatchResult.json new file mode 100644 index 000000000000..872ae12af891 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/IdBatchResult.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "resultId": "{result Id}", + "body": {} + }, + "responses": { + "200": { + "body": { + "status": "running", + "createdDateTime": "2019-05-01T10:53:21Z", + "lastUpdatedDateTime": "2019-05-01T10:53:23Z", + "analyzeResult": { + "version": "v2.1", + "readResults": [], + "pageResults": [], + "documentResults": [], + "errors": [] + } + } + } + } +} \ No newline at end of file diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/InvoiceBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/InvoiceBatch.json new file mode 100644 index 000000000000..8714c17650d5 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/InvoiceBatch.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": {} + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.3/prebuilt/invoice/analyzeResults/{resultId}" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/InvoiceBatchResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/InvoiceBatchResult.json new file mode 100644 index 000000000000..2cf7aa15db22 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/InvoiceBatchResult.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "resultId": "{result Id}", + "body": {} + }, + "responses": { + "200": { + "body": { + "status": "running", + "createdDateTime": "2019-05-01T10:53:21Z", + "lastUpdatedDateTime": "2019-05-01T10:53:23Z", + "analyzeResult": { + "version": "v2.1", + "readResults": [], + "pageResults": [], + "documentResults": [], + "errors": [] + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/LayoutBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/LayoutBatch.json new file mode 100644 index 000000000000..a489c3a75e6f --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/LayoutBatch.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "language": "en", + "body": {} + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.3/layout/analyzeResults/{resultId}" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/LayoutBatchResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/LayoutBatchResult.json new file mode 100644 index 000000000000..2a258bfe71bc --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/LayoutBatchResult.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "resultId": "{result Id}", + "body": {} + }, + "responses": { + "200": { + "body": { + "status": "succeeded", + "createdDateTime": "2019-05-01T10:53:21Z", + "lastUpdatedDateTime": "2019-05-01T10:53:23Z", + "analyzeResult": { + "version": "v2.1", + "readResults": [], + "pageResults": [] + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ReceiptsBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ReceiptsBatch.json new file mode 100644 index 000000000000..18080f028272 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ReceiptsBatch.json @@ -0,0 +1,15 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": {} + }, + "responses": { + "202": { + "headers": { + "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.3/prebuilt/receipt/analyzeResults/{resultId}" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ReceiptsBatchResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ReceiptsBatchResult.json new file mode 100644 index 000000000000..2cf7aa15db22 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ReceiptsBatchResult.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Ocp-Apim-Subscription-Key": "{API key}", + "resultId": "{result Id}", + "body": {} + }, + "responses": { + "200": { + "body": { + "status": "running", + "createdDateTime": "2019-05-01T10:53:21Z", + "lastUpdatedDateTime": "2019-05-01T10:53:23Z", + "analyzeResult": { + "version": "v2.1", + "readResults": [], + "pageResults": [], + "documentResults": [], + "errors": [] + } + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/TrainBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/TrainBatch.json new file mode 100644 index 000000000000..b531bc313c51 --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/TrainBatch.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": {}, + "trainRequest": { + "source": "/input/data1" + } + }, + "responses": { + "201": { + "headers": { + "Location": "{endpoint}/formrecognizer/v2.1-preview.3/custom/models/{modelId}" + } + } + } +} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/TrainBatchWithSubFolders.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/TrainBatchWithSubFolders.json new file mode 100644 index 000000000000..ee7e6594e5ae --- /dev/null +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/TrainBatchWithSubFolders.json @@ -0,0 +1,23 @@ +{ + "parameters": { + "endpoint": "{endpoint}", + "Content-Type": "application/json", + "Ocp-Apim-Subscription-Key": "{API key}", + "body": {}, + "trainRequest": { + "source": "/input/data1", + "sourceFilter": { + "prefix": "", + "includeSubFolders": false + }, + "useLabelFile": false + } + }, + "responses": { + "201": { + "headers": { + "Location": "{endpoint}/formrecognizer/v2.1-preview.3/custom/models/{modelId}" + } + } + } +} From aa93ba9021392fecee710ca5908fd408152f543d Mon Sep 17 00:00:00 2001 From: Sandeep Parab Date: Wed, 23 Sep 2020 11:11:40 -0700 Subject: [PATCH 05/19] Adding appearance property to ReadResult. --- .../v2.1-preview.2/FormRecognizer.json | 31 +++++++++++++++++++ .../v2.1-preview.3/FormRecognizer.json | 31 +++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json index b04a543924a5..b0d7cc43fb0f 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json @@ -1638,6 +1638,10 @@ "confidence": { "description": "Confidence value.", "$ref": "#/definitions/Confidence" + }, + "appearance": { + "description": "Style and its confidence value.", + "$ref": "#/definitions/Appearance" } } }, @@ -2046,6 +2050,33 @@ "minimum": 0, "maximum": 1, "x-nullable": false + }, + "Appearance": { + "description": "Information about style of extracted text.", + "type": "object", + "required": [ + "style", + "styleConfidence" + ], + "properties": { + "style": { + "description": "Extracted text can have one of following listed styles.", + "enum": [ + "handwriting", + "printed" + ], + "type": "string", + "x-ms-enum": { + "name": "style", + "modelAsString": false + }, + "x-nullable": false + }, + "styleConfidence": { + "description": "Confidence value of predicted style.", + "$ref": "#/definitions/Confidence" + } + } } }, "parameters": { diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json index e4595507ac0e..a0609d17795c 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json @@ -1741,6 +1741,10 @@ "confidence": { "description": "Confidence value.", "$ref": "#/definitions/Confidence" + }, + "appearance": { + "description": "Style and its confidence value.", + "$ref": "#/definitions/Appearance" } } }, @@ -2149,6 +2153,33 @@ "minimum": 0, "maximum": 1, "x-nullable": false + }, + "Appearance": { + "description": "Information about style of extracted text.", + "type": "object", + "required": [ + "style", + "styleConfidence" + ], + "properties": { + "style": { + "description": "Extracted text can have one of following listed styles.", + "enum": [ + "handwriting", + "printed" + ], + "type": "string", + "x-ms-enum": { + "name": "style", + "modelAsString": false + }, + "x-nullable": false + }, + "styleConfidence": { + "description": "Confidence value of predicted style.", + "$ref": "#/definitions/Confidence" + } + } } }, "parameters": { From 08d044c2cce6bb0d1803de784e37c55f7489155c Mon Sep 17 00:00:00 2001 From: Sandeep Parab Date: Thu, 24 Sep 2020 06:03:04 -0700 Subject: [PATCH 06/19] Incorporate review feedback. --- .../preview/v2.1-preview.2/FormRecognizer.json | 8 ++++---- .../preview/v2.1-preview.3/FormRecognizer.json | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json index b0d7cc43fb0f..64edafe7939d 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json @@ -1640,7 +1640,7 @@ "$ref": "#/definitions/Confidence" }, "appearance": { - "description": "Style and its confidence value.", + "description": "Text appearance properties.", "$ref": "#/definitions/Appearance" } } @@ -2052,7 +2052,7 @@ "x-nullable": false }, "Appearance": { - "description": "Information about style of extracted text.", + "description": "The appearance of extracted text.", "type": "object", "required": [ "style", @@ -2060,14 +2060,14 @@ ], "properties": { "style": { - "description": "Extracted text can have one of following listed styles.", + "description": "Style of the extracted text: handwriting or printed.", "enum": [ "handwriting", "printed" ], "type": "string", "x-ms-enum": { - "name": "style", + "name": "textStyle", "modelAsString": false }, "x-nullable": false diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json index a0609d17795c..0b4840924bb8 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json @@ -1743,7 +1743,7 @@ "$ref": "#/definitions/Confidence" }, "appearance": { - "description": "Style and its confidence value.", + "description": "Text appearance properties.", "$ref": "#/definitions/Appearance" } } @@ -2155,7 +2155,7 @@ "x-nullable": false }, "Appearance": { - "description": "Information about style of extracted text.", + "description": "The appearance of extracted text.", "type": "object", "required": [ "style", @@ -2163,14 +2163,14 @@ ], "properties": { "style": { - "description": "Extracted text can have one of following listed styles.", + "description": "Style of the extracted text: handwriting or printed.", "enum": [ "handwriting", "printed" ], "type": "string", "x-ms-enum": { - "name": "style", + "name": "textStyle", "modelAsString": false }, "x-nullable": false From 102d02b8f80c056ca4a5b07816cfa6de32bb1c31 Mon Sep 17 00:00:00 2001 From: Sandeep Parab Date: Wed, 14 Oct 2020 15:53:40 -0700 Subject: [PATCH 07/19] Update swagger --- .../preview/v2.1-preview.3/FormRecognizer.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json index 0b4840924bb8..73cd095b34b5 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json @@ -193,15 +193,15 @@ "type": "boolean", "x-nullable": false }, - { - "name": "pageRange", - "in": "query", - "description": "Specify page number or range of page numbers to process, e.g: 1, 5, 7, 9-10", - "required": false, - "type": "string", - "pattern": "^\d+(-\d+)?$", - "x-nullable": false - }, + { + "name": "pageRange", + "in": "query", + "description": "Specify page number or range of page numbers to process, e.g: 1, 5, 7, 9-10", + "required": false, + "type": "string", + "pattern": "^\d+(-\d+)?$", + "x-nullable": false + }, { "$ref": "#/parameters/FileStream" } From 25024260ab606250a905a4ed16a5bd97054a6f6b Mon Sep 17 00:00:00 2001 From: Sandeep Parab Date: Mon, 26 Oct 2020 14:57:27 -0700 Subject: [PATCH 08/19] Updating page range parameter for layout API. --- .../v2.1-preview.2/FormRecognizer.json | 65 +- .../v2.1-preview.3/FormRecognizer.json | 2205 ----------------- .../v2.1-preview.3/examples/AnalyzeBatch.json | 16 - .../examples/AnalyzeOperationResult.json | 25 - .../examples/BusinessCardBatch.json | 17 - .../examples/BusinessCardBatchResult.json | 24 - .../examples/ComposeModels.json | 21 - .../v2.1-preview.3/examples/CopyModel.json | 25 - .../examples/CopyModelAuthorization.json | 20 - .../examples/CopyOperationResult.json | 23 - .../CopyOperationResultWithErrors.json | 28 - .../v2.1-preview.3/examples/DeleteModel.json | 11 - .../v2.1-preview.3/examples/GetModel.json | 59 - .../v2.1-preview.3/examples/GetModels.json | 43 - .../examples/GetModelsSummary.json | 20 - .../v2.1-preview.3/examples/IdBatch.json | 15 - .../examples/IdBatchResult.json | 24 - .../v2.1-preview.3/examples/InvoiceBatch.json | 15 - .../examples/InvoiceBatchResult.json | 24 - .../v2.1-preview.3/examples/LayoutBatch.json | 16 - .../examples/LayoutBatchResult.json | 22 - .../examples/ReceiptsBatch.json | 15 - .../examples/ReceiptsBatchResult.json | 24 - .../v2.1-preview.3/examples/TrainBatch.json | 18 - .../examples/TrainBatchWithSubFolders.json | 23 - 25 files changed, 43 insertions(+), 2755 deletions(-) delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/AnalyzeBatch.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/AnalyzeOperationResult.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/BusinessCardBatch.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/BusinessCardBatchResult.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ComposeModels.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyModel.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyModelAuthorization.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyOperationResult.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyOperationResultWithErrors.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/DeleteModel.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModel.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModels.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModelsSummary.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/IdBatch.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/IdBatchResult.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/InvoiceBatch.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/InvoiceBatchResult.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/LayoutBatch.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/LayoutBatchResult.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ReceiptsBatch.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ReceiptsBatchResult.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/TrainBatch.json delete mode 100644 specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/TrainBatchWithSubFolders.json diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json index 64edafe7939d..2b346f270122 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json @@ -784,13 +784,8 @@ "$ref": "#/parameters/FileStream" }, { - "name": "pageRange", - "in": "query", - "description": "Specify page number or range of page numbers to process, e.g: 1, 5, 7, 9-10", - "required": false, - "type": "string", - "pattern": "^\d+(-\d+)?$" - } + "$ref": "#/parameters/Pages" + } ], "responses": { "202": { @@ -2052,34 +2047,48 @@ "x-nullable": false }, "Appearance": { - "description": "The appearance of extracted text.", + "description": "An object representing the appearance of the text line.", "type": "object", "required": [ - "style", - "styleConfidence" + "style" ], "properties": { "style": { - "description": "Style of the extracted text: handwriting or printed.", - "enum": [ - "handwriting", - "printed" - ], + "description": "An object representing the style of the text line.", + "type": "object", + "$ref": "#/definitions/Style" + } + } + }, + "Style": { + "description": "An object representing the style of the text line.", + "type": "object", + "required": [ + "name", + "confidence" + ], + "properties": { + "name": { + "description": "The text line style name, including handwriting and other.", "type": "string", "x-ms-enum": { - "name": "textStyle", - "modelAsString": false + "name": "TextStyle", + "modelAsString": true }, - "x-nullable": false + "enum": [ + "other", + "handwriting" + ] }, - "styleConfidence": { - "description": "Confidence value of predicted style.", - "$ref": "#/definitions/Confidence" + "confidence": { + "description": "The confidence of text line style.", + "type": "number", + "format": "float" } } } }, - "parameters": { + "parameters": { "Endpoint": { "name": "endpoint", "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).", @@ -2097,6 +2106,18 @@ "schema": { "$ref": "#/definitions/SourcePath" } + }, + "Pages": { + "name": "Pages", + "in": "query", + "description": "Custom page numbers for multi-page documents(PDF/TIFF), input the number of the pages you want to get OCR result. For a range of pages, use a hyphen. Separate each page or range with a comma or space.", + "required": false, + "x-ms-parameter-location": "method", + "type": "array", + "items": { + "type": "string", + "pattern": "(^[0-9]+-[0-9]+$)|(^[0-9]+$)" + } } } } diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json deleted file mode 100644 index 73cd095b34b5..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/FormRecognizer.json +++ /dev/null @@ -1,2205 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "2.1-preview.3", - "title": "Form Recognizer Client", - "description": "Extracts information from forms and images into structured data." - }, - "securityDefinitions": { - "apim_key": { - "type": "apiKey", - "name": "Ocp-Apim-Subscription-Key", - "in": "header" - } - }, - "security": [ - { - "apim_key": [] - } - ], - "x-ms-parameterized-host": { - "hostTemplate": "{endpoint}/formrecognizer/v2.1-preview.3", - "useSchemePrefix": false, - "parameters": [ - { - "$ref": "#/parameters/Endpoint" - } - ] - }, - "schemes": [ - "https" - ], - "paths": { - "/custom/models": { - "post": { - "summary": "Train Custom Model", - "description": "Create and train a custom model. The request must include a source parameter that is either an externally accessible Azure storage blob container Uri (preferably a Shared Access Signature Uri) or valid path to a data folder in a locally mounted drive. When local paths are specified, they must follow the Linux/Unix path format and be an absolute path rooted to the input mount configuration setting value e.g., if '{Mounts:Input}' configuration setting value is '/input' then a valid source path would be '/input/contosodataset'. All data to be trained is expected to be under the source folder or sub folders under it. Models are trained using documents that are of the following content type - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' or 'image/bmp'. Other type of content is ignored.", - "operationId": "TrainCustomModelAsync", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "trainRequest", - "in": "body", - "description": "Training request parameters.", - "required": true, - "schema": { - "$ref": "#/definitions/TrainRequest" - } - } - ], - "responses": { - "201": { - "description": "Request is queued successfully.", - "headers": { - "Location": { - "type": "string", - "description": "Location and ID of the model being trained. The status of model training is specified in the status property at the model location." - } - } - }, - "default": { - "description": "Response entity accompanying non-successful responses containing additional details about the error.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Train custom model": { - "$ref": "./examples/TrainBatch.json" - }, - "Train custom model with subfolder filter options": { - "$ref": "./examples/TrainBatchWithSubFolders.json" - } - }, - "x-ms-long-running-operation": true - } - }, - "/custom/models/{modelId}": { - "get": { - "summary": "Get Custom Model", - "description": "Get detailed information about a custom model.", - "operationId": "GetCustomModel", - "consumes": [], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "modelId", - "in": "path", - "description": "Model identifier.", - "required": true, - "type": "string", - "format": "uuid" - }, - { - "name": "includeKeys", - "in": "query", - "description": "Include list of extracted keys in model information.", - "required": false, - "default": false, - "type": "boolean", - "x-nullable": false - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Model" - } - }, - "default": { - "description": "Response entity accompanying non-successful responses containing additional details about the error.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Get custom model": { - "$ref": "./examples/GetModel.json" - } - } - }, - "delete": { - "summary": "Delete Custom Model", - "description": "Mark model for deletion. Model artifacts will be permanently removed within a predetermined period.", - "operationId": "DeleteCustomModel", - "consumes": [], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "modelId", - "in": "path", - "description": "Model identifier.", - "required": true, - "type": "string", - "format": "uuid" - } - ], - "responses": { - "204": { - "description": "Successfully marked model for deletion. Model artifacts will be removed within a predefined time period." - }, - "default": { - "description": "Response entity accompanying non-successful responses containing additional details about the error.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Delete custom model": { - "$ref": "./examples/DeleteModel.json" - } - } - } - }, - "/custom/models/{modelId}/analyze": { - "post": { - "summary": "Analyze Form", - "description": "Extract key-value pairs, tables, and semantic values from a given document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location (Uri or local path) of the document to be analyzed.", - "operationId": "AnalyzeWithCustomModel", - "consumes": [ - - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "modelId", - "in": "path", - "description": "Model identifier.", - "required": true, - "type": "string", - "format": "uuid" - }, - { - "name": "includeTextDetails", - "in": "query", - "description": "Include text lines and element references in the result.", - "required": false, - "default": false, - "type": "boolean", - "x-nullable": false - }, - { - "name": "pageRange", - "in": "query", - "description": "Specify page number or range of page numbers to process, e.g: 1, 5, 7, 9-10", - "required": false, - "type": "string", - "pattern": "^\d+(-\d+)?$", - "x-nullable": false - }, - { - "$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 form with custom model": { - "$ref": "./examples/AnalyzeBatch.json" - } - }, - "x-ms-long-running-operation": true - } - }, - "/custom/models/{modelId}/analyzeResults/{resultId}": { - "get": { - "summary": "Get Analyze Form Result", - "description": "Obtain current status and the result of the analyze form operation.", - "operationId": "GetAnalyzeFormResult", - "consumes": [], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "modelId", - "in": "path", - "description": "Model identifier.", - "required": true, - "type": "string", - "format": "uuid" - }, - { - "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 form result": { - "$ref": "./examples/AnalyzeOperationResult.json" - } - } - } - }, - "/custom/models/{modelId}/copy": { - "post": { - "summary": "Copy Custom Model", - "description": "Copy custom model stored in this resource (the source) to user specified target Form Recognizer resource.", - "operationId": "CopyCustomModel", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "modelId", - "in": "path", - "description": "Model identifier.", - "required": true, - "type": "string", - "format": "uuid" - }, - { - "name": "copyRequest", - "in": "body", - "description": "Copy request parameters.", - "required": true, - "schema": { - "$ref": "#/definitions/CopyRequest" - } - } - ], - "responses": { - "202": { - "description": "Copy 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 copy operation." - } - } - }, - "default": { - "description": "Response entity accompanying non-successful responses containing additional details about the error.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Copy custom model": { - "$ref": "./examples/CopyModel.json" - } - }, - "x-ms-long-running-operation": true - } - }, - "/custom/models/{modelId}/copyResults/{resultId}": { - "get": { - "summary": "Get Custom Model Copy Result", - "description": "Obtain current status and the result of a custom model copy operation.", - "operationId": "GetCustomModelCopyResult", - "consumes": [], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "modelId", - "in": "path", - "description": "Model identifier.", - "required": true, - "type": "string", - "format": "uuid" - }, - { - "name": "resultId", - "in": "path", - "description": "Copy operation result identifier.", - "required": true, - "type": "string", - "format": "uuid" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/CopyOperationResult" - } - }, - "default": { - "description": "Response entity accompanying non-successful responses containing additional details about the error.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Get copy custom model result": { - "$ref": "./examples/CopyOperationResult.json" - }, - "Get copy custom model result with failures": { - "$ref": "./examples/CopyOperationResultWithErrors.json" - } - } - } - }, - "/custom/models/copyAuthorization": { - "post": { - "summary": "Generate Copy Authorization", - "description": "Generate authorization to copy a model into the target Form Recognizer resource.", - "operationId": "GenerateModelCopyAuthorization", - "consumes": [], - "produces": [ - "application/json" - ], - "parameters": [], - "responses": { - "201": { - "description": "Copy request is authorized successfully.", - "headers": { - "Location": { - "type": "string", - "description": "Location and ID of the model being copied. The status of model copy is specified in the status property at the model location." - } - }, - "schema": { - "$ref": "#/definitions/CopyAuthorizationResult" - } - }, - "default": { - "description": "Response entity accompanying non-successful responses containing additional details about the error.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Copy custom model": { - "$ref": "./examples/CopyModelAuthorization.json" - } - } - } - }, - "/custom/models/compose": { - "post": { - "tags": [ - "Form" - ], - "summary": "Compose trained with labels models into one composed model.", - "description": "Compose request would include list of models ids.\r\nIt would validate what all models either trained with labels model or composed model.\r\nIt would validate limit of models put together.", - "operationId": "ComposeCustomModelsAsync", - "consumes": [], - "produces": [ - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "composeRequest", - "in": "body", - "description": "Compose models", - "required": true, - "schema": { - "$ref": "#/definitions/ComposeRequest" - } - } - ], - "responses": { - "201": { - "description": "Request is queued successfully.", - "headers": { - "Location": { - "type": "string", - "description": "Location and ID of the composed model. The status of composed model is specified in the status property at the model location." - } - } - }, - "default": { - "description": "Response entity accompanying non-successful responses containing additional details about the error.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Compose custom models": { - "$ref": "./examples/ComposeModels.json" - } - }, - "x-ms-long-running-operation": true - } - }, - "/prebuilt/businessCard/analyze": { - "post": { - "summary": "Analyze Business Card", - "description": "Extract field text and semantic values from a given business card document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location (Uri) of the document to be analyzed.", - "operationId": "AnalyzeBusinessCardAsync", - "consumes": [ - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "includeTextDetails", - "in": "query", - "description": "Include text lines and element references in the result.", - "required": false, - "default": false, - "type": "boolean", - "x-nullable": false - }, - { - "name": "locale", - "in": "query", - "description": "Locale of the business card. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default).", - "required": false, - "type": "string" - }, - { - "name": "pageRange", - "in": "query", - "description": "Specify page number or range of page numbers to process, e.g: 1, 5, 7, 9-10", - "required": false, - "type": "string", - "pattern": "^\d+(-\d+)?$" - }, - { - "$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 Business Card": { - "$ref": "./examples/BusinessCardBatch.json" - } - }, - "x-ms-long-running-operation": true - } - }, - "/prebuilt/businessCard/analyzeResults/{resultId}": { - "get": { - "summary": "Get Analyze Business Card Result", - "description": "Track the progress and obtain the result of the analyze business card operation.", - "operationId": "GetAnalyzeBusinessCardResult", - "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 business card result": { - "$ref": "./examples/BusinessCardBatchResult.json" - } - } - } - }, - "/prebuilt/invoice/analyze": { - "post": { - "summary": "Analyze Invoice Document", - "description": "Extract field text and semantic values from a given invoice document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' or "image/bmp". Alternatively, use 'application/json' type to specify the location (Uri) of the document to be analyzed.", - "operationId": "AnalyzeInvoiceAsync", - "consumes": [ - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "includeTextDetails", - "in": "query", - "description": "Include text lines and element references in the result.", - "required": false, - "default": false, - "type": "boolean", - "x-nullable": false - }, - { - "name": "locale", - "in": "query", - "description": "Locale of the invoice. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default).", - "required": false, - "type": "string" - }, - { - "name": "pageRange", - "in": "query", - "description": "Specify page number or range of page numbers to process, e.g: 1, 5, 7, 9-10", - "required": false, - "type": "string", - "pattern": "^\d+(-\d+)?$" - }, - { - "$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 receipt": { - "$ref": "./examples/InvoiceBatch.json" - } - }, - "x-ms-long-running-operation": true - } - }, - "/prebuilt/invoice/analyzeResults/{resultId}": { - "get": { - "summary": "Get Analyze Invoice Result", - "description": "Track the progress and obtain the result of the analyze invoice operation.", - "operationId": "GetAnalyzeInvoiceResult", - "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 receipt result": { - "$ref": "./examples/InvoiceBatchResult.json" - } - } - } - }, - "/prebuilt/id/analyze": { - "post": { - "summary": "Analyze ID", - "description": "Extract field text and semantic values from a given ID document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location (Uri) of the document to be analyzed.", - "operationId": "AnalyzeIdAsync", - "consumes": [ - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "includeTextDetails", - "in": "query", - "description": "Include text lines and element references in the result.", - "required": false, - "default": false, - "type": "boolean", - "x-nullable": false - }, - { - "$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 Id": { - "$ref": "./examples/IdsBatch.json" - } - }, - "x-ms-long-running-operation": true - } - }, - "/prebuilt/id/analyzeResults/{resultId}": { - "get": { - "summary": "Get Analyze ID Result", - "description": "Track the progress and obtain the result of the analyze ID operation.", - "operationId": "GetAnalyzeIdResult", - "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 id result": { - "$ref": "./examples/IdsBatchResult.json" - } - } - } - }, - "/prebuilt/receipt/analyze": { - "post": { - "summary": "Analyze Receipt", - "description": "Extract field text and semantic values from a given receipt document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location (Uri) of the document to be analyzed.", - "operationId": "AnalyzeReceiptAsync", - "consumes": [ - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "includeTextDetails", - "in": "query", - "description": "Include text lines and element references in the result.", - "required": false, - "default": false, - "type": "boolean", - "x-nullable": false - }, - { - "name": "locale", - "in": "query", - "description": "Locale of the receipt. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default).", - "required": false, - "type": "string" - }, - { - "name": "pageRange", - "in": "query", - "description": "Specify page number or range of page numbers to process, e.g: 1, 5, 7, 9-10", - "required": false, - "type": "string", - "pattern": "^\d+(-\d+)?$" - }, - { - "$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 receipt": { - "$ref": "./examples/ReceiptsBatch.json" - } - }, - "x-ms-long-running-operation": true - } - }, - "/prebuilt/receipt/analyzeResults/{resultId}": { - "get": { - "summary": "Get Analyze Receipt Result", - "description": "Track the progress and obtain the result of the analyze receipt operation.", - "operationId": "GetAnalyzeReceiptResult", - "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 receipt result": { - "$ref": "./examples/ReceiptsBatchResult.json" - } - } - } - }, - "/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', 'image/tiff' or 'image/bmp'. Alternatively, use 'application/json' type to specify the location (Uri or local path) of the document to be analyzed.", - "operationId": "AnalyzeLayoutAsync", - "consumes": [ - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "$ref": "#/parameters/FileStream" - }, - { - "name": "pageRange", - "in": "query", - "description": "Specify page number or range of page numbers to process, e.g: 1, 5, 7, 9-10", - "required": false, - "type": "string", - "pattern": "^\d+(-\d+)?$" - } - ], - "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" - } - }, - "x-ms-long-running-operation": true - } - }, - "/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" - } - } - } - } - }, - "x-ms-paths": { - "/custom/models?op=full": { - "get": { - "summary": "List Custom Models", - "description": "Get information about all custom models", - "operationId": "ListCustomModels", - "consumes": [], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "op", - "in": "query", - "description": "Specify whether to return summary or full list of models.", - "required": true, - "type": "string", - "enum": [ - "full" - ] - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Models" - } - }, - "default": { - "description": "Response entity accompanying non-successful responses containing additional details about the error.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink", - "itemName": "modelList" - }, - "x-ms-examples": { - "List custom models": { - "$ref": "./examples/GetModels.json" - } - } - } - }, - "/custom/models?op=summary": { - "get": { - "summary": "Get Custom Models", - "description": "Get information about all custom models", - "operationId": "GetCustomModels", - "consumes": [], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "op", - "in": "query", - "description": "Specify whether to return summary or full list of models.", - "required": true, - "type": "string", - "enum": [ - "summary" - ] - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Models" - } - }, - "default": { - "description": "Response entity accompanying non-successful responses containing additional details about the error.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Get models summary": { - "$ref": "./examples/GetModelsSummary.json" - } - } - } - } - }, - "definitions": { - "OperationStatus": { - "type": "string", - "description": "Status of the queued operation.", - "enum": [ - "notStarted", - "running", - "succeeded", - "failed" - ], - "x-ms-enum": { - "name": "OperationStatus", - "modelAsString": false - }, - "x-nullable": false - }, - "CopyAuthorizationResult": { - "description": "Request parameter that contains authorization claims for copy operation.", - "required": [ - "modelId", - "accessToken", - "expirationDateTimeTicks" - ], - "type": "object", - "properties": { - "modelId": { - "description": "Model identifier.", - "type": "string" - }, - "accessToken": { - "description": "Token claim used to authorize the request.", - "type": "string" - }, - "expirationDateTimeTicks": { - "description": "The time when the access token expires. The date is represented as the number of seconds from 1970-01-01T0:0:0Z UTC until the expiration time.", - "type": "integer", - "format": "int64" - } - } - }, - "CopyRequest": { - "description": "Request parameter to copy an existing custom model from the source resource to a target resource referenced by the resource ID.", - "required": [ - "targetResourceId", - "targetResourceRegion", - "copyAuthorization" - ], - "type": "object", - "properties": { - "targetResourceId": { - "description": "Azure Resource Id of the target Form Recognizer resource where the model is copied to.", - "maxLength": 1024, - "type": "string", - "pattern": "^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.CognitiveServices/accounts/[^/]*$", - "x-ms-azure-resource": true - }, - "targetResourceRegion": { - "description": "Location of the target Azure resource. A valid Azure region name supported by Cognitive Services.", - "type": "string", - "pattern": "^[a-z0-9]+$", - "minLength": 1, - "maxLength": 24 - }, - "copyAuthorization": { - "description": "Entity that encodes claims to authorize the copy request.", - "$ref": "#/definitions/CopyAuthorizationResult" - } - } - }, - "CopyOperationResult": { - "description": "Status and result of the queued copy operation.", - "type": "object", - "required": [ - "status", - "createdDateTime", - "lastUpdatedDateTime" - ], - "properties": { - "status": { - "description": "Operation status.", - "$ref": "#/definitions/OperationStatus" - }, - "createdDateTime": { - "format": "date-time", - "description": "Date and time (UTC) when the copy operation was submitted.", - "type": "string", - "x-nullable": false - }, - "lastUpdatedDateTime": { - "format": "date-time", - "description": "Date and time (UTC) when the status was last updated.", - "type": "string", - "x-nullable": false - }, - "copyResult": { - "description": "Results of the copy operation.", - "$ref": "#/definitions/CopyResult" - } - } - }, - "CopyResult": { - "description": "Custom model copy result.", - "type": "object", - "required": [ - "modelId" - ], - "properties": { - "modelId": { - "description": "Identifier of the target model.", - "type": "string", - "format": "uuid" - }, - "errors": { - "description": "Errors returned during the copy operation.", - "type": "array", - "items": { - "$ref": "#/definitions/ErrorInformation" - } - } - } - }, - "AnalyzeOperationResult": { - "description": "Status and result of the queued analyze operation.", - "type": "object", - "required": [ - "status", - "createdDateTime", - "lastUpdatedDateTime" - ], - "properties": { - "status": { - "description": "Operation status.", - "$ref": "#/definitions/OperationStatus" - }, - "createdDateTime": { - "format": "date-time", - "description": "Date and time (UTC) when the analyze operation was submitted.", - "type": "string", - "x-nullable": false - }, - "lastUpdatedDateTime": { - "format": "date-time", - "description": "Date and time (UTC) when the status was last updated.", - "type": "string", - "x-nullable": false - }, - "analyzeResult": { - "description": "Results of the analyze operation.", - "$ref": "#/definitions/AnalyzeResult" - } - } - }, - "ModelName": { - "description": "Optional user defined model name (max length: 1024).", - "type": "string", - "x-nullable": false - }, - "TrainRequest": { - "description": "Request parameter to train a new custom model.", - "required": [ - "source" - ], - "type": "object", - "properties": { - "source": { - "description": "Source path containing the training documents.", - "maxLength": 2048, - "minLength": 0, - "type": "string" - }, - "sourceFilter": { - "$ref": "#/definitions/TrainSourceFilter", - "description": "Filter to apply to the documents in the source path for training." - }, - "useLabelFile": { - "description": "Use label file for training a model.", - "type": "boolean", - "default": false - }, - "modelName": { - "$ref": "#/definitions/ModelName" - } - } - }, - "TrainSourceFilter": { - "description": "Filter to apply to the documents in the source path for training.", - "type": "object", - "properties": { - "prefix": { - "description": "A case-sensitive prefix string to filter documents in the source path for training. For example, when using a Azure storage blob Uri, use the prefix to restrict sub folders for training.", - "maxLength": 1024, - "minLength": 0, - "type": "string" - }, - "includeSubFolders": { - "description": "A flag to indicate if sub folders within the set of prefix folders will also need to be included when searching for content to be preprocessed.", - "type": "boolean", - "default": false, - "x-nullable": false - } - } - }, - "TrainResult": { - "description": "Custom model training result.", - "type": "object", - "required": [ - "trainingDocuments" - ], - "properties": { - "trainingDocuments": { - "description": "List of the documents used to train the model and any errors reported in each document.", - "type": "array", - "items": { - "$ref": "#/definitions/TrainingDocumentInfo" - } - }, - "fields": { - "description": "List of fields used to train the model and the train operation error reported by each.", - "type": "array", - "items": { - "$ref": "#/definitions/FormFieldsReport" - } - }, - "averageModelAccuracy": { - "description": "Average accuracy.", - "type": "number", - "x-nullable": false - }, - "modelId": { - "description": "Model identifier.", - "type": "string", - "format": "uuid", - "x-nullable": false - }, - "errors": { - "description": "Errors returned during the training operation.", - "type": "array", - "items": { - "$ref": "#/definitions/ErrorInformation" - } - } - } - }, - "SourcePath": { - "description": "Uri or local path to source data.", - "type": "object", - "properties": { - "source": { - "description": "File source path.", - "maxLength": 2048, - "minLength": 0, - "type": "string" - } - } - }, - "Attributes": { - "description": "Optional model attributes.", - "type": "object", - "properties": { - "isComposed": { - "description": "Is this model composed? (default: false).", - "type": "boolean", - "default": false, - "x-nullable": false - } - } - }, - "ModelInfo": { - "description": "Basic custom model information.", - "type": "object", - "required": [ - "modelId", - "status", - "createdDateTime", - "lastUpdatedDateTime" - ], - "properties": { - "modelId": { - "description": "Model identifier.", - "type": "string", - "format": "uuid", - "x-nullable": false - }, - "status": { - "description": "Status of the model.", - "enum": [ - "creating", - "ready", - "invalid" - ], - "type": "string", - "x-ms-enum": { - "name": "ModelStatus", - "modelAsString": false - }, - "x-nullable": false - }, - "createdDateTime": { - "format": "date-time", - "description": "Date and time (UTC) when the model was created.", - "type": "string", - "x-nullable": false - }, - "lastUpdatedDateTime": { - "format": "date-time", - "description": "Date and time (UTC) when the status was last updated.", - "type": "string", - "x-nullable": false - }, - "modelName": { - "$ref": "#/definitions/ModelName" - }, - "attributes": { - "$ref": "#/definitions/Attributes" - } - } - }, - "Models": { - "description": "Response to the list custom models operation.", - "type": "object", - "properties": { - "summary": { - "description": "Summary of all trained custom models.", - "type": "object", - "required": [ - "count", - "limit", - "lastUpdatedDateTime" - ], - "properties": { - "count": { - "description": "Current count of trained custom models.", - "type": "integer", - "x-nullable": false - }, - "limit": { - "description": "Max number of models that can be trained for this account.", - "type": "integer", - "x-nullable": false - }, - "lastUpdatedDateTime": { - "format": "date-time", - "description": "Date and time (UTC) when the summary was last updated.", - "type": "string", - "x-nullable": false - } - } - }, - "modelList": { - "description": "Collection of trained custom models.", - "type": "array", - "items": { - "$ref": "#/definitions/ModelInfo" - } - }, - "nextLink": { - "description": "Link to the next page of custom models.", - "type": "string" - } - } - }, - "Model": { - "description": "Response to the get custom model operation.", - "type": "object", - "required": [ - "modelInfo" - ], - "properties": { - "modelInfo": { - "$ref": "#/definitions/ModelInfo" - }, - "keys": { - "$ref": "#/definitions/KeysResult" - }, - "trainResult": { - "description": "Training result for custom model.", - "$ref": "#/definitions/TrainResult" - }, - "composedTrainResults": { - "type": "array", - "description": "Training result for composed model.", - "items": { - "$ref": "#/definitions/TrainResult" - } - } - } - }, - "KeysResult": { - "description": "Keys extracted by the custom model.", - "type": "object", - "required": [ - "clusters" - ], - "properties": { - "clusters": { - "description": "Object mapping clusterIds to a list of keys.", - "type": "object", - "additionalProperties": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string" - } - } - } - } - }, - "TrainingDocumentInfo": { - "description": "Report for a custom model training document.", - "type": "object", - "required": [ - "documentName", - "pages", - "errors", - "status" - ], - "properties": { - "documentName": { - "description": "Training document name.", - "type": "string" - }, - "pages": { - "format": "int32", - "description": "Total number of pages trained.", - "type": "integer", - "x-nullable": false - }, - "errors": { - "description": "List of errors.", - "type": "array", - "items": { - "$ref": "#/definitions/ErrorInformation" - } - }, - "status": { - "description": "Status of the training operation.", - "enum": [ - "succeeded", - "partiallySucceeded", - "failed" - ], - "type": "string", - "x-ms-enum": { - "name": "TrainStatus", - "modelAsString": false - }, - "x-nullable": false - } - } - }, - "FormFieldsReport": { - "description": "Report for a custom model training field.", - "type": "object", - "required": [ - "fieldName", - "accuracy" - ], - "properties": { - "fieldName": { - "description": "Training field name.", - "type": "string" - }, - "accuracy": { - "description": "Estimated extraction accuracy for this field.", - "type": "number", - "x-nullable": false - } - } - }, - "ErrorResponse": { - "type": "object", - "required": [ - "error" - ], - "properties": { - "error": { - "$ref": "#/definitions/ErrorInformation" - } - } - }, - "ErrorInformation": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - } - }, - "ComposeRequest": { - "description": "Request contract for compose operation.", - "required": [ - "modelIds" - ], - "type": "object", - "properties": { - "modelIds": { - "description": "List of model ids to compose.", - "uniqueItems": false, - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - }, - "modelName": { - "$ref": "#/definitions/ModelName" - } - } - }, - "AnalyzeResult": { - "description": "Analyze operation result.", - "type": "object", - "required": [ - "version", - "readResults" - ], - "properties": { - "version": { - "description": "Version of schema used for this result.", - "type": "string" - }, - "readResults": { - "description": "Text extracted from the input.", - "type": "array", - "items": { - "$ref": "#/definitions/ReadResult" - } - }, - "pageResults": { - "description": "Page-level information extracted from the input.", - "type": "array", - "items": { - "$ref": "#/definitions/PageResult" - } - }, - "documentResults": { - "description": "Document-level information extracted from the input.", - "type": "array", - "items": { - "$ref": "#/definitions/DocumentResult" - } - }, - "errors": { - "description": "List of errors reported during the analyze operation.", - "type": "array", - "items": { - "$ref": "#/definitions/ErrorInformation" - } - } - } - }, - "ReadResult": { - "description": "Text extracted from a page in the input document.", - "type": "object", - "required": [ - "page", - "angle", - "width", - "height", - "unit" - ], - "properties": { - "page": { - "description": "The 1-based page number in the input document.", - "type": "integer", - "minimum": 1, - "x-nullable": false - }, - "angle": { - "description": "The general orientation of the text in clockwise direction, measured in degrees between (-180, 180].", - "type": "number", - "minimum": -180, - "maximum": 180, - "exclusiveMinimum": true, - "x-nullable": false - }, - "width": { - "description": "The width of the image/PDF in pixels/inches, respectively.", - "type": "number", - "minimum": 0, - "x-nullable": false - }, - "height": { - "description": "The height of the image/PDF in pixels/inches, respectively.", - "type": "number", - "minimum": 0, - "x-nullable": false - }, - "unit": { - "description": "The unit used by the width, height and boundingBox properties. For images, the unit is \"pixel\". For PDF, the unit is \"inch\".", - "type": "string", - "enum": [ - "pixel", - "inch" - ], - "x-ms-enum": { - "name": "LengthUnit", - "modelAsString": false - }, - "x-nullable": false - }, - "language": { - "description": "The detected language on the page overall.", - "$ref": "#/definitions/Language" - }, - "lines": { - "description": "When includeTextDetails is set to true, a list of recognized text lines. The maximum number of lines returned is 300 per page. The lines are sorted top to bottom, left to right, although in certain cases proximity is treated with higher priority. As the sorting order depends on the detected text, it may change across images and OCR version updates. Thus, business logic should be built upon the actual line location instead of order.", - "type": "array", - "items": { - "$ref": "#/definitions/TextLine" - } - }, - "selectionMarks": { - "description": "List of selection marks extracted from the page.", - "type": "array", - "items": { - "$ref": "#/definitions/SelectionMark" - } - } - } - }, - "Language": { - "description": "Language code", - "type": "string", - "enum": [ - "en", - "es" - ], - "x-ms-enum": { - "name": "Language", - "modelAsString": true - }, - "x-nullable": false - }, - "TextLine": { - "description": "An object representing an extracted text line.", - "type": "object", - "required": [ - "text", - "boundingBox", - "words" - ], - "properties": { - "text": { - "description": "The text content of the line.", - "type": "string" - }, - "boundingBox": { - "description": "Bounding box of an extracted line.", - "$ref": "#/definitions/BoundingBox" - }, - "language": { - "description": "The detected language of this line, if different from the overall page language.", - "$ref": "#/definitions/Language" - }, - "words": { - "description": "List of words in the text line.", - "type": "array", - "items": { - "$ref": "#/definitions/TextWord" - } - } - } - }, - "TextWord": { - "description": "An object representing a word.", - "type": "object", - "required": [ - "boundingBox", - "text" - ], - "properties": { - "text": { - "description": "The text content of the word.", - "type": "string" - }, - "boundingBox": { - "description": "Bounding box of an extracted word.", - "$ref": "#/definitions/BoundingBox" - }, - "confidence": { - "description": "Confidence value.", - "$ref": "#/definitions/Confidence" - }, - "appearance": { - "description": "Text appearance properties.", - "$ref": "#/definitions/Appearance" - } - } - }, - "BoundingBox": { - "description": "Quadrangle bounding box, with coordinates specified relative to the top-left of the original image. The eight numbers represent the four points, clockwise from the top-left corner relative to the text orientation. For image, the (x, y) coordinates are measured in pixels. For PDF, the (x, y) coordinates are measured in inches.", - "type": "array", - "minItems": 8, - "maxItems": 8, - "items": { - "type": "number", - "x-nullable": false - } - }, - "PageResult": { - "description": "Extracted information from a single page.", - "type": "object", - "required": [ - "page" - ], - "properties": { - "page": { - "description": "Page number.", - "type": "integer", - "format": "int32", - "minimum": 1, - "x-nullable": false - }, - "clusterId": { - "description": "Cluster identifier.", - "type": "integer", - "format": "int32", - "minimum": 0, - "x-nullable": false - }, - "keyValuePairs": { - "description": "List of key-value pairs extracted from the page.", - "type": "array", - "items": { - "$ref": "#/definitions/KeyValuePair" - } - }, - "tables": { - "description": "List of data tables extracted from the page.", - "type": "array", - "items": { - "$ref": "#/definitions/DataTable" - } - } - } - }, - "KeyValuePair": { - "description": "Information about the extracted key-value pair.", - "type": "object", - "required": [ - "key", - "value", - "confidence" - ], - "properties": { - "label": { - "description": "A user defined label for the key/value pair entry.", - "type": "string" - }, - "key": { - "description": "Information about the extracted key in a key-value pair.", - "$ref": "#/definitions/KeyValueElement" - }, - "value": { - "description": "Information about the extracted value in a key-value pair.", - "$ref": "#/definitions/KeyValueElement" - }, - "confidence": { - "description": "Confidence value.", - "$ref": "#/definitions/Confidence" - } - } - }, - "KeyValueElement": { - "description": "Information about the extracted key or value in a key-value pair.", - "type": "object", - "required": [ - "text" - ], - "properties": { - "type": { - "$ref": "#/definitions/KeyValueType" - }, - "text": { - "description": "The text content of the key or value.", - "type": "string" - }, - "boundingBox": { - "description": "Bounding box of the key or value.", - "$ref": "#/definitions/BoundingBox" - }, - "elements": { - "description": "When includeTextDetails is set to true, a list of references to the text elements constituting this key or value.", - "type": "array", - "items": { - "$ref": "#/definitions/ElementReference" - } - } - } - }, - "KeyValueType": { - "type": "string", - "description": "Semantic data type of the key value element.", - "enum": [ - "string", - "selectionMark" - ], - "x-ms-enum": { - "name": "KeyValueType", - "modelAsString": true - }, - "x-nullable": false - }, - "ElementReference": { - "description": "Reference to a line, word or selection mark.", - "type": "string" - }, - "SelectionMark": { - "description": "Information about the extracted selection mark.", - "type": "object", - "required": [ - "boundingBox", - "confidence", - "state" - ], - "properties": { - "boundingBox": { - "description": "Bounding box of the selection mark.", - "$ref": "#/definitions/BoundingBox" - }, - "confidence": { - "description": "Confidence value.", - "$ref": "#/definitions/Confidence" - }, - "state": { - "description": "State of the selection mark.", - "type": "string", - "enum": [ - "selected", - "unselected" - ] - } - } - }, - "DataTable": { - "description": "Information about the extracted table contained in a page.", - "type": "object", - "required": [ - "rows", - "columns", - "cells" - ], - "properties": { - "rows": { - "description": "Number of rows.", - "type": "integer", - "minimum": 1, - "x-nullable": false - }, - "columns": { - "description": "Number of columns.", - "type": "integer", - "minimum": 1, - "x-nullable": false - }, - "cells": { - "description": "List of cells contained in the table.", - "type": "array", - "items": { - "$ref": "#/definitions/DataTableCell" - } - } - } - }, - "DataTableCell": { - "description": "Information about the extracted cell in a table.", - "type": "object", - "required": [ - "rowIndex", - "columnIndex", - "text", - "boundingBox", - "confidence" - ], - "properties": { - "rowIndex": { - "description": "Row index of the cell.", - "type": "integer", - "minimum": 0, - "x-nullable": false - }, - "columnIndex": { - "description": "Column index of the cell.", - "type": "integer", - "minimum": 0, - "x-nullable": false - }, - "rowSpan": { - "description": "Number of rows spanned by this cell.", - "type": "integer", - "minimum": 1, - "default": 1, - "x-nullable": false - }, - "columnSpan": { - "description": "Number of columns spanned by this cell.", - "type": "integer", - "minimum": 1, - "default": 1, - "x-nullable": false - }, - "text": { - "description": "Text content of the cell.", - "type": "string" - }, - "boundingBox": { - "description": "Bounding box of the cell.", - "$ref": "#/definitions/BoundingBox" - }, - "confidence": { - "description": "Confidence value.", - "$ref": "#/definitions/Confidence" - }, - "elements": { - "description": "When includeTextDetails is set to true, a list of references to the text elements constituting this table cell.", - "type": "array", - "items": { - "$ref": "#/definitions/ElementReference" - } - }, - "isHeader": { - "description": "Is the current cell a header cell?", - "type": "boolean", - "default": false, - "x-nullable": false - }, - "isFooter": { - "description": "Is the current cell a footer cell?", - "type": "boolean", - "default": false, - "x-nullable": false - } - } - }, - "DocumentResult": { - "description": "A set of extracted fields corresponding to the input document.", - "type": "object", - "required": [ - "docType", - "pageRange", - "fields" - ], - "properties": { - "docType": { - "description": "Document type.", - "type": "string" - }, - "modelId": { - "description": "Model identifier.", - "type": "string", - "format": "uuid", - "x-nullable": false - }, - "pageRange": { - "description": "First and last page number where the document is found.", - "type": "array", - "minItems": 2, - "maxItems": 2, - "items": { - "type": "integer", - "minimum": 1, - "x-nullable": false - } - }, - "docTypeConfidence": { - "description": "Confidence score.", - "$ref": "#/definitions/Confidence" - }, - "fields": { - "description": "Dictionary of named field values.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/FieldValue" - } - } - } - }, - "FieldValue": { - "description": "Recognized field value.", - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "description": "Type of field value.", - "$ref": "#/definitions/FieldValueType" - }, - "valueString": { - "description": "String value.", - "type": "string" - }, - "valueDate": { - "description": "Date value.", - "format": "date", - "type": "string", - "x-nullable": false - }, - "valueTime": { - "description": "Time value.", - "format": "time", - "type": "string", - "x-nullable": false - }, - "valuePhoneNumber": { - "description": "Phone number value.", - "type": "string" - }, - "valueNumber": { - "description": "Floating point value.", - "type": "number", - "x-nullable": false - }, - "valueInteger": { - "description": "Integer value.", - "type": "integer", - "x-nullable": false - }, - "valueArray": { - "description": "Array of field values.", - "type": "array", - "items": { - "$ref": "#/definitions/FieldValue" - } - }, - "valueObject": { - "description": "Dictionary of named field values.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/FieldValue" - } - }, - "valueSelectionMark": { - "description": "Selection mark value.", - "type": "string", - "enum": [ - "selected", - "unselected" - ], - "x-nullable": false - }, - "text": { - "description": "Text content of the extracted field.", - "type": "string" - }, - "boundingBox": { - "description": "Bounding box of the field value, if appropriate.", - "$ref": "#/definitions/BoundingBox" - }, - "confidence": { - "description": "Confidence score.", - "$ref": "#/definitions/Confidence" - }, - "elements": { - "description": "When includeTextDetails is set to true, a list of references to the text elements constituting this field.", - "type": "array", - "items": { - "$ref": "#/definitions/ElementReference" - } - }, - "page": { - "description": "The 1-based page number in the input document.", - "type": "integer", - "minimum": 1, - "x-nullable": false - } - } - }, - "FieldValueType": { - "type": "string", - "description": "Semantic data type of the field value.", - "enum": [ - "string", - "date", - "time", - "phoneNumber", - "number", - "integer", - "array", - "object", - "selectionMark" - ], - "x-ms-enum": { - "name": "FieldValueType", - "modelAsString": false - }, - "x-nullable": false - }, - "Confidence": { - "description": "Confidence value.", - "type": "number", - "minimum": 0, - "maximum": 1, - "x-nullable": false - }, - "Appearance": { - "description": "The appearance of extracted text.", - "type": "object", - "required": [ - "style", - "styleConfidence" - ], - "properties": { - "style": { - "description": "Style of the extracted text: handwriting or printed.", - "enum": [ - "handwriting", - "printed" - ], - "type": "string", - "x-ms-enum": { - "name": "textStyle", - "modelAsString": false - }, - "x-nullable": false - }, - "styleConfidence": { - "description": "Confidence value of predicted style.", - "$ref": "#/definitions/Confidence" - } - } - } - }, - "parameters": { - "Endpoint": { - "name": "endpoint", - "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).", - "x-ms-parameter-location": "client", - "required": true, - "type": "string", - "in": "path", - "x-ms-skip-url-encoding": true - }, - "FileStream": { - "name": "fileStream", - "description": ".json, .pdf, .jpg, .png or .tiff type file stream.", - "x-ms-parameter-location": "method", - "in": "body", - "schema": { - "$ref": "#/definitions/SourcePath" - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/AnalyzeBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/AnalyzeBatch.json deleted file mode 100644 index fb60f1c7873d..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/AnalyzeBatch.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "{API key}", - "modelId": "{modelId}", - "body": {} - }, - "responses": { - "202": { - "headers": { - "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.3/custom/models/{modelId}/analyzeResults/{resultId}" - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/AnalyzeOperationResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/AnalyzeOperationResult.json deleted file mode 100644 index 5b8a65ac0a6b..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/AnalyzeOperationResult.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}", - "modelId": "{modelId}", - "resultId": "{result Id}", - "body": {} - }, - "responses": { - "200": { - "body": { - "status": "running", - "createdDateTime": "2019-05-01T10:53:21Z", - "lastUpdatedDateTime": "2019-05-01T10:53:23Z", - "analyzeResult": { - "version": "v2.1", - "readResults": [], - "pageResults": [], - "documentResults": [], - "errors": [] - } - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/BusinessCardBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/BusinessCardBatch.json deleted file mode 100644 index 2060d64fd112..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/BusinessCardBatch.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "{API key}", - "body": { - "source": "http://www.example.com/image.jpg" - } - }, - "responses": { - "202": { - "headers": { - "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.3/prebuilt/businessCard/analyzeResults/{resultId}" - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/BusinessCardBatchResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/BusinessCardBatchResult.json deleted file mode 100644 index 2cf7aa15db22..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/BusinessCardBatchResult.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}", - "resultId": "{result Id}", - "body": {} - }, - "responses": { - "200": { - "body": { - "status": "running", - "createdDateTime": "2019-05-01T10:53:21Z", - "lastUpdatedDateTime": "2019-05-01T10:53:23Z", - "analyzeResult": { - "version": "v2.1", - "readResults": [], - "pageResults": [], - "documentResults": [], - "errors": [] - } - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ComposeModels.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ComposeModels.json deleted file mode 100644 index 395c16efd5bf..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ComposeModels.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "{API key}", - "body": {}, - "composeRequest": { - "modelIds": [ - "4afb20d6-3ed0-4cde-ba40-dbd6207268dd", - "6f841356-aa32-42c9-a739-2182c47b79c9" - ] - } - }, - "responses": { - "201": { - "headers": { - "Location": "{endpoint}/formrecognizer/v2.1-preview.3/custom/models/{modelId}" - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyModel.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyModel.json deleted file mode 100644 index 02c65d9fd975..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyModel.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "{API key}", - "modelId": "{modelId}", - "body": {}, - "copyRequest": { - "targetResourceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{resourceName}", - "targetResourceRegion": "westus2", - "copyAuthorization": { - "modelId": "{modelId}", - "accessToken": "{accessToken}", - "expirationDateTimeTicks": 637190189980000000 - } - } - }, - "responses": { - "202": { - "headers": { - "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.3/custom/models/{modelId}/copyResults/{resultId}" - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyModelAuthorization.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyModelAuthorization.json deleted file mode 100644 index 64d05f18e03e..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyModelAuthorization.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "{API key}", - "body": {} - }, - "responses": { - "201": { - "headers": { - "Location": "{endpoint}/formrecognizer/v2.1-preview.3/custom/models/{modelId}" - }, - "body": { - "modelId": "{modelId}", - "accessToken": "{accessToken}", - "expirationDateTimeTicks": 637190189980000000 - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyOperationResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyOperationResult.json deleted file mode 100644 index f7b7b1163884..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyOperationResult.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "{API key}", - "modelId": "{modelId}", - "resultId": "{resultId}", - "body": {} - }, - "responses": { - "200": { - "body": { - "status": "succeeded", - "createdDateTime": "2020-01-01T00:00:00Z", - "lastUpdatedDateTime": "2020-01-01T00:01:00Z", - "copyResult": { - "modelId": "{modelId}", - "errors": [] - } - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyOperationResultWithErrors.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyOperationResultWithErrors.json deleted file mode 100644 index 853dd73e595e..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/CopyOperationResultWithErrors.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "{API key}", - "modelId": "{modelId}", - "resultId": "{resultId}", - "body": {} - }, - "responses": { - "200": { - "body": { - "status": "failed", - "createdDateTime": "2020-01-01T00:00:00Z", - "lastUpdatedDateTime": "2020-01-01T00:01:00Z", - "copyResult": { - "modelId": "{modelId}", - "errors": [ - { - "code": "ResourceResolverError", - "message": "{ErrorMessage}" - } - ] - } - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/DeleteModel.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/DeleteModel.json deleted file mode 100644 index c945ec953dd4..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/DeleteModel.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}", - "modelId": "{modelId}", - "body": {} - }, - "responses": { - "204": {} - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModel.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModel.json deleted file mode 100644 index df1c4b66b252..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModel.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "{API key}", - "modelId": "{modelId}", - "body": {} - }, - "responses": { - "200": { - "body": { - "modelInfo": { - "modelId": "f973e3c1-1148-43bb-bea8-49d0603ab3a8", - "modelName": "my composed model", - "status": "ready", - "createdDateTime": "2019-05-01T10:53:21Z", - "lastUpdatedDateTime": "2019-05-01T10:53:23Z", - "attributes": { - "isComposed": true - } - }, - "keys": { - "clusters": { - "0": [ - "Invoice", - "123112313" - ], - "1": [ - "Please remit payment to:", - "Microsoft" - ] - } - }, - "trainResult": { - "trainingDocuments": [], - "fields": [], - "averageModelAccuracy": 0, - "errors": [] - }, - "composedTrainResults": [ - { - "modelId": "4afb20d6-3ed0-4cde-ba40-dbd6207268dd", - "trainingDocuments": [], - "fields": [], - "averageModelAccuracy": 0, - "errors": [] - }, - { - "modelId": "6f841356-aa32-42c9-a739-2182c47b79c9", - "trainingDocuments": [], - "fields": [], - "averageModelAccuracy": 0, - "errors": [] - } - ] - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModels.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModels.json deleted file mode 100644 index 36ee11465e4f..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModels.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "{API key}", - "op": "full", - "body": {} - }, - "responses": { - "200": { - "body": { - "summary": { - "count": 2, - "limit": 5000, - "lastUpdatedDateTime": "2019-05-01T10:53:21Z" - }, - "modelList": [ - { - "modelId": "f973e3c1-1148-43bb-bea8-49d0603ab3a8", - "modelName": "test model 1", - "status": "ready", - "createdDateTime": "2019-05-01T10:53:21Z", - "lastUpdatedDateTime": "2019-05-01T10:53:23Z", - "attributes": { - "isComposed": false - } - }, - { - "modelId": "f973e3c1-0001-43bb-bea8-49d0603ab3a8", - "modelName": "test model 2", - "status": "ready", - "createdDateTime": "2019-05-01T10:53:21Z", - "lastUpdatedDateTime": "2019-05-01T10:53:23Z", - "attributes": { - "isComposed": true - } - } - ], - "nextLink": "" - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModelsSummary.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModelsSummary.json deleted file mode 100644 index 507495b78206..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/GetModelsSummary.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "{API key}", - "op": "summary", - "body": {} - }, - "responses": { - "200": { - "body": { - "summary": { - "count": 5, - "limit": 5000, - "lastUpdatedDateTime": "2019-05-01T10:53:21Z" - } - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/IdBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/IdBatch.json deleted file mode 100644 index 632a915d9127..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/IdBatch.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "{API key}", - "body": {} - }, - "responses": { - "202": { - "headers": { - "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.3/prebuilt/id/analyzeResults/{resultId}" - } - } - } -} \ No newline at end of file diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/IdBatchResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/IdBatchResult.json deleted file mode 100644 index 872ae12af891..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/IdBatchResult.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}", - "resultId": "{result Id}", - "body": {} - }, - "responses": { - "200": { - "body": { - "status": "running", - "createdDateTime": "2019-05-01T10:53:21Z", - "lastUpdatedDateTime": "2019-05-01T10:53:23Z", - "analyzeResult": { - "version": "v2.1", - "readResults": [], - "pageResults": [], - "documentResults": [], - "errors": [] - } - } - } - } -} \ No newline at end of file diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/InvoiceBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/InvoiceBatch.json deleted file mode 100644 index 8714c17650d5..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/InvoiceBatch.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "{API key}", - "body": {} - }, - "responses": { - "202": { - "headers": { - "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.3/prebuilt/invoice/analyzeResults/{resultId}" - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/InvoiceBatchResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/InvoiceBatchResult.json deleted file mode 100644 index 2cf7aa15db22..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/InvoiceBatchResult.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}", - "resultId": "{result Id}", - "body": {} - }, - "responses": { - "200": { - "body": { - "status": "running", - "createdDateTime": "2019-05-01T10:53:21Z", - "lastUpdatedDateTime": "2019-05-01T10:53:23Z", - "analyzeResult": { - "version": "v2.1", - "readResults": [], - "pageResults": [], - "documentResults": [], - "errors": [] - } - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/LayoutBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/LayoutBatch.json deleted file mode 100644 index a489c3a75e6f..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/LayoutBatch.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "{API key}", - "language": "en", - "body": {} - }, - "responses": { - "202": { - "headers": { - "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.3/layout/analyzeResults/{resultId}" - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/LayoutBatchResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/LayoutBatchResult.json deleted file mode 100644 index 2a258bfe71bc..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/LayoutBatchResult.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}", - "resultId": "{result Id}", - "body": {} - }, - "responses": { - "200": { - "body": { - "status": "succeeded", - "createdDateTime": "2019-05-01T10:53:21Z", - "lastUpdatedDateTime": "2019-05-01T10:53:23Z", - "analyzeResult": { - "version": "v2.1", - "readResults": [], - "pageResults": [] - } - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ReceiptsBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ReceiptsBatch.json deleted file mode 100644 index 18080f028272..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ReceiptsBatch.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "{API key}", - "body": {} - }, - "responses": { - "202": { - "headers": { - "Operation-Location": "{endpoint}/formrecognizer/v2.1-preview.3/prebuilt/receipt/analyzeResults/{resultId}" - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ReceiptsBatchResult.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ReceiptsBatchResult.json deleted file mode 100644 index 2cf7aa15db22..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/ReceiptsBatchResult.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Ocp-Apim-Subscription-Key": "{API key}", - "resultId": "{result Id}", - "body": {} - }, - "responses": { - "200": { - "body": { - "status": "running", - "createdDateTime": "2019-05-01T10:53:21Z", - "lastUpdatedDateTime": "2019-05-01T10:53:23Z", - "analyzeResult": { - "version": "v2.1", - "readResults": [], - "pageResults": [], - "documentResults": [], - "errors": [] - } - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/TrainBatch.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/TrainBatch.json deleted file mode 100644 index b531bc313c51..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/TrainBatch.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "{API key}", - "body": {}, - "trainRequest": { - "source": "/input/data1" - } - }, - "responses": { - "201": { - "headers": { - "Location": "{endpoint}/formrecognizer/v2.1-preview.3/custom/models/{modelId}" - } - } - } -} diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/TrainBatchWithSubFolders.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/TrainBatchWithSubFolders.json deleted file mode 100644 index ee7e6594e5ae..000000000000 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.3/examples/TrainBatchWithSubFolders.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "parameters": { - "endpoint": "{endpoint}", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "{API key}", - "body": {}, - "trainRequest": { - "source": "/input/data1", - "sourceFilter": { - "prefix": "", - "includeSubFolders": false - }, - "useLabelFile": false - } - }, - "responses": { - "201": { - "headers": { - "Location": "{endpoint}/formrecognizer/v2.1-preview.3/custom/models/{modelId}" - } - } - } -} From c4af74b001b1bdb2c1f2e8413f963126f2215d9a Mon Sep 17 00:00:00 2001 From: Sandeep Parab Date: Sun, 1 Nov 2020 21:56:30 -0800 Subject: [PATCH 09/19] Adding .bmp, language support, table bounding box. --- .../v2.1-preview.2/FormRecognizer.json | 48 +++++++++++++++---- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json index 2b346f270122..c4ba52fe99c7 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json @@ -476,7 +476,8 @@ "application/json", "image/jpeg", "image/png", - "image/tiff" + "image/tiff", + "image/bmp" ], "produces": [ "application/json" @@ -577,7 +578,8 @@ "application/json", "image/jpeg", "image/png", - "image/tiff" + "image/tiff", + "image/bmp" ], "produces": [ "application/json" @@ -678,7 +680,8 @@ "application/json", "image/jpeg", "image/png", - "image/tiff" + "image/tiff", + "image/bmp" ], "produces": [ "application/json" @@ -775,11 +778,33 @@ "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', 'image/tiff' or 'image/bmp'. 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", + "image/bmp" ], "produces": [ "application/json" ], "parameters": [ + { + "name": "language", + "in": "query", + "description": "The BCP-47 language code of the text in the document. Currently, only English ('en'), Dutch (‘nl’), French (‘fr’), German (‘de’), Italian (‘it’), Portuguese (‘pt'), simplified Chinese ('zh-Hans') and Spanish ('es') are supported (print – nine languages and handwritten – English only). Layout supports auto language identification and multilanguage documents, so only provide a language code if you would like to force the documented to be processed as that specific language.", + "type": "string", + "enum": [ + "de", + "en", + "es", + "fr", + "it", + "nl", + "pt", + "zh-Hans" + ] + }, { "$ref": "#/parameters/FileStream" }, @@ -1611,6 +1636,10 @@ "items": { "$ref": "#/definitions/TextWord" } + }, + "appearance": { + "description": "Text appearance properties.", + "$ref": "#/definitions/Appearance" } } }, @@ -1633,10 +1662,6 @@ "confidence": { "description": "Confidence value.", "$ref": "#/definitions/Confidence" - }, - "appearance": { - "description": "Text appearance properties.", - "$ref": "#/definitions/Appearance" } } }, @@ -1791,7 +1816,8 @@ "required": [ "rows", "columns", - "cells" + "cells", + "boundingBox" ], "properties": { "rows": { @@ -1812,6 +1838,10 @@ "items": { "$ref": "#/definitions/DataTableCell" } + }, + "boundingBox": { + "description": "Bounding box of the table.", + "$ref": "#/definitions/BoundingBox" } } }, @@ -1916,7 +1946,7 @@ } }, "docTypeConfidence": { - "description": "Confidence score.", + "description": "Predicted document type confidence.", "$ref": "#/definitions/Confidence" }, "fields": { From 7a9bd65991cef04d818e2ccda955b8b38ea2e8ce Mon Sep 17 00:00:00 2001 From: Sandeep Parab Date: Sun, 1 Nov 2020 22:09:11 -0800 Subject: [PATCH 10/19] Refactoring Locale parameter. --- .../v2.1-preview.2/FormRecognizer.json | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json index c4ba52fe99c7..de0109d9f7c0 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json @@ -493,11 +493,7 @@ "x-nullable": false }, { - "name": "locale", - "in": "query", - "description": "Locale of the business card. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default).", - "required": false, - "type": "string" + "$ref": "#/parameters/Locale" }, { "$ref": "#/parameters/FileStream" @@ -595,11 +591,7 @@ "x-nullable": false }, { - "name": "locale", - "in": "query", - "description": "Locale of the invoice. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default).", - "required": false, - "type": "string" + "$ref": "#/parameters/Locale" }, { "$ref": "#/parameters/FileStream" @@ -697,11 +689,7 @@ "x-nullable": false }, { - "name": "locale", - "in": "query", - "description": "Locale of the receipt. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default).", - "required": false, - "type": "string" + "$ref": "#/parameters/Locale" }, { "$ref": "#/parameters/FileStream" @@ -2148,6 +2136,20 @@ "type": "string", "pattern": "(^[0-9]+-[0-9]+$)|(^[0-9]+$)" } + }, + "Locale": { + "name": "locale", + "in": "query", + "description": "Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default).", + "required": false, + "type": "string", + "enum": [ + "en-AU", + "en-CA", + "en-GB", + "en-IN", + "en-US" + ] } } } From e8140d797902972413b25f3e13ad4e1ae8857200 Mon Sep 17 00:00:00 2001 From: Sandeep Parab Date: Sun, 1 Nov 2020 22:22:29 -0800 Subject: [PATCH 11/19] Refactor language parameter. --- .../v2.1-preview.2/FormRecognizer.json | 39 ++++++++++++------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json index de0109d9f7c0..b1d958554cb0 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json @@ -778,20 +778,7 @@ ], "parameters": [ { - "name": "language", - "in": "query", - "description": "The BCP-47 language code of the text in the document. Currently, only English ('en'), Dutch (‘nl’), French (‘fr’), German (‘de’), Italian (‘it’), Portuguese (‘pt'), simplified Chinese ('zh-Hans') and Spanish ('es') are supported (print – nine languages and handwritten – English only). Layout supports auto language identification and multilanguage documents, so only provide a language code if you would like to force the documented to be processed as that specific language.", - "type": "string", - "enum": [ - "de", - "en", - "es", - "fr", - "it", - "nl", - "pt", - "zh-Hans" - ] + "$ref": "#/parameters/Language" }, { "$ref": "#/parameters/FileStream" @@ -1589,7 +1576,13 @@ "type": "string", "enum": [ "en", - "es" + "es", + "de", + "fr", + "it", + "nl", + "pt", + "zh-Hans" ], "x-ms-enum": { "name": "Language", @@ -2150,6 +2143,22 @@ "en-IN", "en-US" ] + }, + "Language": { + "name": "language", + "in": "query", + "description": "The BCP-47 language code of the text in the document. Currently, only English ('en'), Dutch (‘nl’), French (‘fr’), German (‘de’), Italian (‘it’), Portuguese (‘pt'), simplified Chinese ('zh-Hans') and Spanish ('es') are supported (print – nine languages and handwritten – English only). Layout supports auto language identification and multilanguage documents, so only provide a language code if you would like to force the documented to be processed as that specific language.", + "type": "string", + "enum": [ + "en", + "es", + "de", + "fr", + "it", + "nl", + "pt", + "zh-Hans" + ] } } } From 6fb824ec1131a6a626c20c8e3f000c27e06cfc81 Mon Sep 17 00:00:00 2001 From: Sandeep Parab Date: Sun, 1 Nov 2020 22:52:01 -0800 Subject: [PATCH 12/19] Ran prettier. --- .../FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json index b1d958554cb0..5524a6684868 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json @@ -2099,7 +2099,7 @@ } } }, - "parameters": { + "parameters": { "Endpoint": { "name": "endpoint", "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).", From 857b4048bce4b6344be7ca4895ebc8ee4fa01f6a Mon Sep 17 00:00:00 2001 From: Sandeep Parab Date: Sun, 1 Nov 2020 23:00:16 -0800 Subject: [PATCH 13/19] Spell check fix. --- .../FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json index 5524a6684868..74da4f281219 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json @@ -2147,7 +2147,7 @@ "Language": { "name": "language", "in": "query", - "description": "The BCP-47 language code of the text in the document. Currently, only English ('en'), Dutch (‘nl’), French (‘fr’), German (‘de’), Italian (‘it’), Portuguese (‘pt'), simplified Chinese ('zh-Hans') and Spanish ('es') are supported (print – nine languages and handwritten – English only). Layout supports auto language identification and multilanguage documents, so only provide a language code if you would like to force the documented to be processed as that specific language.", + "description": "The BCP-47 language code of the text in the document. Currently, only English ('en'), Dutch (‘nl’), French (‘fr’), German (‘de’), Italian (‘it’), Portuguese (‘pt'), simplified Chinese ('zh-Hans') and Spanish ('es') are supported (print – nine languages and handwritten – English only). Layout supports auto language identification and multi language documents, so only provide a language code if you would like to force the documented to be processed as that specific language.", "type": "string", "enum": [ "en", From dd637e2e9196f4d3e1c02a0131a46fa91ebc9455 Mon Sep 17 00:00:00 2001 From: Sandeep Parab Date: Sun, 1 Nov 2020 23:17:45 -0800 Subject: [PATCH 14/19] Update to add preview.2 swagger. --- .../data-plane/FormRecognizer/readme.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/readme.md b/specification/cognitiveservices/data-plane/FormRecognizer/readme.md index 3ad0fd72416b..8dafb7c0ef9e 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/readme.md +++ b/specification/cognitiveservices/data-plane/FormRecognizer/readme.md @@ -15,9 +15,16 @@ openapi-type: data-plane # Releases -### Release 2.1-preview -These settings apply only when `--tag=release_2_1_preview` is specified on the command line. -``` yaml $(tag) == 'release_2_1_preview' +### Release 2.1-preview.2 +These settings apply only when `--tag=release_2_1_preview.2` is specified on the command line. +``` yaml $(tag) == 'release_2_1_preview.2' +input-file: + - preview/v2.1-preview.2/FormRecognizer.json +``` + +### Release 2.1-preview.1 +These settings apply only when `--tag=release_2_1_preview.1` is specified on the command line. +``` yaml $(tag) == 'release_2_1_preview.1' input-file: - preview/v2.1-preview.1/FormRecognizer.json ``` From c664c07d2b72b3f67d6344db70607c2990456236 Mon Sep 17 00:00:00 2001 From: ramparab <49212302+ramparab@users.noreply.github.com> Date: Mon, 2 Nov 2020 21:02:09 -0800 Subject: [PATCH 15/19] Update specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json Co-authored-by: Krista Pratico --- .../FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json index 74da4f281219..a8391952b997 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json @@ -2135,6 +2135,7 @@ "in": "query", "description": "Locale of the input document. Supported locales include: en-AU, en-CA, en-GB, en-IN, en-US(default).", "required": false, + "x-ms-parameter-location": "method", "type": "string", "enum": [ "en-AU", From 5679fdf6c2c975f521732ae17a0527ddcb109752 Mon Sep 17 00:00:00 2001 From: ramparab <49212302+ramparab@users.noreply.github.com> Date: Mon, 2 Nov 2020 21:02:23 -0800 Subject: [PATCH 16/19] Update specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json Co-authored-by: Krista Pratico --- .../FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json index a8391952b997..70ce17b9bd4e 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json @@ -2149,6 +2149,8 @@ "name": "language", "in": "query", "description": "The BCP-47 language code of the text in the document. Currently, only English ('en'), Dutch (‘nl’), French (‘fr’), German (‘de’), Italian (‘it’), Portuguese (‘pt'), simplified Chinese ('zh-Hans') and Spanish ('es') are supported (print – nine languages and handwritten – English only). Layout supports auto language identification and multi language documents, so only provide a language code if you would like to force the documented to be processed as that specific language.", + "required": false, + "x-ms-parameter-location": "method", "type": "string", "enum": [ "en", From 7f9992889a91ed9ecef53c2ccbe16c4263ef3a0b Mon Sep 17 00:00:00 2001 From: Sandeep Parab Date: Mon, 2 Nov 2020 21:05:52 -0800 Subject: [PATCH 17/19] Incorporate review feedback. --- .../preview/v2.1-preview.2/FormRecognizer.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json index 74da4f281219..8056d0fa9be9 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json @@ -2142,7 +2142,11 @@ "en-GB", "en-IN", "en-US" - ] + ], + "x-ms-enum": { + "name": "Locale", + "modelAsString": false + } }, "Language": { "name": "language", @@ -2158,7 +2162,11 @@ "nl", "pt", "zh-Hans" - ] + ], + "x-ms-enum": { + "name": "Language", + "modelAsString": false + } } } } From 97ae1493ff37d947cc26e00a3a5abd096982517b Mon Sep 17 00:00:00 2001 From: Sandeep Parab Date: Tue, 10 Nov 2020 00:45:21 -0800 Subject: [PATCH 18/19] Incorporating review feedback. --- .../FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json index 03b38af6f6bf..f6e1efe36cd2 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json @@ -2146,7 +2146,7 @@ ], "x-ms-enum": { "name": "Locale", - "modelAsString": false + "modelAsString": true } }, "Language": { @@ -2168,7 +2168,7 @@ ], "x-ms-enum": { "name": "Language", - "modelAsString": false + "modelAsString": true } } } From cba165e5e7a0be904ae9584f1bcbd92c8ae07a9f Mon Sep 17 00:00:00 2001 From: Sandeep Parab Date: Mon, 11 Jan 2021 15:26:51 -0800 Subject: [PATCH 19/19] Adding language to ReadResult - Japan --- .../FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json index f6e1efe36cd2..e417ad0f1de4 100644 --- a/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json +++ b/specification/cognitiveservices/data-plane/FormRecognizer/preview/v2.1-preview.2/FormRecognizer.json @@ -1582,6 +1582,7 @@ "it", "nl", "pt", + "ja", "zh-Hans" ], "x-ms-enum": {