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.
251 252 253 254 |
# File 'lib/kreuzberg/result.rb', line 251 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.
249 250 251 |
# File 'lib/kreuzberg/result.rb', line 249 def detection @detection end |
#recognition ⇒ Object (readonly)
Returns the value of attribute recognition.
249 250 251 |
# File 'lib/kreuzberg/result.rb', line 249 def recognition @recognition end |
Instance Method Details
#to_h ⇒ Object
256 257 258 259 260 261 |
# File 'lib/kreuzberg/result.rb', line 256 def to_h { detection: @detection, recognition: @recognition }.compact end |