azure.cognitiveservices.formrecognizer.models module

exception azure.cognitiveservices.formrecognizer.models.ErrorResponseException(deserialize, response, *args)[source]

Bases: msrest.exceptions.HttpOperationError

Server responsed with exception of type: ‘ErrorResponse’.

Parameters
  • deserialize – A deserializer

  • response – Server response to be deserialized.

class azure.cognitiveservices.formrecognizer.models.TrainRequest(*, source: str, **kwargs)[source]

Bases: msrest.serialization.Model

Contract to initiate a train request.

All required parameters must be populated in order to send to Azure.

Parameters

source (str) – Required. Get or set source path.

class azure.cognitiveservices.formrecognizer.models.FormDocumentReport(*, document_name: str = None, pages: int = None, errors=None, status=None, **kwargs)[source]

Bases: msrest.serialization.Model

FormDocumentReport.

Parameters
  • document_name (str) – Reference to the data that the report is for.

  • pages (int) – Total number of pages trained on.

  • errors (list[str]) – List of errors per page.

  • status (str or enum) – Status of the training operation. Possible values include: ‘success’, ‘partialSuccess’, ‘failure’

class azure.cognitiveservices.formrecognizer.models.FormOperationError(*, error_message: str = None, **kwargs)[source]

Bases: msrest.serialization.Model

Error reported during an operation.

Parameters

error_message (str) – Message reported during the train operation.

class azure.cognitiveservices.formrecognizer.models.TrainResult(*, model_id: str = None, training_documents=None, errors=None, **kwargs)[source]

Bases: msrest.serialization.Model

Response of the Train API call.

Parameters
  • model_id (str) – Identifier of the model.

  • training_documents (list[FormDocumentReport]) – List of documents used to train the model and the train operation error reported by each.

  • errors (list[FormOperationError]) – Errors returned during the training operation.

class azure.cognitiveservices.formrecognizer.models.KeysResult(*, clusters=None, **kwargs)[source]

Bases: msrest.serialization.Model

Result of an operation to get the keys extracted by a model.

Parameters

clusters (dict[str, list[str]]) – Object mapping ClusterIds to Key lists.

class azure.cognitiveservices.formrecognizer.models.ModelResult(*, model_id: str = None, status=None, created_date_time=None, last_updated_date_time=None, **kwargs)[source]

Bases: msrest.serialization.Model

Result of a model status query operation.

Parameters
  • model_id (str) – Get or set model identifier.

  • status (str or enum) – Get or set the status of model. Possible values include: ‘created’, ‘ready’, ‘invalid’

  • created_date_time (datetime) – Get or set the created date time of the model.

  • last_updated_date_time (datetime) – Get or set the model last updated datetime.

class azure.cognitiveservices.formrecognizer.models.ModelsResult(*, models_property=None, **kwargs)[source]

Bases: msrest.serialization.Model

Result of query operation to fetch multiple models.

Parameters

models_property (list[ModelResult]) – Collection of models.

class azure.cognitiveservices.formrecognizer.models.InnerError(*, request_id: str = None, **kwargs)[source]

Bases: msrest.serialization.Model

InnerError.

Parameters

request_id (str) –

class azure.cognitiveservices.formrecognizer.models.ErrorInformation(*, code: str = None, inner_error=None, message: str = None, **kwargs)[source]

Bases: msrest.serialization.Model

ErrorInformation.

Parameters
class azure.cognitiveservices.formrecognizer.models.ErrorResponse(*, error=None, **kwargs)[source]

Bases: msrest.serialization.Model

ErrorResponse.

Parameters

error (ErrorInformation) –

class azure.cognitiveservices.formrecognizer.models.ExtractedToken(*, text: str = None, bounding_box=None, confidence: float = None, **kwargs)[source]

Bases: msrest.serialization.Model

Canonical representation of single extracted text.

Parameters
  • text (str) – String value of the extracted text.

  • bounding_box (list[float]) – Bounding box of the extracted text. Represents the location of the extracted text as a pair of cartesian co-ordinates. The co-ordinate pairs are arranged by top-left, top-right, bottom-right and bottom-left endpoints box with origin reference from the bottom-left of the page.

  • confidence (float) – A measure of accuracy of the extracted text.

class azure.cognitiveservices.formrecognizer.models.ExtractedKeyValuePair(*, key=None, value=None, **kwargs)[source]

Bases: msrest.serialization.Model

Representation of a key-value pair as a list of key and value tokens.

Parameters
  • key (list[ExtractedToken]) – List of tokens for the extracted key in a key-value pair.

  • value (list[ExtractedToken]) – List of tokens for the extracted value in a key-value pair.

class azure.cognitiveservices.formrecognizer.models.ExtractedTableColumn(*, header=None, entries=None, **kwargs)[source]

Bases: msrest.serialization.Model

Extraction information of a column in a table.

Parameters
  • header (list[ExtractedToken]) – List of extracted tokens for the column header.

  • entries (list[list[ExtractedToken]]) – Extracted text for each cell of a column. Each cell in the column can have a list of one or more tokens.

class azure.cognitiveservices.formrecognizer.models.ExtractedTable(*, id: str = None, columns=None, **kwargs)[source]

Bases: msrest.serialization.Model

Extraction information about a table contained in a page.

Parameters
class azure.cognitiveservices.formrecognizer.models.ExtractedPage(*, number: int = None, height: int = None, width: int = None, cluster_id: int = None, key_value_pairs=None, tables=None, **kwargs)[source]

Bases: msrest.serialization.Model

Extraction information of a single page in a with a document.

Parameters
  • number (int) – Page number.

  • height (int) – Height of the page (in pixels).

  • width (int) – Width of the page (in pixels).

  • cluster_id (int) – Cluster identifier.

  • key_value_pairs (list[ExtractedKeyValuePair]) – List of Key-Value pairs extracted from the page.

  • tables (list[ExtractedTable]) – List of Tables and their information extracted from the page.

class azure.cognitiveservices.formrecognizer.models.AnalyzeResult(*, status=None, pages=None, errors=None, **kwargs)[source]

Bases: msrest.serialization.Model

Analyze API call result.

Parameters
  • status (str or enum) – Status of the analyze operation. Possible values include: ‘success’, ‘partialSuccess’, ‘failure’

  • pages (list[ExtractedPage]) – Page level information extracted in the analyzed document.

  • errors (list[FormOperationError]) – List of errors reported during the analyze operation.