pycognaize.document.field.table_field.TableField

class TableField(name, tag=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)

  • tag (Union[TableTag, HTMLTableTag, None])

  • field_id (Optional[str])

  • group_key (str)

  • confidence (Optional[float])

  • group_name (str)

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

Methods

construct_from_raw

Create TableField object from dictionary

get_table_title

parse_table

to_dict

Converts TableField object to dictionary

Attributes

classes

classification_labels

confidence

field_id

group_key

group_name

mapping

name

raw_value

tags

value

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

Create TableField object from dictionary

Parameters:
  • raw (dict)

  • pages (Dict[int, Page])

  • html (Optional[HTML])

Return type:

TableField

html_tag_class

alias of HTMLTableTag

tag_class

alias of TableTag

to_dict()[source]

Converts TableField object to dictionary

Return type:

dict