Options for Process API
JSON representation |
---|
{ "ocrConfig": { object ( |
Fields | |
---|---|
ocrConfig |
Only applicable to |
layoutConfig |
Optional. Only applicable to |
schemaOverride |
Optional. Override the schema of the |
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 online processing with ProcessDocument . page_range can be only one of the following: |
|
individualPageSelector |
Which pages to process (1-indexed). |
fromStart |
Only process certain pages from the start. Process all if the document has fewer pages. |
fromEnd |
Only process certain pages from the end, same as above. |
IndividualPageSelector
A list of individual page numbers.
JSON representation |
---|
{ "pages": [ integer ] } |
Fields | |
---|---|
pages[] |
Optional. Indices of the pages (starting from 1). |
OcrConfig
Config for Document OCR.
JSON representation |
---|
{ "hints": { object ( |
Fields | |
---|---|
hints |
Hints for the OCR model. |
enableNativePdfParsing |
Enables special handling for PDFs with existing text information. Results in better text extraction quality in such PDF inputs. |
enableImageQualityScores |
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[] |
A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:
|
enableSymbol |
Includes symbol level OCR information if set to true. |
computeStyleInfo |
Turn on font identification model and return font style information. Deprecated, use |
disableCharacterBoxesDetection |
Turn off character box detector in OCR engine. Character box detection is enabled by default in OCR 2.0 (and later) processors. |
premiumFeatures |
Configurations for premium OCR features. |
Hints
Hints for OCR Engine
JSON representation |
---|
{ "languageHints": [ string ] } |
Fields | |
---|---|
languageHints[] |
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 |
Turn on selection mark detector in OCR engine. Only available in OCR 2.0 (and later) processors. |
computeStyleInfo |
Turn on font identification model and return font style information. |
enableMathOcr |
Turn on the model that can extract LaTeX math formulas. |
LayoutConfig
Serving config for layout parser processor.
JSON representation |
---|
{
"chunkingConfig": {
object ( |
Fields | |
---|---|
chunkingConfig |
Optional. Config for chunking in layout parser processor. |
ChunkingConfig
Serving config for chunking.
JSON representation |
---|
{ "chunkSize": integer, "includeAncestorHeadings": boolean, "semanticChunkingGroupSize": boolean, "breakpointPercentileThreshold": integer } |
Fields | |
---|---|
chunkSize |
Optional. The chunk sizes to use when splitting documents, in order of level. |
includeAncestorHeadings |
Optional. Whether or not to include ancestor headings when splitting. |
semanticChunkingGroupSize |
Optional. The number of tokens to group together when evaluating semantic similarity. |
breakpointPercentileThreshold |
Optional. The percentile of cosine dissimilarity that must be exceeded between a group of tokens and the next. The smaller this number is, the more chunks will be generated. |