Custom Fields

Classification

class ClassificationField(raw_prediction)

A classification field.

Parameters:

raw_prediction (Dict[str, Any]) –

confidence: float

The confidence score

value: str

The classification value.

Line Items

class CustomLine(row_number)

Represent a single line.

Parameters:

row_number (int) –

update_field(field_name, field_value)

Updates a field value if it exists.

Parameters:
  • field_name (str) – name of the field to update.

  • field_value (ListFieldValue) – value of the field to set.

Return type:

None

bbox: BBox

Simplified bounding box of the line.

fields: Dict[str, ListFieldValue]

Fields contained in the line.

row_number: int

Index of the row of a given line.

Lists

List Field

class ListField(raw_prediction, reconstructed=False, page_id=None)

A list of values or words.

Parameters:
  • raw_prediction (Dict[str, Any]) –

  • reconstructed (bool) –

  • page_id (Optional[int]) –

contents_string(separator=' ')

Return a string representation of all values.

Parameters:

separator (str, default: ' ') – Character(s) to use when concatenating fields.

Return type:

str

confidence: float

Confidence score

property contents_list: List[str]

Return a List of the contents of all values.

reconstructed: bool

Whether the field was reconstructed from other fields.

values: List[ListFieldValue]

List of word values

List Field Value

class ListFieldValue(raw_prediction, page_id=None)

A single value or word.

Parameters:
  • raw_prediction (Dict[str, Any]) –

  • page_id (Optional[int]) –

confidence: float

Confidence score

content: str

The content text

page_id: Optional[int]

Id of the page the field was found on.

String Dict

StringDict

Basic JSON-compliant python dictionary.