pycognaize.document.field.section_field.SectionField

class SectionField(name, value='', ocr_value='', tags=None, field_id=None, group_key=None, confidence=-1.0, group_name=None, mapping=None)[source]

Bases: Field

Base class for all pycognaize Section fields

Parameters:
  • name (str)

  • value (str)

  • ocr_value (str)

  • tags (Optional[List[SectionTag]])

  • field_id (Optional[str])

  • group_key (str)

  • confidence (Optional[float])

  • group_name (str)

  • mapping (Optional[List[Dict[str, str]]])

Methods

construct_from_raw

Create SectionField object from dictionary

to_dict

Converts SectionField object to dictionary

Attributes

classes

classification_labels

confidence

end

Returns the end tag of the field

field_id

group_key

group_name

mapping

name

raw_value

start

Returns the start tag of the field

tags

value

classmethod construct_from_raw(raw, pages, html=None, labels=None)[source]

Create SectionField object from dictionary

Parameters:
  • raw (dict)

  • pages (Dict[int, Page])

  • html (Optional[HTML])

Return type:

SectionField

property end: SectionTag | None

Returns the end tag of the field

property start: SectionTag | None

Returns the start tag of the field

tag_class

alias of SectionTag

to_dict()[source]

Converts SectionField object to dictionary

Return type:

dict