Class: Kreuzberg::Result::LayoutRegion
- Inherits:
-
Struct
- Object
- Struct
- Kreuzberg::Result::LayoutRegion
- Defined in:
- lib/kreuzberg/result.rb
Instance Attribute Summary collapse
-
#area_fraction ⇒ Float
readonly
Fraction of page area covered (0.0 to 1.0).
-
#bounding_box ⇒ ElementBoundingBox
readonly
Bounding box in document coordinate space.
-
#class_name ⇒ String
readonly
Layout class name (e.g. “picture”, “table”, “text”).
-
#confidence ⇒ Float
readonly
Detection confidence score (0.0 to 1.0).
Instance Method Summary collapse
Instance Attribute Details
#area_fraction ⇒ Float (readonly)
Returns Fraction of page area covered (0.0 to 1.0).
170 171 172 173 174 175 176 177 178 179 |
# File 'lib/kreuzberg/result.rb', line 170 LayoutRegion = Struct.new(:class_name, :confidence, :bounding_box, :area_fraction) do def to_h { class: class_name, confidence: confidence, bounding_box: bounding_box&.to_h, area_fraction: area_fraction } end end |
#bounding_box ⇒ ElementBoundingBox (readonly)
Returns Bounding box in document coordinate space.
170 171 172 173 174 175 176 177 178 179 |
# File 'lib/kreuzberg/result.rb', line 170 LayoutRegion = Struct.new(:class_name, :confidence, :bounding_box, :area_fraction) do def to_h { class: class_name, confidence: confidence, bounding_box: bounding_box&.to_h, area_fraction: area_fraction } end end |
#class_name ⇒ String (readonly)
Returns Layout class name (e.g. “picture”, “table”, “text”).
170 171 172 173 174 175 176 177 178 179 |
# File 'lib/kreuzberg/result.rb', line 170 LayoutRegion = Struct.new(:class_name, :confidence, :bounding_box, :area_fraction) do def to_h { class: class_name, confidence: confidence, bounding_box: bounding_box&.to_h, area_fraction: area_fraction } end end |
#confidence ⇒ Float (readonly)
Returns Detection confidence score (0.0 to 1.0).
170 171 172 173 174 175 176 177 178 179 |
# File 'lib/kreuzberg/result.rb', line 170 LayoutRegion = Struct.new(:class_name, :confidence, :bounding_box, :area_fraction) do def to_h { class: class_name, confidence: confidence, bounding_box: bounding_box&.to_h, area_fraction: area_fraction } end end |
Instance Method Details
#to_h ⇒ Object
171 172 173 174 175 176 177 178 |
# File 'lib/kreuzberg/result.rb', line 171 def to_h { class: class_name, confidence: confidence, bounding_box: bounding_box&.to_h, area_fraction: area_fraction } end |