ProcessOptions

Options for Process API

JSON representation
{
  "ocrConfig": {
    object (OcrConfig)
  },
  "schemaOverride": {
    object (DocumentSchema)
  },

  // Union field page_range can be only one of the following:
  "individualPageSelector": {
    object (IndividualPageSelector)
  },
  "fromStart": integer,
  "fromEnd": integer
  // End of list of possible types for union field page_range.
}
Fields
ocrConfig

object (OcrConfig)

Only applicable to OCR_PROCESSOR and FORM_PARSER_PROCESSOR. Returns error if set on other processor types.

schemaOverride

object (DocumentSchema)

Optional. Override the schema of the ProcessorVersion. Will return an Invalid Argument error if this field is set when the underlying ProcessorVersion doesn't support schema override.

Union field page_range. A subset of pages to process. If not specified, all pages are processed. If a page range is set, only the given pages are extracted and processed from the document. In the output document, Document.Page.page_number refers to the page number in the original document. This configuration only applies to sync requests. page_range can be only one of the following:
individualPageSelector

object (IndividualPageSelector)

Which pages to process (1-indexed).

fromStart

integer

Only process certain pages from the start. Process all if the document has fewer pages.

fromEnd

integer

Only process certain pages from the end, same as above.

IndividualPageSelector

A list of individual page numbers.

JSON representation
{
  "pages": [
    integer
  ]
}
Fields
pages[]

integer

Optional. Indices of the pages (starting from 1).

OcrConfig

Config for Document OCR.

JSON representation
{
  "hints": {
    object (Hints)
  },
  "enableNativePdfParsing": boolean,
  "enableImageQualityScores": boolean,
  "advancedOcrOptions": [
    string
  ],
  "enableSymbol": boolean,
  "computeStyleInfo": boolean,
  "disableCharacterBoxesDetection": boolean,
  "premiumFeatures": {
    object (PremiumFeatures)
  }
}
Fields
hints

object (Hints)

Hints for the OCR model.

enableNativePdfParsing

boolean

Enables special handling for PDFs with existing text information. Results in better text extraction quality in such PDF inputs.

enableImageQualityScores

boolean

Enables intelligent document quality scores after OCR. Can help with diagnosing why OCR responses are of poor quality for a given input. Adds additional latency comparable to regular OCR to the process call.

advancedOcrOptions[]

string

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.
enableSymbol

boolean

Includes symbol level OCR information if set to true.

computeStyleInfo
(deprecated)

boolean

Turn on font identification model and return font style information. Deprecated, use PremiumFeatures.compute_style_info instead.

disableCharacterBoxesDetection

boolean

Turn off character box detector in OCR engine. Character box detection is enabled by default in OCR 2.0 (and later) processors.

premiumFeatures

object (PremiumFeatures)

Configurations for premium OCR features.

Hints

Hints for OCR Engine

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

string

List of BCP-47 language codes to use for OCR. In most cases, not specifying it yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting hints 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).

PremiumFeatures

Configurations for premium OCR features.

JSON representation
{
  "enableSelectionMarkDetection": boolean,
  "computeStyleInfo": boolean,
  "enableMathOcr": boolean
}
Fields
enableSelectionMarkDetection

boolean

Turn on selection mark detector in OCR engine. Only available in OCR 2.0 (and later) processors.

computeStyleInfo

boolean

Turn on font identification model and return font style information.

enableMathOcr

boolean

Turn on the model that can extract LaTeX math formulas.