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