Class: Mindee::Parsing::Custom::ClassificationField
- Inherits:
-
Object
- Object
- Mindee::Parsing::Custom::ClassificationField
- Defined in:
- lib/mindee/parsing/custom/classification_field.rb
Overview
Document classification (custom docs)
Instance Attribute Summary collapse
-
#confidence ⇒ Float
The confidence score, value will be between 0.0 and 1.0.
-
#value ⇒ String
readonly
The classification value.
Instance Method Summary collapse
-
#initialize(prediction) ⇒ ClassificationField
constructor
A new instance of ClassificationField.
- #to_s ⇒ String
Constructor Details
#initialize(prediction) ⇒ ClassificationField
Returns a new instance of ClassificationField.
16 17 18 19 |
# File 'lib/mindee/parsing/custom/classification_field.rb', line 16 def initialize(prediction) @value = prediction['value'] @confidence = prediction['confidence'] end |
Instance Attribute Details
#confidence ⇒ Float
The confidence score, value will be between 0.0 and 1.0
13 14 15 |
# File 'lib/mindee/parsing/custom/classification_field.rb', line 13 def confidence @confidence end |
#value ⇒ String (readonly)
The classification value
10 11 12 |
# File 'lib/mindee/parsing/custom/classification_field.rb', line 10 def value @value end |
Instance Method Details
#to_s ⇒ String
22 23 24 |
# File 'lib/mindee/parsing/custom/classification_field.rb', line 22 def to_s @value.nil? ? '' : @value end |