Class: Kreuzberg::Result::OcrConfidence
- Inherits:
-
Object
- Object
- Kreuzberg::Result::OcrConfidence
- Defined in:
- lib/kreuzberg/result.rb
Overview
OCR confidence scores for detection and recognition
Instance Attribute Summary collapse
-
#detection ⇒ Object
readonly
Returns the value of attribute detection.
-
#recognition ⇒ Object
readonly
Returns the value of attribute recognition.
Instance Method Summary collapse
-
#initialize(detection: nil, recognition: nil) ⇒ OcrConfidence
constructor
A new instance of OcrConfidence.
- #to_h ⇒ Object
Constructor Details
#initialize(detection: nil, recognition: nil) ⇒ OcrConfidence
Returns a new instance of OcrConfidence.
271 272 273 274 |
# File 'lib/kreuzberg/result.rb', line 271 def initialize(detection: nil, recognition: nil) @detection = detection&.to_f @recognition = recognition&.to_f end |
Instance Attribute Details
#detection ⇒ Object (readonly)
Returns the value of attribute detection.
269 270 271 |
# File 'lib/kreuzberg/result.rb', line 269 def detection @detection end |
#recognition ⇒ Object (readonly)
Returns the value of attribute recognition.
269 270 271 |
# File 'lib/kreuzberg/result.rb', line 269 def recognition @recognition end |
Instance Method Details
#to_h ⇒ Object
276 277 278 279 280 281 |
# File 'lib/kreuzberg/result.rb', line 276 def to_h { detection: @detection, recognition: @recognition }.compact end |