azure.ai.documentintelligence package

class azure.ai.documentintelligence.DocumentIntelligenceAdministrationClient(endpoint: str, credential: AzureKeyCredential | TokenCredential, **kwargs: Any)[source]

DocumentIntelligenceAdministrationClient.

Parameters:
  • endpoint (str) – The Document Intelligence service endpoint. Required.

  • credential (AzureKeyCredential or TokenCredential) – Credential needed for the client to connect to Azure. Is either a AzureKeyCredential type or a TokenCredential type. Required.

Keyword Arguments:
  • api_version (str) – The API version to use for this operation. Default value is “2024-02-29-preview”. Note that overriding this default value may result in unsupported behavior.

  • polling_interval (int) – Default waiting time between two polls for LRO operations if no Retry-After header is present.

authorize_model_copy(authorize_copy_request: AuthorizeCopyRequest | MutableMapping[str, Any] | IO[bytes], **kwargs: Any) CopyAuthorization

Generates authorization to copy a document model to this location with specified modelId and optional description.

Parameters:

authorize_copy_request (AuthorizeCopyRequest or JSON or IO[bytes]) – Authorize copy request parameters. Is one of the following types: AuthorizeCopyRequest, JSON, IO[bytes] Required.

Returns:

CopyAuthorization. The CopyAuthorization is compatible with MutableMapping

Return type:

CopyAuthorization

Raises:

HttpResponseError

Example

# JSON input template you can fill out and use as your body input.
authorize_copy_request = {
    "modelId": "str",  # Unique document model name. Required.
    "description": "str",  # Optional. Document model description.
    "tags": {
        "str": "str"  # Optional. List of key-value tag attributes associated
          with the document model.
    }
}

# response body for status code(s): 200
response == {
    "accessToken": "str",  # Token used to authorize the request. Required.
    "expirationDateTime": "2020-02-20 00:00:00",  # Date/time when the access
      token expires. Required.
    "targetModelId": "str",  # Identifier of the target document model. Required.
    "targetModelLocation": "str",  # URL of the copied document model in the
      target account. Required.
    "targetResourceId": "str",  # ID of the target Azure resource where the
      document model should be copied to. Required.
    "targetResourceRegion": "str"  # Location of the target Azure resource where
      the document model should be copied to. Required.
}
begin_build_classifier(build_request: BuildDocumentClassifierRequest | MutableMapping[str, Any] | IO[bytes], **kwargs: Any) LROPoller[DocumentClassifierDetails]

Builds a custom document classifier.

Parameters:

build_request (BuildDocumentClassifierRequest or JSON or IO[bytes]) – Build request parameters. Is one of the following types: BuildDocumentClassifierRequest, JSON, IO[bytes] Required.

Returns:

An instance of LROPoller that returns DocumentClassifierDetails. The DocumentClassifierDetails is compatible with MutableMapping

Return type:

LROPoller[DocumentClassifierDetails]

Raises:

HttpResponseError

Example

# JSON input template you can fill out and use as your body input.
build_request = {
    "classifierId": "str",  # Unique document classifier name. Required.
    "docTypes": {
        "str": {
            "azureBlobFileListSource": {
                "containerUrl": "str",  # Azure Blob Storage
                  container URL. Required.
                "fileList": "str"  # Path to a JSONL file within the
                  container specifying a subset of documents. Required.
            },
            "azureBlobSource": {
                "containerUrl": "str",  # Azure Blob Storage
                  container URL. Required.
                "prefix": "str"  # Optional. Blob name prefix.
            },
            "sourceKind": "str"  # Optional. Type of training data
              source. Known values are: "url", "base64", "azureBlob", and
              "azureBlobFileList".
        }
    },
    "baseClassifierId": "str",  # Optional. Base classifierId on top of which to
      train the classifier.
    "description": "str"  # Optional. Document classifier description.
}

# response body for status code(s): 202
response == {
    "apiVersion": "str",  # API version used to create this document classifier.
      Required.
    "classifierId": "str",  # Unique document classifier name. Required.
    "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      document classifier was created. Required.
    "docTypes": {
        "str": {
            "azureBlobFileListSource": {
                "containerUrl": "str",  # Azure Blob Storage
                  container URL. Required.
                "fileList": "str"  # Path to a JSONL file within the
                  container specifying a subset of documents. Required.
            },
            "azureBlobSource": {
                "containerUrl": "str",  # Azure Blob Storage
                  container URL. Required.
                "prefix": "str"  # Optional. Blob name prefix.
            },
            "sourceKind": "str"  # Optional. Type of training data
              source. Known values are: "url", "base64", "azureBlob", and
              "azureBlobFileList".
        }
    },
    "baseClassifierId": "str",  # Optional. Base classifierId on top of which the
      classifier was trained.
    "description": "str",  # Optional. Document classifier description.
    "expirationDateTime": "2020-02-20 00:00:00",  # Optional. Date and time (UTC)
      when the document classifier will expire.
    "warnings": [
        {
            "code": "str",  # One of a server-defined set of warning
              codes. Required.
            "message": "str",  # A human-readable representation of the
              warning. Required.
            "target": "str"  # Optional. The target of the error.
        }
    ]
}
begin_build_document_model(build_request: BuildDocumentModelRequest | MutableMapping[str, Any] | IO[bytes], **kwargs: Any) LROPoller[DocumentModelDetails]

Builds a custom document analysis model.

Parameters:

build_request (BuildDocumentModelRequest or JSON or IO[bytes]) – Build request parameters. Is one of the following types: BuildDocumentModelRequest, JSON, IO[bytes] Required.

Returns:

An instance of LROPoller that returns DocumentModelDetails. The DocumentModelDetails is compatible with MutableMapping

Return type:

LROPoller[DocumentModelDetails]

Raises:

HttpResponseError

Example

# JSON input template you can fill out and use as your body input.
build_request = {
    "buildMode": "str",  # Custom document model build mode. Required. Known
      values are: "template" and "neural".
    "modelId": "str",  # Unique document model name. Required.
    "azureBlobFileListSource": {
        "containerUrl": "str",  # Azure Blob Storage container URL. Required.
        "fileList": "str"  # Path to a JSONL file within the container
          specifying a subset of documents. Required.
    },
    "azureBlobSource": {
        "containerUrl": "str",  # Azure Blob Storage container URL. Required.
        "prefix": "str"  # Optional. Blob name prefix.
    },
    "description": "str",  # Optional. Document model description.
    "tags": {
        "str": "str"  # Optional. List of key-value tag attributes associated
          with the document model.
    }
}

# response body for status code(s): 202
response == {
    "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      document model was created. Required.
    "modelId": "str",  # Unique document model name. Required.
    "apiVersion": "str",  # Optional. API version used to create this document
      model.
    "azureBlobFileListSource": {
        "containerUrl": "str",  # Azure Blob Storage container URL. Required.
        "fileList": "str"  # Path to a JSONL file within the container
          specifying a subset of documents. Required.
    },
    "azureBlobSource": {
        "containerUrl": "str",  # Azure Blob Storage container URL. Required.
        "prefix": "str"  # Optional. Blob name prefix.
    },
    "buildMode": "str",  # Optional. Custom document model build mode. Known
      values are: "template" and "neural".
    "description": "str",  # Optional. Document model description.
    "docTypes": {
        "str": {
            "fieldSchema": {
                "str": {
                    "type": "str",  # Semantic data type of the
                      field value. Required. Known values are: "string", "date",
                      "time", "phoneNumber", "number", "integer", "selectionMark",
                      "countryRegion", "signature", "array", "object", "currency",
                      "address", "boolean", and "selectionGroup".
                    "description": "str",  # Optional. Field
                      description.
                    "example": "str",  # Optional. Example field
                      content.
                    "items": ...,
                    "properties": {
                        "str": ...
                    }
                }
            },
            "buildMode": "str",  # Optional. Custom document model build
              mode. Known values are: "template" and "neural".
            "description": "str",  # Optional. Document model
              description.
            "fieldConfidence": {
                "str": 0.0  # Optional. Estimated confidence for each
                  field.
            }
        }
    },
    "expirationDateTime": "2020-02-20 00:00:00",  # Optional. Date and time (UTC)
      when the document model will expire.
    "tags": {
        "str": "str"  # Optional. List of key-value tag attributes associated
          with the document model.
    },
    "warnings": [
        {
            "code": "str",  # One of a server-defined set of warning
              codes. Required.
            "message": "str",  # A human-readable representation of the
              warning. Required.
            "target": "str"  # Optional. The target of the error.
        }
    ]
}
begin_compose_model(compose_request: ComposeDocumentModelRequest | MutableMapping[str, Any] | IO[bytes], **kwargs: Any) LROPoller[DocumentModelDetails]

Creates a new document model from document types of existing document models.

Parameters:

compose_request (ComposeDocumentModelRequest or JSON or IO[bytes]) – Compose request parameters. Is one of the following types: ComposeDocumentModelRequest, JSON, IO[bytes] Required.

Returns:

An instance of LROPoller that returns DocumentModelDetails. The DocumentModelDetails is compatible with MutableMapping

Return type:

LROPoller[DocumentModelDetails]

Raises:

HttpResponseError

Example

# JSON input template you can fill out and use as your body input.
compose_request = {
    "componentModels": [
        {
            "modelId": "str"  # Unique document model name. Required.
        }
    ],
    "modelId": "str",  # Unique document model name. Required.
    "description": "str",  # Optional. Document model description.
    "tags": {
        "str": "str"  # Optional. List of key-value tag attributes associated
          with the document model.
    }
}

# response body for status code(s): 202
response == {
    "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      document model was created. Required.
    "modelId": "str",  # Unique document model name. Required.
    "apiVersion": "str",  # Optional. API version used to create this document
      model.
    "azureBlobFileListSource": {
        "containerUrl": "str",  # Azure Blob Storage container URL. Required.
        "fileList": "str"  # Path to a JSONL file within the container
          specifying a subset of documents. Required.
    },
    "azureBlobSource": {
        "containerUrl": "str",  # Azure Blob Storage container URL. Required.
        "prefix": "str"  # Optional. Blob name prefix.
    },
    "buildMode": "str",  # Optional. Custom document model build mode. Known
      values are: "template" and "neural".
    "description": "str",  # Optional. Document model description.
    "docTypes": {
        "str": {
            "fieldSchema": {
                "str": {
                    "type": "str",  # Semantic data type of the
                      field value. Required. Known values are: "string", "date",
                      "time", "phoneNumber", "number", "integer", "selectionMark",
                      "countryRegion", "signature", "array", "object", "currency",
                      "address", "boolean", and "selectionGroup".
                    "description": "str",  # Optional. Field
                      description.
                    "example": "str",  # Optional. Example field
                      content.
                    "items": ...,
                    "properties": {
                        "str": ...
                    }
                }
            },
            "buildMode": "str",  # Optional. Custom document model build
              mode. Known values are: "template" and "neural".
            "description": "str",  # Optional. Document model
              description.
            "fieldConfidence": {
                "str": 0.0  # Optional. Estimated confidence for each
                  field.
            }
        }
    },
    "expirationDateTime": "2020-02-20 00:00:00",  # Optional. Date and time (UTC)
      when the document model will expire.
    "tags": {
        "str": "str"  # Optional. List of key-value tag attributes associated
          with the document model.
    },
    "warnings": [
        {
            "code": "str",  # One of a server-defined set of warning
              codes. Required.
            "message": "str",  # A human-readable representation of the
              warning. Required.
            "target": "str"  # Optional. The target of the error.
        }
    ]
}
begin_copy_model_to(model_id: str, copy_to_request: CopyAuthorization | MutableMapping[str, Any] | IO[bytes], **kwargs: Any) LROPoller[DocumentModelDetails]

Copies document model to the target resource, region, and modelId.

Parameters:
  • model_id (str) – Unique document model name. Required.

  • copy_to_request (CopyAuthorization or JSON or IO[bytes]) – Copy to request parameters. Is one of the following types: CopyAuthorization, JSON, IO[bytes] Required.

Returns:

An instance of LROPoller that returns DocumentModelDetails. The DocumentModelDetails is compatible with MutableMapping

Return type:

LROPoller[DocumentModelDetails]

Raises:

HttpResponseError

Example

# JSON input template you can fill out and use as your body input.
copy_to_request = {
    "accessToken": "str",  # Token used to authorize the request. Required.
    "expirationDateTime": "2020-02-20 00:00:00",  # Date/time when the access
      token expires. Required.
    "targetModelId": "str",  # Identifier of the target document model. Required.
    "targetModelLocation": "str",  # URL of the copied document model in the
      target account. Required.
    "targetResourceId": "str",  # ID of the target Azure resource where the
      document model should be copied to. Required.
    "targetResourceRegion": "str"  # Location of the target Azure resource where
      the document model should be copied to. Required.
}

# response body for status code(s): 202
response == {
    "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      document model was created. Required.
    "modelId": "str",  # Unique document model name. Required.
    "apiVersion": "str",  # Optional. API version used to create this document
      model.
    "azureBlobFileListSource": {
        "containerUrl": "str",  # Azure Blob Storage container URL. Required.
        "fileList": "str"  # Path to a JSONL file within the container
          specifying a subset of documents. Required.
    },
    "azureBlobSource": {
        "containerUrl": "str",  # Azure Blob Storage container URL. Required.
        "prefix": "str"  # Optional. Blob name prefix.
    },
    "buildMode": "str",  # Optional. Custom document model build mode. Known
      values are: "template" and "neural".
    "description": "str",  # Optional. Document model description.
    "docTypes": {
        "str": {
            "fieldSchema": {
                "str": {
                    "type": "str",  # Semantic data type of the
                      field value. Required. Known values are: "string", "date",
                      "time", "phoneNumber", "number", "integer", "selectionMark",
                      "countryRegion", "signature", "array", "object", "currency",
                      "address", "boolean", and "selectionGroup".
                    "description": "str",  # Optional. Field
                      description.
                    "example": "str",  # Optional. Example field
                      content.
                    "items": ...,
                    "properties": {
                        "str": ...
                    }
                }
            },
            "buildMode": "str",  # Optional. Custom document model build
              mode. Known values are: "template" and "neural".
            "description": "str",  # Optional. Document model
              description.
            "fieldConfidence": {
                "str": 0.0  # Optional. Estimated confidence for each
                  field.
            }
        }
    },
    "expirationDateTime": "2020-02-20 00:00:00",  # Optional. Date and time (UTC)
      when the document model will expire.
    "tags": {
        "str": "str"  # Optional. List of key-value tag attributes associated
          with the document model.
    },
    "warnings": [
        {
            "code": "str",  # One of a server-defined set of warning
              codes. Required.
            "message": "str",  # A human-readable representation of the
              warning. Required.
            "target": "str"  # Optional. The target of the error.
        }
    ]
}
close() None[source]
delete_classifier(classifier_id: str, **kwargs: Any) None

Deletes document classifier.

Parameters:

classifier_id (str) – Unique document classifier name. Required.

Returns:

None

Return type:

None

Raises:

HttpResponseError

delete_model(model_id: str, **kwargs: Any) None

Deletes document model.

Parameters:

model_id (str) – Unique document model name. Required.

Returns:

None

Return type:

None

Raises:

HttpResponseError

get_classifier(classifier_id: str, **kwargs: Any) DocumentClassifierDetails

Gets detailed document classifier information.

Parameters:

classifier_id (str) – Unique document classifier name. Required.

Returns:

DocumentClassifierDetails. The DocumentClassifierDetails is compatible with MutableMapping

Return type:

DocumentClassifierDetails

Raises:

HttpResponseError

Example

# response body for status code(s): 200
response == {
    "apiVersion": "str",  # API version used to create this document classifier.
      Required.
    "classifierId": "str",  # Unique document classifier name. Required.
    "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      document classifier was created. Required.
    "docTypes": {
        "str": {
            "azureBlobFileListSource": {
                "containerUrl": "str",  # Azure Blob Storage
                  container URL. Required.
                "fileList": "str"  # Path to a JSONL file within the
                  container specifying a subset of documents. Required.
            },
            "azureBlobSource": {
                "containerUrl": "str",  # Azure Blob Storage
                  container URL. Required.
                "prefix": "str"  # Optional. Blob name prefix.
            },
            "sourceKind": "str"  # Optional. Type of training data
              source. Known values are: "url", "base64", "azureBlob", and
              "azureBlobFileList".
        }
    },
    "baseClassifierId": "str",  # Optional. Base classifierId on top of which the
      classifier was trained.
    "description": "str",  # Optional. Document classifier description.
    "expirationDateTime": "2020-02-20 00:00:00",  # Optional. Date and time (UTC)
      when the document classifier will expire.
    "warnings": [
        {
            "code": "str",  # One of a server-defined set of warning
              codes. Required.
            "message": "str",  # A human-readable representation of the
              warning. Required.
            "target": "str"  # Optional. The target of the error.
        }
    ]
}
get_model(model_id: str, **kwargs: Any) DocumentModelDetails

Gets detailed document model information.

Parameters:

model_id (str) – Unique document model name. Required.

Returns:

DocumentModelDetails. The DocumentModelDetails is compatible with MutableMapping

Return type:

DocumentModelDetails

Raises:

HttpResponseError

Example

# response body for status code(s): 200
response == {
    "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      document model was created. Required.
    "modelId": "str",  # Unique document model name. Required.
    "apiVersion": "str",  # Optional. API version used to create this document
      model.
    "azureBlobFileListSource": {
        "containerUrl": "str",  # Azure Blob Storage container URL. Required.
        "fileList": "str"  # Path to a JSONL file within the container
          specifying a subset of documents. Required.
    },
    "azureBlobSource": {
        "containerUrl": "str",  # Azure Blob Storage container URL. Required.
        "prefix": "str"  # Optional. Blob name prefix.
    },
    "buildMode": "str",  # Optional. Custom document model build mode. Known
      values are: "template" and "neural".
    "description": "str",  # Optional. Document model description.
    "docTypes": {
        "str": {
            "fieldSchema": {
                "str": {
                    "type": "str",  # Semantic data type of the
                      field value. Required. Known values are: "string", "date",
                      "time", "phoneNumber", "number", "integer", "selectionMark",
                      "countryRegion", "signature", "array", "object", "currency",
                      "address", "boolean", and "selectionGroup".
                    "description": "str",  # Optional. Field
                      description.
                    "example": "str",  # Optional. Example field
                      content.
                    "items": ...,
                    "properties": {
                        "str": ...
                    }
                }
            },
            "buildMode": "str",  # Optional. Custom document model build
              mode. Known values are: "template" and "neural".
            "description": "str",  # Optional. Document model
              description.
            "fieldConfidence": {
                "str": 0.0  # Optional. Estimated confidence for each
                  field.
            }
        }
    },
    "expirationDateTime": "2020-02-20 00:00:00",  # Optional. Date and time (UTC)
      when the document model will expire.
    "tags": {
        "str": "str"  # Optional. List of key-value tag attributes associated
          with the document model.
    },
    "warnings": [
        {
            "code": "str",  # One of a server-defined set of warning
              codes. Required.
            "message": "str",  # A human-readable representation of the
              warning. Required.
            "target": "str"  # Optional. The target of the error.
        }
    ]
}
get_operation(operation_id: str, **kwargs: Any) OperationDetails

Gets operation info.

Parameters:

operation_id (str) – Operation ID. Required.

Returns:

OperationDetails. The OperationDetails is compatible with MutableMapping

Return type:

OperationDetails

Raises:

HttpResponseError

Example

# The response is polymorphic. The following are possible polymorphic responses based
  off discriminator "kind":

# JSON input template for discriminator value "documentClassifierBuild":
operation_details = {
    "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      operation was created. Required.
    "kind": "documentClassifierBuild",
    "lastUpdatedDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      status was last updated. Required.
    "operationId": "str",  # Operation ID. Required.
    "resourceLocation": "str",  # URL of the resource targeted by this operation.
      Required.
    "status": "str",  # Operation status.  notStarted, running, completed, or
      failed. Required. Known values are: "notStarted", "running", "failed",
      "succeeded", "completed", and "canceled".
    "apiVersion": "str",  # Optional. API version used to create this operation.
    "error": {
        "code": "str",  # One of a server-defined set of error codes.
          Required.
        "message": "str",  # A human-readable representation of the error.
          Required.
        "details": [
            ...
        ],
        "innererror": {
            "code": "str",  # Optional. One of a server-defined set of
              error codes.
            "innererror": ...,
            "message": "str"  # Optional. A human-readable representation
              of the error.
        },
        "target": "str"  # Optional. The target of the error.
    },
    "percentCompleted": 0,  # Optional. Operation progress (0-100).
    "result": {
        "apiVersion": "str",  # API version used to create this document
          classifier. Required.
        "classifierId": "str",  # Unique document classifier name. Required.
        "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when
          the document classifier was created. Required.
        "docTypes": {
            "str": {
                "azureBlobFileListSource": {
                    "containerUrl": "str",  # Azure Blob Storage
                      container URL. Required.
                    "fileList": "str"  # Path to a JSONL file
                      within the container specifying a subset of documents. Required.
                },
                "azureBlobSource": {
                    "containerUrl": "str",  # Azure Blob Storage
                      container URL. Required.
                    "prefix": "str"  # Optional. Blob name
                      prefix.
                },
                "sourceKind": "str"  # Optional. Type of training
                  data source. Known values are: "url", "base64", "azureBlob", and
                  "azureBlobFileList".
            }
        },
        "baseClassifierId": "str",  # Optional. Base classifierId on top of
          which the classifier was trained.
        "description": "str",  # Optional. Document classifier description.
        "expirationDateTime": "2020-02-20 00:00:00",  # Optional. Date and
          time (UTC) when the document classifier will expire.
        "warnings": [
            {
                "code": "str",  # One of a server-defined set of
                  warning codes. Required.
                "message": "str",  # A human-readable representation
                  of the warning. Required.
                "target": "str"  # Optional. The target of the error.
            }
        ]
    },
    "tags": {
        "str": "str"  # Optional. List of key-value tag attributes associated
          with the document model.
    }
}

# JSON input template for discriminator value "documentModelCompose":
operation_details = {
    "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      operation was created. Required.
    "kind": "documentModelCompose",
    "lastUpdatedDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      status was last updated. Required.
    "operationId": "str",  # Operation ID. Required.
    "resourceLocation": "str",  # URL of the resource targeted by this operation.
      Required.
    "status": "str",  # Operation status.  notStarted, running, completed, or
      failed. Required. Known values are: "notStarted", "running", "failed",
      "succeeded", "completed", and "canceled".
    "apiVersion": "str",  # Optional. API version used to create this operation.
    "error": {
        "code": "str",  # One of a server-defined set of error codes.
          Required.
        "message": "str",  # A human-readable representation of the error.
          Required.
        "details": [
            ...
        ],
        "innererror": {
            "code": "str",  # Optional. One of a server-defined set of
              error codes.
            "innererror": ...,
            "message": "str"  # Optional. A human-readable representation
              of the error.
        },
        "target": "str"  # Optional. The target of the error.
    },
    "percentCompleted": 0,  # Optional. Operation progress (0-100).
    "result": {
        "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when
          the document model was created. Required.
        "modelId": "str",  # Unique document model name. Required.
        "apiVersion": "str",  # Optional. API version used to create this
          document model.
        "azureBlobFileListSource": {
            "containerUrl": "str",  # Azure Blob Storage container URL.
              Required.
            "fileList": "str"  # Path to a JSONL file within the
              container specifying a subset of documents. Required.
        },
        "azureBlobSource": {
            "containerUrl": "str",  # Azure Blob Storage container URL.
              Required.
            "prefix": "str"  # Optional. Blob name prefix.
        },
        "buildMode": "str",  # Optional. Custom document model build mode.
          Known values are: "template" and "neural".
        "description": "str",  # Optional. Document model description.
        "docTypes": {
            "str": {
                "fieldSchema": {
                    "str": {
                        "type": "str",  # Semantic data type
                          of the field value. Required. Known values are: "string",
                          "date", "time", "phoneNumber", "number", "integer",
                          "selectionMark", "countryRegion", "signature", "array",
                          "object", "currency", "address", "boolean", and
                          "selectionGroup".
                        "description": "str",  # Optional.
                          Field description.
                        "example": "str",  # Optional.
                          Example field content.
                        "items": ...,
                        "properties": {
                            "str": ...
                        }
                    }
                },
                "buildMode": "str",  # Optional. Custom document
                  model build mode. Known values are: "template" and "neural".
                "description": "str",  # Optional. Document model
                  description.
                "fieldConfidence": {
                    "str": 0.0  # Optional. Estimated confidence
                      for each field.
                }
            }
        },
        "expirationDateTime": "2020-02-20 00:00:00",  # Optional. Date and
          time (UTC) when the document model will expire.
        "tags": {
            "str": "str"  # Optional. List of key-value tag attributes
              associated with the document model.
        },
        "warnings": [
            {
                "code": "str",  # One of a server-defined set of
                  warning codes. Required.
                "message": "str",  # A human-readable representation
                  of the warning. Required.
                "target": "str"  # Optional. The target of the error.
            }
        ]
    },
    "tags": {
        "str": "str"  # Optional. List of key-value tag attributes associated
          with the document model.
    }
}

# JSON input template for discriminator value "documentModelCopyTo":
operation_details = {
    "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      operation was created. Required.
    "kind": "documentModelCopyTo",
    "lastUpdatedDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      status was last updated. Required.
    "operationId": "str",  # Operation ID. Required.
    "resourceLocation": "str",  # URL of the resource targeted by this operation.
      Required.
    "status": "str",  # Operation status.  notStarted, running, completed, or
      failed. Required. Known values are: "notStarted", "running", "failed",
      "succeeded", "completed", and "canceled".
    "apiVersion": "str",  # Optional. API version used to create this operation.
    "error": {
        "code": "str",  # One of a server-defined set of error codes.
          Required.
        "message": "str",  # A human-readable representation of the error.
          Required.
        "details": [
            ...
        ],
        "innererror": {
            "code": "str",  # Optional. One of a server-defined set of
              error codes.
            "innererror": ...,
            "message": "str"  # Optional. A human-readable representation
              of the error.
        },
        "target": "str"  # Optional. The target of the error.
    },
    "percentCompleted": 0,  # Optional. Operation progress (0-100).
    "result": {
        "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when
          the document model was created. Required.
        "modelId": "str",  # Unique document model name. Required.
        "apiVersion": "str",  # Optional. API version used to create this
          document model.
        "azureBlobFileListSource": {
            "containerUrl": "str",  # Azure Blob Storage container URL.
              Required.
            "fileList": "str"  # Path to a JSONL file within the
              container specifying a subset of documents. Required.
        },
        "azureBlobSource": {
            "containerUrl": "str",  # Azure Blob Storage container URL.
              Required.
            "prefix": "str"  # Optional. Blob name prefix.
        },
        "buildMode": "str",  # Optional. Custom document model build mode.
          Known values are: "template" and "neural".
        "description": "str",  # Optional. Document model description.
        "docTypes": {
            "str": {
                "fieldSchema": {
                    "str": {
                        "type": "str",  # Semantic data type
                          of the field value. Required. Known values are: "string",
                          "date", "time", "phoneNumber", "number", "integer",
                          "selectionMark", "countryRegion", "signature", "array",
                          "object", "currency", "address", "boolean", and
                          "selectionGroup".
                        "description": "str",  # Optional.
                          Field description.
                        "example": "str",  # Optional.
                          Example field content.
                        "items": ...,
                        "properties": {
                            "str": ...
                        }
                    }
                },
                "buildMode": "str",  # Optional. Custom document
                  model build mode. Known values are: "template" and "neural".
                "description": "str",  # Optional. Document model
                  description.
                "fieldConfidence": {
                    "str": 0.0  # Optional. Estimated confidence
                      for each field.
                }
            }
        },
        "expirationDateTime": "2020-02-20 00:00:00",  # Optional. Date and
          time (UTC) when the document model will expire.
        "tags": {
            "str": "str"  # Optional. List of key-value tag attributes
              associated with the document model.
        },
        "warnings": [
            {
                "code": "str",  # One of a server-defined set of
                  warning codes. Required.
                "message": "str",  # A human-readable representation
                  of the warning. Required.
                "target": "str"  # Optional. The target of the error.
            }
        ]
    },
    "tags": {
        "str": "str"  # Optional. List of key-value tag attributes associated
          with the document model.
    }
}

# response body for status code(s): 200
response == operation_details
get_resource_info(**kwargs: Any) ResourceDetails

Return information about the current resource.

Returns:

ResourceDetails. The ResourceDetails is compatible with MutableMapping

Return type:

ResourceDetails

Raises:

HttpResponseError

Example

# response body for status code(s): 200
response == {
    "customDocumentModels": {
        "count": 0,  # Number of custom document models in the current
          resource. Required.
        "limit": 0  # Maximum number of custom document models supported in
          the current resource. Required.
    },
    "customNeuralDocumentModelBuilds": {
        "quota": 0,  # Resource quota limit. Required.
        "quotaResetDateTime": "2020-02-20 00:00:00",  # Date/time when the
          resource quota usage will be reset. Required.
        "used": 0  # Amount of the resource quota used. Required.
    }
}
list_classifiers(**kwargs: Any) Iterable[DocumentClassifierDetails]

List all document classifiers.

Returns:

An iterator like instance of DocumentClassifierDetails

Return type:

ItemPaged[DocumentClassifierDetails]

Raises:

HttpResponseError

Example

# response body for status code(s): 200
response == {
    "apiVersion": "str",  # API version used to create this document classifier.
      Required.
    "classifierId": "str",  # Unique document classifier name. Required.
    "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      document classifier was created. Required.
    "docTypes": {
        "str": {
            "azureBlobFileListSource": {
                "containerUrl": "str",  # Azure Blob Storage
                  container URL. Required.
                "fileList": "str"  # Path to a JSONL file within the
                  container specifying a subset of documents. Required.
            },
            "azureBlobSource": {
                "containerUrl": "str",  # Azure Blob Storage
                  container URL. Required.
                "prefix": "str"  # Optional. Blob name prefix.
            },
            "sourceKind": "str"  # Optional. Type of training data
              source. Known values are: "url", "base64", "azureBlob", and
              "azureBlobFileList".
        }
    },
    "baseClassifierId": "str",  # Optional. Base classifierId on top of which the
      classifier was trained.
    "description": "str",  # Optional. Document classifier description.
    "expirationDateTime": "2020-02-20 00:00:00",  # Optional. Date and time (UTC)
      when the document classifier will expire.
    "warnings": [
        {
            "code": "str",  # One of a server-defined set of warning
              codes. Required.
            "message": "str",  # A human-readable representation of the
              warning. Required.
            "target": "str"  # Optional. The target of the error.
        }
    ]
}
list_models(**kwargs: Any) Iterable[DocumentModelDetails]

List all document models.

Returns:

An iterator like instance of DocumentModelDetails

Return type:

ItemPaged[DocumentModelDetails]

Raises:

HttpResponseError

Example

# response body for status code(s): 200
response == {
    "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      document model was created. Required.
    "modelId": "str",  # Unique document model name. Required.
    "apiVersion": "str",  # Optional. API version used to create this document
      model.
    "azureBlobFileListSource": {
        "containerUrl": "str",  # Azure Blob Storage container URL. Required.
        "fileList": "str"  # Path to a JSONL file within the container
          specifying a subset of documents. Required.
    },
    "azureBlobSource": {
        "containerUrl": "str",  # Azure Blob Storage container URL. Required.
        "prefix": "str"  # Optional. Blob name prefix.
    },
    "buildMode": "str",  # Optional. Custom document model build mode. Known
      values are: "template" and "neural".
    "description": "str",  # Optional. Document model description.
    "docTypes": {
        "str": {
            "fieldSchema": {
                "str": {
                    "type": "str",  # Semantic data type of the
                      field value. Required. Known values are: "string", "date",
                      "time", "phoneNumber", "number", "integer", "selectionMark",
                      "countryRegion", "signature", "array", "object", "currency",
                      "address", "boolean", and "selectionGroup".
                    "description": "str",  # Optional. Field
                      description.
                    "example": "str",  # Optional. Example field
                      content.
                    "items": ...,
                    "properties": {
                        "str": ...
                    }
                }
            },
            "buildMode": "str",  # Optional. Custom document model build
              mode. Known values are: "template" and "neural".
            "description": "str",  # Optional. Document model
              description.
            "fieldConfidence": {
                "str": 0.0  # Optional. Estimated confidence for each
                  field.
            }
        }
    },
    "expirationDateTime": "2020-02-20 00:00:00",  # Optional. Date and time (UTC)
      when the document model will expire.
    "tags": {
        "str": "str"  # Optional. List of key-value tag attributes associated
          with the document model.
    },
    "warnings": [
        {
            "code": "str",  # One of a server-defined set of warning
              codes. Required.
            "message": "str",  # A human-readable representation of the
              warning. Required.
            "target": "str"  # Optional. The target of the error.
        }
    ]
}
list_operations(**kwargs: Any) Iterable[OperationDetails]

Lists all operations.

Returns:

An iterator like instance of OperationDetails

Return type:

ItemPaged[OperationDetails]

Raises:

HttpResponseError

Example

# The response is polymorphic. The following are possible polymorphic responses based
  off discriminator "kind":

# JSON input template for discriminator value "documentClassifierBuild":
operation_details = {
    "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      operation was created. Required.
    "kind": "documentClassifierBuild",
    "lastUpdatedDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      status was last updated. Required.
    "operationId": "str",  # Operation ID. Required.
    "resourceLocation": "str",  # URL of the resource targeted by this operation.
      Required.
    "status": "str",  # Operation status.  notStarted, running, completed, or
      failed. Required. Known values are: "notStarted", "running", "failed",
      "succeeded", "completed", and "canceled".
    "apiVersion": "str",  # Optional. API version used to create this operation.
    "error": {
        "code": "str",  # One of a server-defined set of error codes.
          Required.
        "message": "str",  # A human-readable representation of the error.
          Required.
        "details": [
            ...
        ],
        "innererror": {
            "code": "str",  # Optional. One of a server-defined set of
              error codes.
            "innererror": ...,
            "message": "str"  # Optional. A human-readable representation
              of the error.
        },
        "target": "str"  # Optional. The target of the error.
    },
    "percentCompleted": 0,  # Optional. Operation progress (0-100).
    "result": {
        "apiVersion": "str",  # API version used to create this document
          classifier. Required.
        "classifierId": "str",  # Unique document classifier name. Required.
        "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when
          the document classifier was created. Required.
        "docTypes": {
            "str": {
                "azureBlobFileListSource": {
                    "containerUrl": "str",  # Azure Blob Storage
                      container URL. Required.
                    "fileList": "str"  # Path to a JSONL file
                      within the container specifying a subset of documents. Required.
                },
                "azureBlobSource": {
                    "containerUrl": "str",  # Azure Blob Storage
                      container URL. Required.
                    "prefix": "str"  # Optional. Blob name
                      prefix.
                },
                "sourceKind": "str"  # Optional. Type of training
                  data source. Known values are: "url", "base64", "azureBlob", and
                  "azureBlobFileList".
            }
        },
        "baseClassifierId": "str",  # Optional. Base classifierId on top of
          which the classifier was trained.
        "description": "str",  # Optional. Document classifier description.
        "expirationDateTime": "2020-02-20 00:00:00",  # Optional. Date and
          time (UTC) when the document classifier will expire.
        "warnings": [
            {
                "code": "str",  # One of a server-defined set of
                  warning codes. Required.
                "message": "str",  # A human-readable representation
                  of the warning. Required.
                "target": "str"  # Optional. The target of the error.
            }
        ]
    },
    "tags": {
        "str": "str"  # Optional. List of key-value tag attributes associated
          with the document model.
    }
}

# JSON input template for discriminator value "documentModelCompose":
operation_details = {
    "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      operation was created. Required.
    "kind": "documentModelCompose",
    "lastUpdatedDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      status was last updated. Required.
    "operationId": "str",  # Operation ID. Required.
    "resourceLocation": "str",  # URL of the resource targeted by this operation.
      Required.
    "status": "str",  # Operation status.  notStarted, running, completed, or
      failed. Required. Known values are: "notStarted", "running", "failed",
      "succeeded", "completed", and "canceled".
    "apiVersion": "str",  # Optional. API version used to create this operation.
    "error": {
        "code": "str",  # One of a server-defined set of error codes.
          Required.
        "message": "str",  # A human-readable representation of the error.
          Required.
        "details": [
            ...
        ],
        "innererror": {
            "code": "str",  # Optional. One of a server-defined set of
              error codes.
            "innererror": ...,
            "message": "str"  # Optional. A human-readable representation
              of the error.
        },
        "target": "str"  # Optional. The target of the error.
    },
    "percentCompleted": 0,  # Optional. Operation progress (0-100).
    "result": {
        "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when
          the document model was created. Required.
        "modelId": "str",  # Unique document model name. Required.
        "apiVersion": "str",  # Optional. API version used to create this
          document model.
        "azureBlobFileListSource": {
            "containerUrl": "str",  # Azure Blob Storage container URL.
              Required.
            "fileList": "str"  # Path to a JSONL file within the
              container specifying a subset of documents. Required.
        },
        "azureBlobSource": {
            "containerUrl": "str",  # Azure Blob Storage container URL.
              Required.
            "prefix": "str"  # Optional. Blob name prefix.
        },
        "buildMode": "str",  # Optional. Custom document model build mode.
          Known values are: "template" and "neural".
        "description": "str",  # Optional. Document model description.
        "docTypes": {
            "str": {
                "fieldSchema": {
                    "str": {
                        "type": "str",  # Semantic data type
                          of the field value. Required. Known values are: "string",
                          "date", "time", "phoneNumber", "number", "integer",
                          "selectionMark", "countryRegion", "signature", "array",
                          "object", "currency", "address", "boolean", and
                          "selectionGroup".
                        "description": "str",  # Optional.
                          Field description.
                        "example": "str",  # Optional.
                          Example field content.
                        "items": ...,
                        "properties": {
                            "str": ...
                        }
                    }
                },
                "buildMode": "str",  # Optional. Custom document
                  model build mode. Known values are: "template" and "neural".
                "description": "str",  # Optional. Document model
                  description.
                "fieldConfidence": {
                    "str": 0.0  # Optional. Estimated confidence
                      for each field.
                }
            }
        },
        "expirationDateTime": "2020-02-20 00:00:00",  # Optional. Date and
          time (UTC) when the document model will expire.
        "tags": {
            "str": "str"  # Optional. List of key-value tag attributes
              associated with the document model.
        },
        "warnings": [
            {
                "code": "str",  # One of a server-defined set of
                  warning codes. Required.
                "message": "str",  # A human-readable representation
                  of the warning. Required.
                "target": "str"  # Optional. The target of the error.
            }
        ]
    },
    "tags": {
        "str": "str"  # Optional. List of key-value tag attributes associated
          with the document model.
    }
}

# JSON input template for discriminator value "documentModelCopyTo":
operation_details = {
    "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      operation was created. Required.
    "kind": "documentModelCopyTo",
    "lastUpdatedDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when the
      status was last updated. Required.
    "operationId": "str",  # Operation ID. Required.
    "resourceLocation": "str",  # URL of the resource targeted by this operation.
      Required.
    "status": "str",  # Operation status.  notStarted, running, completed, or
      failed. Required. Known values are: "notStarted", "running", "failed",
      "succeeded", "completed", and "canceled".
    "apiVersion": "str",  # Optional. API version used to create this operation.
    "error": {
        "code": "str",  # One of a server-defined set of error codes.
          Required.
        "message": "str",  # A human-readable representation of the error.
          Required.
        "details": [
            ...
        ],
        "innererror": {
            "code": "str",  # Optional. One of a server-defined set of
              error codes.
            "innererror": ...,
            "message": "str"  # Optional. A human-readable representation
              of the error.
        },
        "target": "str"  # Optional. The target of the error.
    },
    "percentCompleted": 0,  # Optional. Operation progress (0-100).
    "result": {
        "createdDateTime": "2020-02-20 00:00:00",  # Date and time (UTC) when
          the document model was created. Required.
        "modelId": "str",  # Unique document model name. Required.
        "apiVersion": "str",  # Optional. API version used to create this
          document model.
        "azureBlobFileListSource": {
            "containerUrl": "str",  # Azure Blob Storage container URL.
              Required.
            "fileList": "str"  # Path to a JSONL file within the
              container specifying a subset of documents. Required.
        },
        "azureBlobSource": {
            "containerUrl": "str",  # Azure Blob Storage container URL.
              Required.
            "prefix": "str"  # Optional. Blob name prefix.
        },
        "buildMode": "str",  # Optional. Custom document model build mode.
          Known values are: "template" and "neural".
        "description": "str",  # Optional. Document model description.
        "docTypes": {
            "str": {
                "fieldSchema": {
                    "str": {
                        "type": "str",  # Semantic data type
                          of the field value. Required. Known values are: "string",
                          "date", "time", "phoneNumber", "number", "integer",
                          "selectionMark", "countryRegion", "signature", "array",
                          "object", "currency", "address", "boolean", and
                          "selectionGroup".
                        "description": "str",  # Optional.
                          Field description.
                        "example": "str",  # Optional.
                          Example field content.
                        "items": ...,
                        "properties": {
                            "str": ...
                        }
                    }
                },
                "buildMode": "str",  # Optional. Custom document
                  model build mode. Known values are: "template" and "neural".
                "description": "str",  # Optional. Document model
                  description.
                "fieldConfidence": {
                    "str": 0.0  # Optional. Estimated confidence
                      for each field.
                }
            }
        },
        "expirationDateTime": "2020-02-20 00:00:00",  # Optional. Date and
          time (UTC) when the document model will expire.
        "tags": {
            "str": "str"  # Optional. List of key-value tag attributes
              associated with the document model.
        },
        "warnings": [
            {
                "code": "str",  # One of a server-defined set of
                  warning codes. Required.
                "message": "str",  # A human-readable representation
                  of the warning. Required.
                "target": "str"  # Optional. The target of the error.
            }
        ]
    },
    "tags": {
        "str": "str"  # Optional. List of key-value tag attributes associated
          with the document model.
    }
}

# response body for status code(s): 200
response == operation_details
send_request(request: HttpRequest, *, stream: bool = False, **kwargs: Any) HttpResponse[source]

Runs the network request through the client’s chained policies.

>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = client.send_request(request)
<HttpResponse: 200 OK>

For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request

Parameters:

request (HttpRequest) – The network request you want to make. Required.

Keyword Arguments:

stream (bool) – Whether the response payload will be streamed. Defaults to False.

Returns:

The response of your network call. Does not do error handling on your response.

Return type:

HttpResponse

class azure.ai.documentintelligence.DocumentIntelligenceClient(endpoint: str, credential: AzureKeyCredential | TokenCredential, **kwargs: Any)[source]

DocumentIntelligenceClient.

Parameters:
  • endpoint (str) – The Document Intelligence service endpoint. Required.

  • credential (AzureKeyCredential or TokenCredential) – Credential needed for the client to connect to Azure. Is either a AzureKeyCredential type or a TokenCredential type. Required.

Keyword Arguments:
  • api_version (str) – The API version to use for this operation. Default value is “2024-02-29-preview”. Note that overriding this default value may result in unsupported behavior.

  • polling_interval (int) – Default waiting time between two polls for LRO operations if no Retry-After header is present.

begin_analyze_document(model_id: str, analyze_request: AnalyzeDocumentRequest | MutableMapping[str, Any] | IO[bytes] | None = None, *, pages: str | None = None, locale: str | None = None, string_index_type: str | StringIndexType | None = None, features: List[str | DocumentAnalysisFeature] | None = None, query_fields: List[str] | None = None, output_content_format: str | ContentFormat | None = None, **kwargs: Any) LROPoller[AnalyzeResult]

Analyzes document with document model.

Parameters:
  • model_id (str) – Unique document model name. Required.

  • analyze_request (AnalyzeDocumentRequest or JSON or IO[bytes]) – Analyze request parameters. Is one of the following types: AnalyzeDocumentRequest, JSON, IO[bytes] Default value is None.

Keyword Arguments:
  • pages (str) – List of 1-based page numbers to analyze. Ex. “1-3,5,7-9”. Default value is None.

  • locale (str) – Locale hint for text recognition and document analysis. Value may contain only the language code (ex. “en”, “fr”) or BCP 47 language tag (ex. “en-US”). Default value is None.

  • string_index_type (str or StringIndexType) – Method used to compute string offset and length. Known values are: “textElements”, “unicodeCodePoint”, and “utf16CodeUnit”. Default value is None.

  • features (list[str or DocumentAnalysisFeature]) – List of optional analysis features. Default value is None.

  • query_fields (list[str]) – List of additional fields to extract. Ex. “NumberOfGuests,StoreNumber”. Default value is None.

  • output_content_format (str or ContentFormat) – Format of the analyze result top-level content. Known values are: “text” and “markdown”. Default value is None.

Returns:

An instance of LROPoller that returns AnalyzeResult. The AnalyzeResult is compatible with MutableMapping

Return type:

LROPoller[AnalyzeResult]

Raises:

HttpResponseError

Example

# JSON input template you can fill out and use as your body input.
analyze_request = {
    "base64Source": bytes("bytes", encoding="utf-8"),  # Optional. Base64
      encoding of the document to analyze.  Either urlSource or base64Source must be
      specified.
    "urlSource": "str"  # Optional. Document URL to analyze.  Either urlSource or
      base64Source must be specified.
}

# response body for status code(s): 202
response == {
    "apiVersion": "str",  # API version used to produce this result. Required.
    "content": "str",  # Concatenate string representation of all textual and
      visual elements in reading order. Required.
    "modelId": "str",  # Document model ID used to produce this result. Required.
    "pages": [
        {
            "pageNumber": 0,  # 1-based page number in the input
              document. Required.
            "spans": [
                {
                    "length": 0,  # Number of characters in the
                      content represented by the span. Required.
                    "offset": 0  # Zero-based index of the
                      content represented by the span. Required.
                }
            ],
            "angle": 0.0,  # Optional. The general orientation of the
              content in clockwise direction, measured in degrees between (-180, 180].
            "barcodes": [
                {
                    "confidence": 0.0,  # Confidence of correctly
                      extracting the barcode. Required.
                    "kind": "str",  # Barcode kind. Required.
                      Known values are: "QRCode", "PDF417", "UPCA", "UPCE", "Code39",
                      "Code128", "EAN8", "EAN13", "DataBar", "Code93", "Codabar",
                      "DataBarExpanded", "ITF", "MicroQRCode", "Aztec", "DataMatrix",
                      and "MaxiCode".
                    "span": {
                        "length": 0,  # Number of characters
                          in the content represented by the span. Required.
                        "offset": 0  # Zero-based index of
                          the content represented by the span. Required.
                    },
                    "value": "str",  # Barcode value. Required.
                    "polygon": [
                        0.0  # Optional. Bounding polygon of
                          the barcode, with coordinates specified relative to the
                          top-left of the page. The numbers represent the x, y values
                          of the polygon vertices, clockwise from the left (-180
                          degrees inclusive) relative to the element orientation.
                    ]
                }
            ],
            "formulas": [
                {
                    "confidence": 0.0,  # Confidence of correctly
                      extracting the formula. Required.
                    "kind": "str",  # Formula kind. Required.
                      Known values are: "inline" and "display".
                    "span": {
                        "length": 0,  # Number of characters
                          in the content represented by the span. Required.
                        "offset": 0  # Zero-based index of
                          the content represented by the span. Required.
                    },
                    "value": "str",  # LaTex expression
                      describing the formula. Required.
                    "polygon": [
                        0.0  # Optional. Bounding polygon of
                          the formula, with coordinates specified relative to the
                          top-left of the page. The numbers represent the x, y values
                          of the polygon vertices, clockwise from the left (-180
                          degrees inclusive) relative to the element orientation.
                    ]
                }
            ],
            "height": 0.0,  # Optional. The height of the image/PDF in
              pixels/inches, respectively.
            "lines": [
                {
                    "content": "str",  # Concatenated content of
                      the contained elements in reading order. Required.
                    "spans": [
                        {
                            "length": 0,  # Number of
                              characters in the content represented by the span.
                              Required.
                            "offset": 0  # Zero-based
                              index of the content represented by the span. Required.
                        }
                    ],
                    "polygon": [
                        0.0  # Optional. Bounding polygon of
                          the line, with coordinates specified relative to the top-left
                          of the page. The numbers represent the x, y values of the
                          polygon vertices, clockwise from the left (-180 degrees
                          inclusive) relative to the element orientation.
                    ]
                }
            ],
            "selectionMarks": [
                {
                    "confidence": 0.0,  # Confidence of correctly
                      extracting the selection mark. Required.
                    "span": {
                        "length": 0,  # Number of characters
                          in the content represented by the span. Required.
                        "offset": 0  # Zero-based index of
                          the content represented by the span. Required.
                    },
                    "state": "str",  # State of the selection
                      mark. Required. Known values are: "selected" and "unselected".
                    "polygon": [
                        0.0  # Optional. Bounding polygon of
                          the selection mark, with coordinates specified relative to
                          the top-left of the page. The numbers represent the x, y
                          values of the polygon vertices, clockwise from the left (-180
                          degrees inclusive) relative to the element orientation.
                    ]
                }
            ],
            "unit": "str",  # Optional. The unit used by the width,
              height, and polygon properties. For images, the unit is "pixel". For PDF,
              the unit is "inch". Known values are: "pixel" and "inch".
            "width": 0.0,  # Optional. The width of the image/PDF in
              pixels/inches, respectively.
            "words": [
                {
                    "confidence": 0.0,  # Confidence of correctly
                      extracting the word. Required.
                    "content": "str",  # Text content of the
                      word. Required.
                    "span": {
                        "length": 0,  # Number of characters
                          in the content represented by the span. Required.
                        "offset": 0  # Zero-based index of
                          the content represented by the span. Required.
                    },
                    "polygon": [
                        0.0  # Optional. Bounding polygon of
                          the word, with coordinates specified relative to the top-left
                          of the page. The numbers represent the x, y values of the
                          polygon vertices, clockwise from the left (-180 degrees
                          inclusive) relative to the element orientation.
                    ]
                }
            ]
        }
    ],
    "stringIndexType": "str",  # Method used to compute string offset and length.
      Required. Known values are: "textElements", "unicodeCodePoint", and
      "utf16CodeUnit".
    "contentFormat": "str",  # Optional. Format of the analyze result top-level
      content. Known values are: "text" and "markdown".
    "documents": [
        {
            "confidence": 0.0,  # Confidence of correctly extracting the
              document. Required.
            "docType": "str",  # Document type. Required.
            "spans": [
                {
                    "length": 0,  # Number of characters in the
                      content represented by the span. Required.
                    "offset": 0  # Zero-based index of the
                      content represented by the span. Required.
                }
            ],
            "boundingRegions": [
                {
                    "pageNumber": 0,  # 1-based page number of
                      page containing the bounding region. Required.
                    "polygon": [
                        0.0  # Bounding polygon on the page,
                          or the entire page if not specified. Coordinates specified
                          relative to the top-left of the page. The numbers represent
                          the x, y values of the polygon vertices, clockwise from the
                          left (-180 degrees inclusive) relative to the element
                          orientation. Required.
                    ]
                }
            ],
            "fields": {
                "str": {
                    "type": "str",  # Data type of the field
                      value. Required. Known values are: "string", "date", "time",
                      "phoneNumber", "number", "integer", "selectionMark",
                      "countryRegion", "signature", "array", "object", "currency",
                      "address", "boolean", and "selectionGroup".
                    "boundingRegions": [
                        {
                            "pageNumber": 0,  # 1-based
                              page number of page containing the bounding region.
                              Required.
                            "polygon": [
                                0.0  # Bounding
                                  polygon on the page, or the entire page if not
                                  specified. Coordinates specified relative to the
                                  top-left of the page. The numbers represent the x, y
                                  values of the polygon vertices, clockwise from the
                                  left (-180 degrees inclusive) relative to the element
                                  orientation. Required.
                            ]
                        }
                    ],
                    "confidence": 0.0,  # Optional. Confidence of
                      correctly extracting the field.
                    "content": "str",  # Optional. Field content.
                    "spans": [
                        {
                            "length": 0,  # Number of
                              characters in the content represented by the span.
                              Required.
                            "offset": 0  # Zero-based
                              index of the content represented by the span. Required.
                        }
                    ],
                    "valueAddress": {
                        "city": "str",  # Optional. Name of
                          city, town, village, etc.
                        "cityDistrict": "str",  # Optional.
                          Districts or boroughs within a city, such as Brooklyn in New
                          York City or City of Westminster in London.
                        "countryRegion": "str",  # Optional.
                          Country/region.
                        "house": "str",  # Optional. Build
                          name, such as World Trade Center.
                        "houseNumber": "str",  # Optional.
                          House or building number.
                        "level": "str",  # Optional. Floor
                          number, such as 3F.
                        "poBox": "str",  # Optional. Post
                          office box number.
                        "postalCode": "str",  # Optional.
                          Postal code used for mail sorting.
                        "road": "str",  # Optional. Street
                          name.
                        "state": "str",  # Optional.
                          First-level administrative division.
                        "stateDistrict": "str",  # Optional.
                          Second-level administrative division used in certain locales.
                        "streetAddress": "str",  # Optional.
                          Street-level address, excluding city, state, countryRegion,
                          and postalCode.
                        "suburb": "str",  # Optional.
                          Unofficial neighborhood name, like Chinatown.
                        "unit": "str"  # Optional. Apartment
                          or office number.
                    },
                    "valueArray": [
                        ...
                    ],
                    "valueBoolean": bool,  # Optional. Boolean
                      value.
                    "valueCountryRegion": "str",  # Optional.
                      3-letter country code value (ISO 3166-1 alpha-3).
                    "valueCurrency": {
                        "amount": 0.0,  # Currency amount.
                          Required.
                        "currencyCode": "str",  # Optional.
                          Resolved currency code (ISO 4217), if any.
                        "currencySymbol": "str"  # Optional.
                          Currency symbol label, if any.
                    },
                    "valueDate": "2020-02-20",  # Optional. Date
                      value in YYYY-MM-DD format (ISO 8601).
                    "valueInteger": 0,  # Optional. Integer
                      value.
                    "valueNumber": 0.0,  # Optional. Floating
                      point value.
                    "valueObject": {
                        "str": ...
                    },
                    "valuePhoneNumber": "str",  # Optional. Phone
                      number value in E.164 format (ex. +19876543210).
                    "valueSelectionGroup": [
                        "str"  # Optional. Selection group
                          value.
                    ],
                    "valueSelectionMark": "str",  # Optional.
                      Selection mark value. Known values are: "selected" and
                      "unselected".
                    "valueSignature": "str",  # Optional.
                      Presence of signature. Known values are: "signed" and "unsigned".
                    "valueString": "str",  # Optional. String
                      value.
                    "valueTime": "12:30:00"  # Optional. Time
                      value in hh:mm:ss format (ISO 8601).
                }
            }
        }
    ],
    "figures": [
        {
            "spans": [
                {
                    "length": 0,  # Number of characters in the
                      content represented by the span. Required.
                    "offset": 0  # Zero-based index of the
                      content represented by the span. Required.
                }
            ],
            "boundingRegions": [
                {
                    "pageNumber": 0,  # 1-based page number of
                      page containing the bounding region. Required.
                    "polygon": [
                        0.0  # Bounding polygon on the page,
                          or the entire page if not specified. Coordinates specified
                          relative to the top-left of the page. The numbers represent
                          the x, y values of the polygon vertices, clockwise from the
                          left (-180 degrees inclusive) relative to the element
                          orientation. Required.
                    ]
                }
            ],
            "caption": {
                "content": "str",  # Content of the caption.
                  Required.
                "spans": [
                    {
                        "length": 0,  # Number of characters
                          in the content represented by the span. Required.
                        "offset": 0  # Zero-based index of
                          the content represented by the span. Required.
                    }
                ],
                "boundingRegions": [
                    {
                        "pageNumber": 0,  # 1-based page
                          number of page containing the bounding region. Required.
                        "polygon": [
                            0.0  # Bounding polygon on
                              the page, or the entire page if not specified.
                              Coordinates specified relative to the top-left of the
                              page. The numbers represent the x, y values of the
                              polygon vertices, clockwise from the left (-180 degrees
                              inclusive) relative to the element orientation. Required.
                        ]
                    }
                ],
                "elements": [
                    "str"  # Optional. Child elements of the
                      caption.
                ]
            },
            "elements": [
                "str"  # Optional. Child elements of the figure,
                  excluding any caption or footnotes.
            ],
            "footnotes": [
                {
                    "content": "str",  # Content of the footnote.
                      Required.
                    "spans": [
                        {
                            "length": 0,  # Number of
                              characters in the content represented by the span.
                              Required.
                            "offset": 0  # Zero-based
                              index of the content represented by the span. Required.
                        }
                    ],
                    "boundingRegions": [
                        {
                            "pageNumber": 0,  # 1-based
                              page number of page containing the bounding region.
                              Required.
                            "polygon": [
                                0.0  # Bounding
                                  polygon on the page, or the entire page if not
                                  specified. Coordinates specified relative to the
                                  top-left of the page. The numbers represent the x, y
                                  values of the polygon vertices, clockwise from the
                                  left (-180 degrees inclusive) relative to the element
                                  orientation. Required.
                            ]
                        }
                    ],
                    "elements": [
                        "str"  # Optional. Child elements of
                          the footnote.
                    ]
                }
            ]
        }
    ],
    "keyValuePairs": [
        {
            "confidence": 0.0,  # Confidence of correctly extracting the
              key-value pair. Required.
            "key": {
                "content": "str",  # Concatenated content of the
                  key-value element in reading order. Required.
                "spans": [
                    {
                        "length": 0,  # Number of characters
                          in the content represented by the span. Required.
                        "offset": 0  # Zero-based index of
                          the content represented by the span. Required.
                    }
                ],
                "boundingRegions": [
                    {
                        "pageNumber": 0,  # 1-based page
                          number of page containing the bounding region. Required.
                        "polygon": [
                            0.0  # Bounding polygon on
                              the page, or the entire page if not specified.
                              Coordinates specified relative to the top-left of the
                              page. The numbers represent the x, y values of the
                              polygon vertices, clockwise from the left (-180 degrees
                              inclusive) relative to the element orientation. Required.
                        ]
                    }
                ]
            },
            "value": {
                "content": "str",  # Concatenated content of the
                  key-value element in reading order. Required.
                "spans": [
                    {
                        "length": 0,  # Number of characters
                          in the content represented by the span. Required.
                        "offset": 0  # Zero-based index of
                          the content represented by the span. Required.
                    }
                ],
                "boundingRegions": [
                    {
                        "pageNumber": 0,  # 1-based page
                          number of page containing the bounding region. Required.
                        "polygon": [
                            0.0  # Bounding polygon on
                              the page, or the entire page if not specified.
                              Coordinates specified relative to the top-left of the
                              page. The numbers represent the x, y values of the
                              polygon vertices, clockwise from the left (-180 degrees
                              inclusive) relative to the element orientation. Required.
                        ]
                    }
                ]
            }
        }
    ],
    "languages": [
        {
            "confidence": 0.0,  # Confidence of correctly identifying the
              language. Required.
            "locale": "str",  # Detected language.  Value may an ISO
              639-1 language code (ex. "en", "fr") or BCP 47 language tag (ex.
              "zh-Hans"). Required.
            "spans": [
                {
                    "length": 0,  # Number of characters in the
                      content represented by the span. Required.
                    "offset": 0  # Zero-based index of the
                      content represented by the span. Required.
                }
            ]
        }
    ],
    "lists": [
        {
            "items": [
                {
                    "content": "str",  # Content of the list
                      item. Required.
                    "level": 0,  # Level of the list item
                      (1-indexed). Required.
                    "spans": [
                        {
                            "length": 0,  # Number of
                              characters in the content represented by the span.
                              Required.
                            "offset": 0  # Zero-based
                              index of the content represented by the span. Required.
                        }
                    ],
                    "boundingRegions": [
                        {
                            "pageNumber": 0,  # 1-based
                              page number of page containing the bounding region.
                              Required.
                            "polygon": [
                                0.0  # Bounding
                                  polygon on the page, or the entire page if not
                                  specified. Coordinates specified relative to the
                                  top-left of the page. The numbers represent the x, y
                                  values of the polygon vertices, clockwise from the
                                  left (-180 degrees inclusive) relative to the element
                                  orientation. Required.
                            ]
                        }
                    ],
                    "elements": [
                        "str"  # Optional. Child elements of
                          the list item.
                    ]
                }
            ],
            "spans": [
                {
                    "length": 0,  # Number of characters in the
                      content represented by the span. Required.
                    "offset": 0  # Zero-based index of the
                      content represented by the span. Required.
                }
            ]
        }
    ],
    "paragraphs": [
        {
            "content": "str",  # Concatenated content of the paragraph in
              reading order. Required.
            "spans": [
                {
                    "length": 0,  # Number of characters in the
                      content represented by the span. Required.
                    "offset": 0  # Zero-based index of the
                      content represented by the span. Required.
                }
            ],
            "boundingRegions": [
                {
                    "pageNumber": 0,  # 1-based page number of
                      page containing the bounding region. Required.
                    "polygon": [
                        0.0  # Bounding polygon on the page,
                          or the entire page if not specified. Coordinates specified
                          relative to the top-left of the page. The numbers represent
                          the x, y values of the polygon vertices, clockwise from the
                          left (-180 degrees inclusive) relative to the element
                          orientation. Required.
                    ]
                }
            ],
            "role": "str"  # Optional. Semantic role of the paragraph.
              Known values are: "pageHeader", "pageFooter", "pageNumber", "title",
              "sectionHeading", "footnote", and "formulaBlock".
        }
    ],
    "sections": [
        {
            "spans": [
                {
                    "length": 0,  # Number of characters in the
                      content represented by the span. Required.
                    "offset": 0  # Zero-based index of the
                      content represented by the span. Required.
                }
            ],
            "elements": [
                "str"  # Optional. Child elements of the section.
            ]
        }
    ],
    "styles": [
        {
            "confidence": 0.0,  # Confidence of correctly identifying the
              style. Required.
            "spans": [
                {
                    "length": 0,  # Number of characters in the
                      content represented by the span. Required.
                    "offset": 0  # Zero-based index of the
                      content represented by the span. Required.
                }
            ],
            "backgroundColor": "str",  # Optional. Background color in
              #rrggbb hexadecimal format..
            "color": "str",  # Optional. Foreground color in #rrggbb
              hexadecimal format.
            "fontStyle": "str",  # Optional. Font style. Known values
              are: "normal" and "italic".
            "fontWeight": "str",  # Optional. Font weight. Known values
              are: "normal" and "bold".
            "isHandwritten": bool,  # Optional. Is content handwritten?.
            "similarFontFamily": "str"  # Optional. Visually most similar
              font from among the set of supported font families, with fallback fonts
              following CSS convention (ex. 'Arial, sans-serif').
        }
    ],
    "tables": [
        {
            "cells": [
                {
                    "columnIndex": 0,  # Column index of the
                      cell. Required.
                    "content": "str",  # Concatenated content of
                      the table cell in reading order. Required.
                    "rowIndex": 0,  # Row index of the cell.
                      Required.
                    "spans": [
                        {
                            "length": 0,  # Number of
                              characters in the content represented by the span.
                              Required.
                            "offset": 0  # Zero-based
                              index of the content represented by the span. Required.
                        }
                    ],
                    "boundingRegions": [
                        {
                            "pageNumber": 0,  # 1-based
                              page number of page containing the bounding region.
                              Required.
                            "polygon": [
                                0.0  # Bounding
                                  polygon on the page, or the entire page if not
                                  specified. Coordinates specified relative to the
                                  top-left of the page. The numbers represent the x, y
                                  values of the polygon vertices, clockwise from the
                                  left (-180 degrees inclusive) relative to the element
                                  orientation. Required.
                            ]
                        }
                    ],
                    "columnSpan": 0,  # Optional. Number of
                      columns spanned by this cell.
                    "elements": [
                        "str"  # Optional. Child elements of
                          the table cell.
                    ],
                    "kind": "str",  # Optional. Table cell kind.
                      Known values are: "content", "rowHeader", "columnHeader",
                      "stubHead", and "description".
                    "rowSpan": 0  # Optional. Number of rows
                      spanned by this cell.
                }
            ],
            "columnCount": 0,  # Number of columns in the table.
              Required.
            "rowCount": 0,  # Number of rows in the table. Required.
            "spans": [
                {
                    "length": 0,  # Number of characters in the
                      content represented by the span. Required.
                    "offset": 0  # Zero-based index of the
                      content represented by the span. Required.
                }
            ],
            "boundingRegions": [
                {
                    "pageNumber": 0,  # 1-based page number of
                      page containing the bounding region. Required.
                    "polygon": [
                        0.0  # Bounding polygon on the page,
                          or the entire page if not specified. Coordinates specified
                          relative to the top-left of the page. The numbers represent
                          the x, y values of the polygon vertices, clockwise from the
                          left (-180 degrees inclusive) relative to the element
                          orientation. Required.
                    ]
                }
            ],
            "caption": {
                "content": "str",  # Content of the caption.
                  Required.
                "spans": [
                    {
                        "length": 0,  # Number of characters
                          in the content represented by the span. Required.
                        "offset": 0  # Zero-based index of
                          the content represented by the span. Required.
                    }
                ],
                "boundingRegions": [
                    {
                        "pageNumber": 0,  # 1-based page
                          number of page containing the bounding region. Required.
                        "polygon": [
                            0.0  # Bounding polygon on
                              the page, or the entire page if not specified.
                              Coordinates specified relative to the top-left of the
                              page. The numbers represent the x, y values of the
                              polygon vertices, clockwise from the left (-180 degrees
                              inclusive) relative to the element orientation. Required.
                        ]
                    }
                ],
                "elements": [
                    "str"  # Optional. Child elements of the
                      caption.
                ]
            },
            "footnotes": [
                {
                    "content": "str",  # Content of the footnote.
                      Required.
                    "spans": [
                        {
                            "length": 0,  # Number of
                              characters in the content represented by the span.
                              Required.
                            "offset": 0  # Zero-based
                              index of the content represented by the span. Required.
                        }
                    ],
                    "boundingRegions": [
                        {
                            "pageNumber": 0,  # 1-based
                              page number of page containing the bounding region.
                              Required.
                            "polygon": [
                                0.0  # Bounding
                                  polygon on the page, or the entire page if not
                                  specified. Coordinates specified relative to the
                                  top-left of the page. The numbers represent the x, y
                                  values of the polygon vertices, clockwise from the
                                  left (-180 degrees inclusive) relative to the element
                                  orientation. Required.
                            ]
                        }
                    ],
                    "elements": [
                        "str"  # Optional. Child elements of
                          the footnote.
                    ]
                }
            ]
        }
    ]
}
begin_classify_document(classifier_id: str, classify_request: ClassifyDocumentRequest | MutableMapping[str, Any] | IO[bytes], *, string_index_type: str | StringIndexType | None = None, split: str | SplitMode | None = None, **kwargs: Any) LROPoller[AnalyzeResult]

Classifies document with document classifier.

Parameters:
  • classifier_id (str) – Unique document classifier name. Required.

  • classify_request (ClassifyDocumentRequest or JSON or IO[bytes]) – Classify request parameters. Is one of the following types: ClassifyDocumentRequest, JSON, IO[bytes] Required.

Keyword Arguments:
  • string_index_type (str or StringIndexType) – Method used to compute string offset and length. Known values are: “textElements”, “unicodeCodePoint”, and “utf16CodeUnit”. Default value is None.

  • split (str or SplitMode) – Document splitting mode. Known values are: “auto”, “none”, and “perPage”. Default value is None.

Returns:

An instance of LROPoller that returns AnalyzeResult. The AnalyzeResult is compatible with MutableMapping

Return type:

LROPoller[AnalyzeResult]

Raises:

HttpResponseError

Example

# JSON input template you can fill out and use as your body input.
classify_request = {
    "base64Source": bytes("bytes", encoding="utf-8"),  # Optional. Base64
      encoding of the document to classify.  Either urlSource or base64Source must be
      specified.
    "urlSource": "str"  # Optional. Document URL to classify.  Either urlSource
      or base64Source must be specified.
}

# response body for status code(s): 202
response == {
    "apiVersion": "str",  # API version used to produce this result. Required.
    "content": "str",  # Concatenate string representation of all textual and
      visual elements in reading order. Required.
    "modelId": "str",  # Document model ID used to produce this result. Required.
    "pages": [
        {
            "pageNumber": 0,  # 1-based page number in the input
              document. Required.
            "spans": [
                {
                    "length": 0,  # Number of characters in the
                      content represented by the span. Required.
                    "offset": 0  # Zero-based index of the
                      content represented by the span. Required.
                }
            ],
            "angle": 0.0,  # Optional. The general orientation of the
              content in clockwise direction, measured in degrees between (-180, 180].
            "barcodes": [
                {
                    "confidence": 0.0,  # Confidence of correctly
                      extracting the barcode. Required.
                    "kind": "str",  # Barcode kind. Required.
                      Known values are: "QRCode", "PDF417", "UPCA", "UPCE", "Code39",
                      "Code128", "EAN8", "EAN13", "DataBar", "Code93", "Codabar",
                      "DataBarExpanded", "ITF", "MicroQRCode", "Aztec", "DataMatrix",
                      and "MaxiCode".
                    "span": {
                        "length": 0,  # Number of characters
                          in the content represented by the span. Required.
                        "offset": 0  # Zero-based index of
                          the content represented by the span. Required.
                    },
                    "value": "str",  # Barcode value. Required.
                    "polygon": [
                        0.0  # Optional. Bounding polygon of
                          the barcode, with coordinates specified relative to the
                          top-left of the page. The numbers represent the x, y values
                          of the polygon vertices, clockwise from the left (-180
                          degrees inclusive) relative to the element orientation.
                    ]
                }
            ],
            "formulas": [
                {
                    "confidence": 0.0,  # Confidence of correctly
                      extracting the formula. Required.
                    "kind": "str",  # Formula kind. Required.
                      Known values are: "inline" and "display".
                    "span": {
                        "length": 0,  # Number of characters
                          in the content represented by the span. Required.
                        "offset": 0  # Zero-based index of
                          the content represented by the span. Required.
                    },
                    "value": "str",  # LaTex expression
                      describing the formula. Required.
                    "polygon": [
                        0.0  # Optional. Bounding polygon of
                          the formula, with coordinates specified relative to the
                          top-left of the page. The numbers represent the x, y values
                          of the polygon vertices, clockwise from the left (-180
                          degrees inclusive) relative to the element orientation.
                    ]
                }
            ],
            "height": 0.0,  # Optional. The height of the image/PDF in
              pixels/inches, respectively.
            "lines": [
                {
                    "content": "str",  # Concatenated content of
                      the contained elements in reading order. Required.
                    "spans": [
                        {
                            "length": 0,  # Number of
                              characters in the content represented by the span.
                              Required.
                            "offset": 0  # Zero-based
                              index of the content represented by the span. Required.
                        }
                    ],
                    "polygon": [
                        0.0  # Optional. Bounding polygon of
                          the line, with coordinates specified relative to the top-left
                          of the page. The numbers represent the x, y values of the
                          polygon vertices, clockwise from the left (-180 degrees
                          inclusive) relative to the element orientation.
                    ]
                }
            ],
            "selectionMarks": [
                {
                    "confidence": 0.0,  # Confidence of correctly
                      extracting the selection mark. Required.
                    "span": {
                        "length": 0,  # Number of characters
                          in the content represented by the span. Required.
                        "offset": 0  # Zero-based index of
                          the content represented by the span. Required.
                    },
                    "state": "str",  # State of the selection
                      mark. Required. Known values are: "selected" and "unselected".
                    "polygon": [
                        0.0  # Optional. Bounding polygon of
                          the selection mark, with coordinates specified relative to
                          the top-left of the page. The numbers represent the x, y
                          values of the polygon vertices, clockwise from the left (-180
                          degrees inclusive) relative to the element orientation.
                    ]
                }
            ],
            "unit": "str",  # Optional. The unit used by the width,
              height, and polygon properties. For images, the unit is "pixel". For PDF,
              the unit is "inch". Known values are: "pixel" and "inch".
            "width": 0.0,  # Optional. The width of the image/PDF in
              pixels/inches, respectively.
            "words": [
                {
                    "confidence": 0.0,  # Confidence of correctly
                      extracting the word. Required.
                    "content": "str",  # Text content of the
                      word. Required.
                    "span": {
                        "length": 0,  # Number of characters
                          in the content represented by the span. Required.
                        "offset": 0  # Zero-based index of
                          the content represented by the span. Required.
                    },
                    "polygon": [
                        0.0  # Optional. Bounding polygon of
                          the word, with coordinates specified relative to the top-left
                          of the page. The numbers represent the x, y values of the
                          polygon vertices, clockwise from the left (-180 degrees
                          inclusive) relative to the element orientation.
                    ]
                }
            ]
        }
    ],
    "stringIndexType": "str",  # Method used to compute string offset and length.
      Required. Known values are: "textElements", "unicodeCodePoint", and
      "utf16CodeUnit".
    "contentFormat": "str",  # Optional. Format of the analyze result top-level
      content. Known values are: "text" and "markdown".
    "documents": [
        {
            "confidence": 0.0,  # Confidence of correctly extracting the
              document. Required.
            "docType": "str",  # Document type. Required.
            "spans": [
                {
                    "length": 0,  # Number of characters in the
                      content represented by the span. Required.
                    "offset": 0  # Zero-based index of the
                      content represented by the span. Required.
                }
            ],
            "boundingRegions": [
                {
                    "pageNumber": 0,  # 1-based page number of
                      page containing the bounding region. Required.
                    "polygon": [
                        0.0  # Bounding polygon on the page,
                          or the entire page if not specified. Coordinates specified
                          relative to the top-left of the page. The numbers represent
                          the x, y values of the polygon vertices, clockwise from the
                          left (-180 degrees inclusive) relative to the element
                          orientation. Required.
                    ]
                }
            ],
            "fields": {
                "str": {
                    "type": "str",  # Data type of the field
                      value. Required. Known values are: "string", "date", "time",
                      "phoneNumber", "number", "integer", "selectionMark",
                      "countryRegion", "signature", "array", "object", "currency",
                      "address", "boolean", and "selectionGroup".
                    "boundingRegions": [
                        {
                            "pageNumber": 0,  # 1-based
                              page number of page containing the bounding region.
                              Required.
                            "polygon": [
                                0.0  # Bounding
                                  polygon on the page, or the entire page if not
                                  specified. Coordinates specified relative to the
                                  top-left of the page. The numbers represent the x, y
                                  values of the polygon vertices, clockwise from the
                                  left (-180 degrees inclusive) relative to the element
                                  orientation. Required.
                            ]
                        }
                    ],
                    "confidence": 0.0,  # Optional. Confidence of
                      correctly extracting the field.
                    "content": "str",  # Optional. Field content.
                    "spans": [
                        {
                            "length": 0,  # Number of
                              characters in the content represented by the span.
                              Required.
                            "offset": 0  # Zero-based
                              index of the content represented by the span. Required.
                        }
                    ],
                    "valueAddress": {
                        "city": "str",  # Optional. Name of
                          city, town, village, etc.
                        "cityDistrict": "str",  # Optional.
                          Districts or boroughs within a city, such as Brooklyn in New
                          York City or City of Westminster in London.
                        "countryRegion": "str",  # Optional.
                          Country/region.
                        "house": "str",  # Optional. Build
                          name, such as World Trade Center.
                        "houseNumber": "str",  # Optional.
                          House or building number.
                        "level": "str",  # Optional. Floor
                          number, such as 3F.
                        "poBox": "str",  # Optional. Post
                          office box number.
                        "postalCode": "str",  # Optional.
                          Postal code used for mail sorting.
                        "road": "str",  # Optional. Street
                          name.
                        "state": "str",  # Optional.
                          First-level administrative division.
                        "stateDistrict": "str",  # Optional.
                          Second-level administrative division used in certain locales.
                        "streetAddress": "str",  # Optional.
                          Street-level address, excluding city, state, countryRegion,
                          and postalCode.
                        "suburb": "str",  # Optional.
                          Unofficial neighborhood name, like Chinatown.
                        "unit": "str"  # Optional. Apartment
                          or office number.
                    },
                    "valueArray": [
                        ...
                    ],
                    "valueBoolean": bool,  # Optional. Boolean
                      value.
                    "valueCountryRegion": "str",  # Optional.
                      3-letter country code value (ISO 3166-1 alpha-3).
                    "valueCurrency": {
                        "amount": 0.0,  # Currency amount.
                          Required.
                        "currencyCode": "str",  # Optional.
                          Resolved currency code (ISO 4217), if any.
                        "currencySymbol": "str"  # Optional.
                          Currency symbol label, if any.
                    },
                    "valueDate": "2020-02-20",  # Optional. Date
                      value in YYYY-MM-DD format (ISO 8601).
                    "valueInteger": 0,  # Optional. Integer
                      value.
                    "valueNumber": 0.0,  # Optional. Floating
                      point value.
                    "valueObject": {
                        "str": ...
                    },
                    "valuePhoneNumber": "str",  # Optional. Phone
                      number value in E.164 format (ex. +19876543210).
                    "valueSelectionGroup": [
                        "str"  # Optional. Selection group
                          value.
                    ],
                    "valueSelectionMark": "str",  # Optional.
                      Selection mark value. Known values are: "selected" and
                      "unselected".
                    "valueSignature": "str",  # Optional.
                      Presence of signature. Known values are: "signed" and "unsigned".
                    "valueString": "str",  # Optional. String
                      value.
                    "valueTime": "12:30:00"  # Optional. Time
                      value in hh:mm:ss format (ISO 8601).
                }
            }
        }
    ],
    "figures": [
        {
            "spans": [
                {
                    "length": 0,  # Number of characters in the
                      content represented by the span. Required.
                    "offset": 0  # Zero-based index of the
                      content represented by the span. Required.
                }
            ],
            "boundingRegions": [
                {
                    "pageNumber": 0,  # 1-based page number of
                      page containing the bounding region. Required.
                    "polygon": [
                        0.0  # Bounding polygon on the page,
                          or the entire page if not specified. Coordinates specified
                          relative to the top-left of the page. The numbers represent
                          the x, y values of the polygon vertices, clockwise from the
                          left (-180 degrees inclusive) relative to the element
                          orientation. Required.
                    ]
                }
            ],
            "caption": {
                "content": "str",  # Content of the caption.
                  Required.
                "spans": [
                    {
                        "length": 0,  # Number of characters
                          in the content represented by the span. Required.
                        "offset": 0  # Zero-based index of
                          the content represented by the span. Required.
                    }
                ],
                "boundingRegions": [
                    {
                        "pageNumber": 0,  # 1-based page
                          number of page containing the bounding region. Required.
                        "polygon": [
                            0.0  # Bounding polygon on
                              the page, or the entire page if not specified.
                              Coordinates specified relative to the top-left of the
                              page. The numbers represent the x, y values of the
                              polygon vertices, clockwise from the left (-180 degrees
                              inclusive) relative to the element orientation. Required.
                        ]
                    }
                ],
                "elements": [
                    "str"  # Optional. Child elements of the
                      caption.
                ]
            },
            "elements": [
                "str"  # Optional. Child elements of the figure,
                  excluding any caption or footnotes.
            ],
            "footnotes": [
                {
                    "content": "str",  # Content of the footnote.
                      Required.
                    "spans": [
                        {
                            "length": 0,  # Number of
                              characters in the content represented by the span.
                              Required.
                            "offset": 0  # Zero-based
                              index of the content represented by the span. Required.
                        }
                    ],
                    "boundingRegions": [
                        {
                            "pageNumber": 0,  # 1-based
                              page number of page containing the bounding region.
                              Required.
                            "polygon": [
                                0.0  # Bounding
                                  polygon on the page, or the entire page if not
                                  specified. Coordinates specified relative to the
                                  top-left of the page. The numbers represent the x, y
                                  values of the polygon vertices, clockwise from the
                                  left (-180 degrees inclusive) relative to the element
                                  orientation. Required.
                            ]
                        }
                    ],
                    "elements": [
                        "str"  # Optional. Child elements of
                          the footnote.
                    ]
                }
            ]
        }
    ],
    "keyValuePairs": [
        {
            "confidence": 0.0,  # Confidence of correctly extracting the
              key-value pair. Required.
            "key": {
                "content": "str",  # Concatenated content of the
                  key-value element in reading order. Required.
                "spans": [
                    {
                        "length": 0,  # Number of characters
                          in the content represented by the span. Required.
                        "offset": 0  # Zero-based index of
                          the content represented by the span. Required.
                    }
                ],
                "boundingRegions": [
                    {
                        "pageNumber": 0,  # 1-based page
                          number of page containing the bounding region. Required.
                        "polygon": [
                            0.0  # Bounding polygon on
                              the page, or the entire page if not specified.
                              Coordinates specified relative to the top-left of the
                              page. The numbers represent the x, y values of the
                              polygon vertices, clockwise from the left (-180 degrees
                              inclusive) relative to the element orientation. Required.
                        ]
                    }
                ]
            },
            "value": {
                "content": "str",  # Concatenated content of the
                  key-value element in reading order. Required.
                "spans": [
                    {
                        "length": 0,  # Number of characters
                          in the content represented by the span. Required.
                        "offset": 0  # Zero-based index of
                          the content represented by the span. Required.
                    }
                ],
                "boundingRegions": [
                    {
                        "pageNumber": 0,  # 1-based page
                          number of page containing the bounding region. Required.
                        "polygon": [
                            0.0  # Bounding polygon on
                              the page, or the entire page if not specified.
                              Coordinates specified relative to the top-left of the
                              page. The numbers represent the x, y values of the
                              polygon vertices, clockwise from the left (-180 degrees
                              inclusive) relative to the element orientation. Required.
                        ]
                    }
                ]
            }
        }
    ],
    "languages": [
        {
            "confidence": 0.0,  # Confidence of correctly identifying the
              language. Required.
            "locale": "str",  # Detected language.  Value may an ISO
              639-1 language code (ex. "en", "fr") or BCP 47 language tag (ex.
              "zh-Hans"). Required.
            "spans": [
                {
                    "length": 0,  # Number of characters in the
                      content represented by the span. Required.
                    "offset": 0  # Zero-based index of the
                      content represented by the span. Required.
                }
            ]
        }
    ],
    "lists": [
        {
            "items": [
                {
                    "content": "str",  # Content of the list
                      item. Required.
                    "level": 0,  # Level of the list item
                      (1-indexed). Required.
                    "spans": [
                        {
                            "length": 0,  # Number of
                              characters in the content represented by the span.
                              Required.
                            "offset": 0  # Zero-based
                              index of the content represented by the span. Required.
                        }
                    ],
                    "boundingRegions": [
                        {
                            "pageNumber": 0,  # 1-based
                              page number of page containing the bounding region.
                              Required.
                            "polygon": [
                                0.0  # Bounding
                                  polygon on the page, or the entire page if not
                                  specified. Coordinates specified relative to the
                                  top-left of the page. The numbers represent the x, y
                                  values of the polygon vertices, clockwise from the
                                  left (-180 degrees inclusive) relative to the element
                                  orientation. Required.
                            ]
                        }
                    ],
                    "elements": [
                        "str"  # Optional. Child elements of
                          the list item.
                    ]
                }
            ],
            "spans": [
                {
                    "length": 0,  # Number of characters in the
                      content represented by the span. Required.
                    "offset": 0  # Zero-based index of the
                      content represented by the span. Required.
                }
            ]
        }
    ],
    "paragraphs": [
        {
            "content": "str",  # Concatenated content of the paragraph in
              reading order. Required.
            "spans": [
                {
                    "length": 0,  # Number of characters in the
                      content represented by the span. Required.
                    "offset": 0  # Zero-based index of the
                      content represented by the span. Required.
                }
            ],
            "boundingRegions": [
                {
                    "pageNumber": 0,  # 1-based page number of
                      page containing the bounding region. Required.
                    "polygon": [
                        0.0  # Bounding polygon on the page,
                          or the entire page if not specified. Coordinates specified
                          relative to the top-left of the page. The numbers represent
                          the x, y values of the polygon vertices, clockwise from the
                          left (-180 degrees inclusive) relative to the element
                          orientation. Required.
                    ]
                }
            ],
            "role": "str"  # Optional. Semantic role of the paragraph.
              Known values are: "pageHeader", "pageFooter", "pageNumber", "title",
              "sectionHeading", "footnote", and "formulaBlock".
        }
    ],
    "sections": [
        {
            "spans": [
                {
                    "length": 0,  # Number of characters in the
                      content represented by the span. Required.
                    "offset": 0  # Zero-based index of the
                      content represented by the span. Required.
                }
            ],
            "elements": [
                "str"  # Optional. Child elements of the section.
            ]
        }
    ],
    "styles": [
        {
            "confidence": 0.0,  # Confidence of correctly identifying the
              style. Required.
            "spans": [
                {
                    "length": 0,  # Number of characters in the
                      content represented by the span. Required.
                    "offset": 0  # Zero-based index of the
                      content represented by the span. Required.
                }
            ],
            "backgroundColor": "str",  # Optional. Background color in
              #rrggbb hexadecimal format..
            "color": "str",  # Optional. Foreground color in #rrggbb
              hexadecimal format.
            "fontStyle": "str",  # Optional. Font style. Known values
              are: "normal" and "italic".
            "fontWeight": "str",  # Optional. Font weight. Known values
              are: "normal" and "bold".
            "isHandwritten": bool,  # Optional. Is content handwritten?.
            "similarFontFamily": "str"  # Optional. Visually most similar
              font from among the set of supported font families, with fallback fonts
              following CSS convention (ex. 'Arial, sans-serif').
        }
    ],
    "tables": [
        {
            "cells": [
                {
                    "columnIndex": 0,  # Column index of the
                      cell. Required.
                    "content": "str",  # Concatenated content of
                      the table cell in reading order. Required.
                    "rowIndex": 0,  # Row index of the cell.
                      Required.
                    "spans": [
                        {
                            "length": 0,  # Number of
                              characters in the content represented by the span.
                              Required.
                            "offset": 0  # Zero-based
                              index of the content represented by the span. Required.
                        }
                    ],
                    "boundingRegions": [
                        {
                            "pageNumber": 0,  # 1-based
                              page number of page containing the bounding region.
                              Required.
                            "polygon": [
                                0.0  # Bounding
                                  polygon on the page, or the entire page if not
                                  specified. Coordinates specified relative to the
                                  top-left of the page. The numbers represent the x, y
                                  values of the polygon vertices, clockwise from the
                                  left (-180 degrees inclusive) relative to the element
                                  orientation. Required.
                            ]
                        }
                    ],
                    "columnSpan": 0,  # Optional. Number of
                      columns spanned by this cell.
                    "elements": [
                        "str"  # Optional. Child elements of
                          the table cell.
                    ],
                    "kind": "str",  # Optional. Table cell kind.
                      Known values are: "content", "rowHeader", "columnHeader",
                      "stubHead", and "description".
                    "rowSpan": 0  # Optional. Number of rows
                      spanned by this cell.
                }
            ],
            "columnCount": 0,  # Number of columns in the table.
              Required.
            "rowCount": 0,  # Number of rows in the table. Required.
            "spans": [
                {
                    "length": 0,  # Number of characters in the
                      content represented by the span. Required.
                    "offset": 0  # Zero-based index of the
                      content represented by the span. Required.
                }
            ],
            "boundingRegions": [
                {
                    "pageNumber": 0,  # 1-based page number of
                      page containing the bounding region. Required.
                    "polygon": [
                        0.0  # Bounding polygon on the page,
                          or the entire page if not specified. Coordinates specified
                          relative to the top-left of the page. The numbers represent
                          the x, y values of the polygon vertices, clockwise from the
                          left (-180 degrees inclusive) relative to the element
                          orientation. Required.
                    ]
                }
            ],
            "caption": {
                "content": "str",  # Content of the caption.
                  Required.
                "spans": [
                    {
                        "length": 0,  # Number of characters
                          in the content represented by the span. Required.
                        "offset": 0  # Zero-based index of
                          the content represented by the span. Required.
                    }
                ],
                "boundingRegions": [
                    {
                        "pageNumber": 0,  # 1-based page
                          number of page containing the bounding region. Required.
                        "polygon": [
                            0.0  # Bounding polygon on
                              the page, or the entire page if not specified.
                              Coordinates specified relative to the top-left of the
                              page. The numbers represent the x, y values of the
                              polygon vertices, clockwise from the left (-180 degrees
                              inclusive) relative to the element orientation. Required.
                        ]
                    }
                ],
                "elements": [
                    "str"  # Optional. Child elements of the
                      caption.
                ]
            },
            "footnotes": [
                {
                    "content": "str",  # Content of the footnote.
                      Required.
                    "spans": [
                        {
                            "length": 0,  # Number of
                              characters in the content represented by the span.
                              Required.
                            "offset": 0  # Zero-based
                              index of the content represented by the span. Required.
                        }
                    ],
                    "boundingRegions": [
                        {
                            "pageNumber": 0,  # 1-based
                              page number of page containing the bounding region.
                              Required.
                            "polygon": [
                                0.0  # Bounding
                                  polygon on the page, or the entire page if not
                                  specified. Coordinates specified relative to the
                                  top-left of the page. The numbers represent the x, y
                                  values of the polygon vertices, clockwise from the
                                  left (-180 degrees inclusive) relative to the element
                                  orientation. Required.
                            ]
                        }
                    ],
                    "elements": [
                        "str"  # Optional. Child elements of
                          the footnote.
                    ]
                }
            ]
        }
    ]
}
close() None[source]
send_request(request: HttpRequest, *, stream: bool = False, **kwargs: Any) HttpResponse[source]

Runs the network request through the client’s chained policies.

>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest("GET", "https://www.example.org/")
<HttpRequest [GET], url: 'https://www.example.org/'>
>>> response = client.send_request(request)
<HttpResponse: 200 OK>

For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request

Parameters:

request (HttpRequest) – The network request you want to make. Required.

Keyword Arguments:

stream (bool) – Whether the response payload will be streamed. Defaults to False.

Returns:

The response of your network call. Does not do error handling on your response.

Return type:

HttpResponse

Subpackages