Class: Google::Apis::DocumentaiV1::GoogleCloudDocumentaiV1OcrConfig

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/documentai_v1/classes.rb,
lib/google/apis/documentai_v1/representations.rb,
lib/google/apis/documentai_v1/representations.rb

Overview

Config for Document OCR.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDocumentaiV1OcrConfig

Returns a new instance of GoogleCloudDocumentaiV1OcrConfig.



4502
4503
4504
# File 'lib/google/apis/documentai_v1/classes.rb', line 4502

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#advanced_ocr_optionsArray<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. Corresponds to the JSON property advancedOcrOptions

Returns:

  • (Array<String>)


4468
4469
4470
# File 'lib/google/apis/documentai_v1/classes.rb', line 4468

def advanced_ocr_options
  @advanced_ocr_options
end

#compute_style_infoBoolean Also known as: compute_style_info?

Turn on font id model and returns font style information. Corresponds to the JSON property computeStyleInfo

Returns:

  • (Boolean)


4473
4474
4475
# File 'lib/google/apis/documentai_v1/classes.rb', line 4473

def compute_style_info
  @compute_style_info
end

#enable_image_quality_scoresBoolean Also known as: enable_image_quality_scores?

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. Corresponds to the JSON property enableImageQualityScores

Returns:

  • (Boolean)


4481
4482
4483
# File 'lib/google/apis/documentai_v1/classes.rb', line 4481

def enable_image_quality_scores
  @enable_image_quality_scores
end

#enable_native_pdf_parsingBoolean Also known as: enable_native_pdf_parsing?

Enables special handling for PDFs with existing text information. Results in better text extraction quality in such PDF inputs. Corresponds to the JSON property enableNativePdfParsing

Returns:

  • (Boolean)


4488
4489
4490
# File 'lib/google/apis/documentai_v1/classes.rb', line 4488

def enable_native_pdf_parsing
  @enable_native_pdf_parsing
end

#enable_symbolBoolean Also known as: enable_symbol?

Includes symbol level OCR information if set to true. Corresponds to the JSON property enableSymbol

Returns:

  • (Boolean)


4494
4495
4496
# File 'lib/google/apis/documentai_v1/classes.rb', line 4494

def enable_symbol
  @enable_symbol
end

#hintsGoogle::Apis::DocumentaiV1::GoogleCloudDocumentaiV1OcrConfigHints

Hints for OCR Engine Corresponds to the JSON property hints



4500
4501
4502
# File 'lib/google/apis/documentai_v1/classes.rb', line 4500

def hints
  @hints
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



4507
4508
4509
4510
4511
4512
4513
4514
# File 'lib/google/apis/documentai_v1/classes.rb', line 4507

def update!(**args)
  @advanced_ocr_options = args[:advanced_ocr_options] if args.key?(:advanced_ocr_options)
  @compute_style_info = args[:compute_style_info] if args.key?(:compute_style_info)
  @enable_image_quality_scores = args[:enable_image_quality_scores] if args.key?(:enable_image_quality_scores)
  @enable_native_pdf_parsing = args[:enable_native_pdf_parsing] if args.key?(:enable_native_pdf_parsing)
  @enable_symbol = args[:enable_symbol] if args.key?(:enable_symbol)
  @hints = args[:hints] if args.key?(:hints)
end