FormField Class

Represents a field recognized in an input form.

New in version v2.1: Support for to_dict and from_dict methods

Inheritance
builtins.object
FormField

Constructor

FormField(**kwargs: Any)

Methods

from_dict

Converts a dict in the shape of a FormField to the model itself.

to_dict

Returns a dict representation of FormField.

from_dict

Converts a dict in the shape of a FormField to the model itself.

from_dict(data: Dict) -> FormField

Parameters

Name Description
data
Required

A dictionary in the shape of FormField.

Returns

Type Description

FormField

to_dict

Returns a dict representation of FormField.

to_dict() -> Dict

Returns

Type Description

dict

Attributes

confidence

Measures the degree of certainty of the recognition result. Value is between [0.0, 1.0].

confidence: float

label_data

Contains the text, bounding box, and field elements for the field label. Note that this is not returned for forms analyzed by models trained with labels.

label_data: FieldData

name

The unique name of the field or the training-time label if analyzed from a custom model that was trained with labels.

name: str

value

The value for the recognized field. Its semantic data type is described by value_type. If the value is extracted from the form, but cannot be normalized to its type, then access the value_data.text property for a textual representation of the value.

value: str | int | float | date | time | Dict[str, FormField] | List[FormField]

value_data

Contains the text, bounding box, and field elements for the field value.

value_data: FieldData

value_type

The type of value found on FormField. Described in FieldValueType, possible types include: 'string', 'date', 'time', 'phoneNumber', 'float', 'integer', 'dictionary', 'list', 'selectionMark', or 'countryRegion'.

value_type: str