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
The Node.js OCR SDK supports the [Invoice Splitter API](https://platform.mindee.com/mindee/invoice_splitter).
8
8
9
-
Using [this sample](https://github.com/mindee/client-lib-test-data/blob/main/products/invoice_splitter/default_sample.pdf), we are going to illustrate how to detect the pages of multiple invoices within the same document.
9
+
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/invoice_splitter/default_sample.pdf), we are going to illustrate how to extract the data that we want using the OCR SDK.
These fields are generic and used in several products.
71
+
72
+
### Basic Field
73
+
Each prediction object contains a set of fields that inherit from the generic `Field` class.
74
+
A typical `Field` object will have the following attributes:
75
+
76
+
***value** (`number | string`): corresponds to the field value. Can be `undefined` if no value was extracted.
77
+
***confidence** (`number`): the confidence score of the field prediction.
78
+
***boundingBox** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
79
+
***polygon** (`Point[]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
80
+
***pageId** (`number`): the ID of the page, always `undefined` when at document-level.
81
+
***reconstructed** (`boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
82
+
83
+
> **Note:** A `Point` simply refers to an array of two numbers (`[number, number]`).
84
+
85
+
86
+
Aside from the previous attributes, all basic fields have access to a `toString()` method that can be used to print their value as a string.
87
+
67
88
## Specific Fields
68
-
### Invoice Splitter V1 Page Group
69
-
List of page group indexes.
89
+
Fields which are specific to this product; they are not used in any other product.
90
+
91
+
### Invoice Page Groups Field
92
+
List of page groups. Each group represents a single invoice within a multi-invoice document.
70
93
71
-
An `InvoiceSplitterV1PageGroup` implements the following attributes:
94
+
A `InvoiceSplitterV1InvoicePageGroup` implements the following attributes:
72
95
73
-
***pageIndexes** (`number`[]): List of indexes of the pages of a single invoice.
74
-
***confidence** (`number`): The confidence of the prediction.
96
+
*`pageIndexes` (Array<number>): List of page indexes that belong to the same invoice (group).
75
97
76
98
# Attributes
77
99
The following fields are extracted for Invoice Splitter V1:
78
100
79
101
## Invoice Page Groups
80
-
**invoicePageGroups** ([InvoiceSplitterV1PageGroup](#invoice-splitter-v1-page-group)[]): List of page indexes that belong to the same invoice in the PDF.
102
+
**invoicePageGroups** ([InvoiceSplitterV1InvoicePageGroup](#invoice-page-groups-field)[]): List of page groups. Each group represents a single invoice within a multi-invoice document.
81
103
82
104
```js
83
-
for (constinvoicePageGroupsElemofresult.document.inference.prediction.invoicePageGroups){
0 commit comments