You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/extras/guide/custom_v1.md
+17-6Lines changed: 17 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,16 +47,27 @@ If it is not set, it will default to "1".
47
47
48
48
A `ListField` is a special type of custom list that implements the following:
49
49
50
+
50
51
***confidence** (`float`): the confidence score of the field prediction.
51
-
***page_id** (`int`): the ID of the page.
52
52
***reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it).
53
+
***values** (`List[`[ListFieldValue](#list-field-value)`]`): list of value fields
53
54
54
55
Since the inner contents can vary, the value isn't accessed through a property, but rather through the following functions:
55
56
***contents_list()** (`-> List[Union[str, float]]`): returns a list of values for each element.
56
57
***contents_string(separator=" ")** (`-> str`): returns a list of concatenated values, with an optional **separator**`str` between them.
57
58
***__str__()**: returns a string representation of all values, with an empty space between each of them.
58
59
59
60
61
+
#### List Field Value
62
+
63
+
Values of `ListField`s are stored in a `ListFieldValue` structure, which is implemented as follows:
64
+
***content** (`str`): extracted content of the prediction
65
+
***confidence** (`float`): the confidence score of the prediction
66
+
***bounding_box** (`BBox`): 4 relative vertices corrdinates of a rectangle containing the word in the document.
67
+
***polygon** (`Polygon`): vertices of a polygon containing the word.
68
+
***page_id** (`int`): the ID of the page, is `undefined` when at document-level.
69
+
70
+
60
71
### Classification Field
61
72
62
73
A `ClassificationField` is a special type of custom classification that implements the following:
@@ -99,7 +110,7 @@ The **columns_to_line_items()** function can be called from the document and pag
99
110
100
111
It takes the following arguments:
101
112
102
-
***anchor_names** (`List[str]`): a list of the names of possible anchor (field) candidate for the horizontal placement a line. If all provided anchors are invalid, the `LineItemV1` won't be built.
113
+
***anchor_names** (`List[str]`): a list of the names of possible anchor (field) candidate for the horizontal placement a line. If all provided anchors are invalid, the `CustomLine` won't be built.
103
114
***field_names** (`List[str]`): a list of fields to retrieve the values from
104
115
***height_tolerance** (`float`): Optional, the height tolerance used to build the line. It helps when the height of a line can vary unexpectedly.
0 commit comments