pycognaize.document.tag.section_tag.SectionTag

class SectionTag(top, left, height, width, page, tag_type)[source]

Bases: LineTag

Represents field’s coordinate data on document

Methods

construct_from_raw

Builds Tag object from pycognaize raw data

set_class_confidence

to_dict

Converts extraction tag to dict

vertical_shift

vshift

Shifts line vertically

Attributes

confidence

page

top

type

__add__(other)[source]

Merge two rectangles into one

Parameters:

other (Union[LineTag, Cell])

Return type:

SectionTag

classmethod construct_from_raw(raw, pages, tag_type)[source]

Builds Tag object from pycognaize raw data

Parameters:
  • raw (dict) – pycognaize field’s tag info

  • pages (Dict[int, Page]) – Page to which the tag belongs

  • tag_type (str) – Page to which the tag belongs

Return type:

SectionTag

Returns:

to_dict()[source]

Converts extraction tag to dict

Return type:

dict

vshift(by)[source]

Shifts line vertically

Parameters:

by – the amount by which the tag should be vertically shifted

Return type:

SectionTag

Returns:

shifted rectangle