pycognaize.document.field.numeric_field.NumericField

class NumericField(name, value='', calculated_value='', tags=None, field_id=None, group_key=None, confidence=-1.0, group_name=None, scale=None, mapping=None, is_calculated=None)[source]

Bases: Field

Base class for all pycognaize number fields

Parameters:
  • name (str)

  • value (str)

  • calculated_value (str)

  • tags (Optional[List[ExtractionTag]])

  • field_id (Optional[str])

  • group_key (str)

  • confidence (Optional[float])

  • group_name (str)

  • scale (int)

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

  • is_calculated (bool)

Methods

construct_from_raw

Create NumericField object from dictionary

convert_to_numeric

converts string value to numeric

to_dict

Converts NumericField object to dictionary

Attributes

calculated_value

classes

classification_labels

confidence

field_id

field_value

group_key

group_name

is_calculated

mapping

name

raw_field_value

raw_value

tag_value

tags

value

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

Create NumericField object from dictionary

Parameters:
  • raw (dict)

  • pages (Dict[int, Page])

  • html (Optional[HTML])

Return type:

NumericField

static convert_to_numeric(value)[source]

converts string value to numeric

html_tag_class

alias of HTMLTag

tag_class

alias of ExtractionTag

to_dict()[source]

Converts NumericField object to dictionary

Return type:

dict