Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianMindee committed Nov 17, 2023
1 parent 1e7306b commit 98dff7d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/extras/guide/custom_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,27 @@ If it is not set, it will default to "1".

A `ListField` is a special type of custom list that implements the following:


* **confidence** (`float`): the confidence score of the field prediction.
* **page_id** (`int`): the ID of the page.
* **reconstructed** (`bool`): indicates whether or not an object was reconstructed (not extracted as the API gave it).
* **values** (`List[`[ListFieldValue](#list-field-value)`]`): list of value fields

Since the inner contents can vary, the value isn't accessed through a property, but rather through the following functions:
* **contents_list()** (`-> List[Union[str, float]]`): returns a list of values for each element.
* **contents_string(separator=" ")** (`-> str`): returns a list of concatenated values, with an optional **separator** `str` between them.
* **__str__()**: returns a string representation of all values, with an empty space between each of them.


#### List Field Value

Values of `ListField`s are stored in a `ListFieldValue` structure, which is implemented as follows:
* **content** (`str`): extracted content of the prediction
* **confidence** (`float`): the confidence score of the prediction
* **bounding_box** (`BBox`): 4 relative vertices corrdinates of a rectangle containing the word in the document.
* **polygon** (`Polygon`): vertices of a polygon containing the word.
* **page_id** (`int`): the ID of the page, is `undefined` when at document-level.


### Classification Field

A `ClassificationField` is a special type of custom classification that implements the following:
Expand Down

0 comments on commit 98dff7d

Please sign in to comment.