pycognaize.document.field.span_field.SpanField

class SpanField(name, 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 table fields

Parameters:
  • name (str)

  • value (str)

  • tags (Optional[SpanTag])

  • field_id (Optional[str])

  • group_key (str)

  • confidence (Optional[float])

  • group_name (str)

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

Methods

construct_from_raw

Create SnapField object from dictionary

order_tags

Order tags by pdf data

to_dict

Converts SpanField object to dictionary

Attributes

classes

classification_labels

confidence

field_id

group_key

group_name

line_values

mapping

name

raw_value

tags

value

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

Create SnapField object from dictionary

Parameters:
Return type:

SpanField

order_tags()[source]

Order tags by pdf data

tag_class

alias of SpanTag

to_dict()[source]

Converts SpanField object to dictionary

Return type:

dict