ProcessDocumentRequest

Request to process one document.

JSON representation
{
  "parent": string,
  "inputConfig": {
    object (InputConfig)
  },
  "outputConfig": {
    object (OutputConfig)
  },
  "documentType": string,
  "tableExtractionParams": {
    object (TableExtractionParams)
  },
  "formExtractionParams": {
    object (FormExtractionParams)
  },
  "entityExtractionParams": {
    object (EntityExtractionParams)
  },
  "ocrParams": {
    object (OcrParams)
  }
}
Fields
parent

string

Target project and location to make a call.

Format: projects/{project-id}/locations/{location-id}.

If no location is specified, a region will be chosen automatically. This field is only populated when used in ProcessDocument method.

inputConfig

object (InputConfig)

Required. Information about the input file.

outputConfig

object (OutputConfig)

Optional. The desired output location. This field is only needed in BatchProcessDocumentsRequest.

documentType

string

Specifies a known document type for deeper structure detection. Valid values are currently "general" and "invoice". If not provided, "general"\ is used as default. If any other value is given, the request is rejected.

tableExtractionParams

object (TableExtractionParams)

Controls table extraction behavior. If not specified, the system will decide reasonable defaults.

formExtractionParams

object (FormExtractionParams)

Controls form extraction behavior. If not specified, the system will decide reasonable defaults.

entityExtractionParams

object (EntityExtractionParams)

Controls entity extraction behavior. If not specified, the system will decide reasonable defaults.

ocrParams

object (OcrParams)

Controls OCR behavior. If not specified, the system will decide reasonable defaults.

TableExtractionParams

Parameters to control table extraction behavior.

JSON representation
{
  "enabled": boolean,
  "tableBoundHints": [
    {
      object (TableBoundHint)
    }
  ],
  "headerHints": [
    string
  ],
  "modelVersion": string
}
Fields
enabled

boolean

Whether to enable table extraction.

tableBoundHints[]

object (TableBoundHint)

Optional. Table bounding box hints that can be provided to complex cases which our algorithm cannot locate the table(s) in.

headerHints[]

string

Optional. Table header hints. The extraction will bias towards producing these terms as table headers, which may improve accuracy.

modelVersion

string

Model version of the table extraction system. Default is "builtin/stable". Specify "builtin/latest" for the latest model.

TableBoundHint

A hint for a table bounding box on the page for table parsing.

JSON representation
{
  "pageNumber": integer,
  "boundingBox": {
    object (BoundingPoly)
  }
}
Fields
pageNumber

integer

Optional. Page number for multi-paged inputs this hint applies to. If not provided, this hint will apply to all pages by default. This value is 1-based.

boundingBox

object (BoundingPoly)

Bounding box hint for a table on this page. The coordinates must be normalized to [0,1] and the bounding box must be an axis-aligned rectangle.

FormExtractionParams

Parameters to control form extraction behavior.

JSON representation
{
  "enabled": boolean,
  "keyValuePairHints": [
    {
      object (KeyValuePairHint)
    }
  ],
  "modelVersion": string
}
Fields
enabled

boolean

Whether to enable form extraction.

keyValuePairHints[]

object (KeyValuePairHint)

User can provide pairs of (key text, value type) to improve the parsing result.

For example, if a document has a field called "Date" that holds a date value and a field called "Amount" that may hold either a currency value (e.g., "$500.00") or a simple number value (e.g., "20"), you could use the following hints: [ {"key": "Date", valueTypes: [ "DATE"]}, {"key": "Amount", "valueTypes": [ "PRICE", "NUMBER" ]} ]

If the value type is unknown, but you want to provide hints for the keys, you can leave the valueTypes field blank. e.g. {"key": "Date", "valueTypes": []}

modelVersion

string

Model version of the form extraction system. Default is "builtin/stable". Specify "builtin/latest" for the latest model. For custom form models, specify: "custom/{model_name}". Model name format is "bucket_name/path/to/modeldir" corresponding to "gs://bucket_name/path/to/modeldir" where annotated examples are stored.

KeyValuePairHint

User-provided hint for key value pair.

JSON representation
{
  "key": string,
  "valueTypes": [
    string
  ]
}
Fields
key

string

The key text for the hint.

valueTypes[]

string

Type of the value. This is case-insensitive, and could be one of: ADDRESS, LOCATION, ORGANIZATION, PERSON, PHONE_NUMBER, ID, NUMBER, EMAIL, PRICE, TERMS, DATE, NAME. Types not in this list will be ignored.

EntityExtractionParams

Parameters to control entity extraction behavior.

JSON representation
{
  "enabled": boolean,
  "modelVersion": string
}
Fields
enabled

boolean

Whether to enable entity extraction.

modelVersion

string

Model version of the entity extraction. Default is "builtin/stable". Specify "builtin/latest" for the latest model.

OcrParams

Parameters to control Optical Character Recognition (OCR) behavior.

JSON representation
{
  "languageHints": [
    string
  ]
}
Fields
languageHints[]

string

List of languages to use for OCR. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting languageHints is not needed. In rare cases, when the language of the text in the image is known, setting a hint will help get better results (although it will be a significant hindrance if the hint is wrong). Document processing returns an error if one or more of the specified languages is not one of the supported languages.