Class: Xberg::VlmFallbackPolicyOnLowQuality
- Inherits:
-
Data
- Object
- Data
- Xberg::VlmFallbackPolicyOnLowQuality
- Extended by:
- T::Sig
- Includes:
- VlmFallbackPolicy
- Defined in:
- lib/xberg/native.rb
Overview
Try the classical OCR backend first. If the quality score is below
quality_threshold, send the page to the VLM.
quality_threshold is in the [0.0, 1.0] range produced by
calculate_quality_score. A value of 0.5 is a
reasonable starting point; calibrate with the Stage 0 benchmark harness.
Instance Attribute Summary collapse
-
#quality_threshold ⇒ Object
readonly
rubocop:disable Lint/UselessMethodDefinition.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#quality_threshold ⇒ Object (readonly)
rubocop:disable Lint/UselessMethodDefinition
447 448 449 |
# File 'lib/xberg/native.rb', line 447 def quality_threshold @quality_threshold end |
Class Method Details
.from_hash(hash) ⇒ Object
465 466 467 |
# File 'lib/xberg/native.rb', line 465 def self.from_hash(hash) new(quality_threshold: hash[:quality_threshold] || hash["quality_threshold"]) end |
Instance Method Details
#always? ⇒ Boolean
461 462 463 |
# File 'lib/xberg/native.rb', line 461 def always? = false # @param hash [Hash] deserialized from the native extension # @return [self] |
#disabled? ⇒ Boolean
457 |
# File 'lib/xberg/native.rb', line 457 def disabled? = false |
#on_low_quality? ⇒ Boolean
459 |
# File 'lib/xberg/native.rb', line 459 def on_low_quality? = true |