-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📄 add md auto-documentation for products + support for usdl (#184)
- Loading branch information
1 parent
715f632
commit 6ad90e9
Showing
31 changed files
with
3,054 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
--- | ||
title: Bank Account Details OCR Node.js | ||
--- | ||
The Node.js OCR SDK supports the [Bank Account Details API](https://platform.mindee.com/mindee/bank_account_details). | ||
|
||
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/fr/bank_account_details/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK. | ||
![Bank Account Details sample](https://github.com/mindee/client-lib-test-data/blob/main/fr/bank_account_details/default_sample.jpg?raw=true) | ||
|
||
# Quick-Start | ||
```js | ||
const mindee = require("mindee"); | ||
// for TS or modules: | ||
// import * as mindee from "mindee"; | ||
|
||
// Init a new client | ||
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" }); | ||
|
||
// Load a file from disk | ||
const inputSource = mindeeClient.docFromPath("/path/to/the/file.ext"); | ||
|
||
// Parse the file | ||
const apiResponse = mindeeClient.parse( | ||
mindee.product.fr.BankAccountDetailsV2, | ||
inputSource | ||
); | ||
|
||
// Handle the response Promise | ||
apiResponse.then((resp) => { | ||
// print a string summary | ||
console.log(resp.document.toString()); | ||
}); | ||
``` | ||
|
||
**Output (RST):** | ||
```rst | ||
######## | ||
Document | ||
######## | ||
:Mindee ID: bc8f7265-8dab-49fe-810c-d50049605578 | ||
:Filename: default_sample.jpg | ||
Inference | ||
######### | ||
:Product: mindee/bank_account_details v2.0 | ||
:Rotation applied: Yes | ||
Prediction | ||
========== | ||
:Account Holder's Names: MME HEGALALDIA L ENVOL | ||
:Basic Bank Account Number: | ||
:Bank Code: 13335 | ||
:Branch Code: 00040 | ||
:Key: 06 | ||
:Account Number: 08932891361 | ||
:IBAN: FR7613335000400893289136106 | ||
:SWIFT Code: CEPAFRPP333 | ||
Page Predictions | ||
================ | ||
Page 0 | ||
------ | ||
:Account Holder's Names: MME HEGALALDIA L ENVOL | ||
:Basic Bank Account Number: | ||
:Bank Code: 13335 | ||
:Branch Code: 00040 | ||
:Key: 06 | ||
:Account Number: 08932891361 | ||
:IBAN: FR7613335000400893289136106 | ||
:SWIFT Code: CEPAFRPP333 | ||
``` | ||
|
||
# Field Types | ||
## Standard Fields | ||
These fields are generic and used in several products. | ||
|
||
### Basic Field | ||
Each prediction object contains a set of fields that inherit from the generic `Field` class. | ||
A typical `Field` object will have the following attributes: | ||
|
||
* **value** (number|string): corresponds to the field value. Can be `undefined` if no value was extracted. | ||
* **confidence** (`number`): the confidence score of the field prediction. | ||
* **boundingBox** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. | ||
* **polygon** (`Point[]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. | ||
* **pageId** (`number`): the ID of the page, is `undefined` when at document-level. | ||
* **reconstructed** (`boolean`): indicates whether or not an object was reconstructed (not extracted as the API gave it). | ||
|
||
> **Note:** A `Point` simply refers to an array of two numbers (`[number, number]`). | ||
|
||
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. | ||
|
||
### String Field | ||
The text field `StringField` only has one constraint: it's **value** is a `string` (or `undefined`). | ||
|
||
## Specific Fields | ||
Fields which are specific to this product; they are not used in any other product. | ||
|
||
### Basic Bank Account Number Field | ||
Full extraction of BBAN, including: branch code, bank code, account and key. | ||
|
||
A `BankAccountDetailsV2Bban` implements the following attributes: | ||
|
||
* `bbanBankCode` (string): The BBAN bank code outputted as a string. | ||
* `bbanBranchCode` (string): The BBAN branch code outputted as a string. | ||
* `bbanKey` (string): The BBAN key outputted as a string. | ||
* `bbanNumber` (string): The BBAN Account number outputted as a string. | ||
|
||
# Attributes | ||
The following fields are extracted for Bank Account Details V2: | ||
|
||
## Account Holder's Names | ||
**accountHoldersNames** ([StringField](#string-field)): Full extraction of the account holders names. | ||
|
||
```js | ||
console.log(result.document.inference.prediction.accountHoldersNames.value); | ||
``` | ||
|
||
## Basic Bank Account Number | ||
**bban** ([BankAccountDetailsV2Bban](#basic-bank-account-number)): Full extraction of BBAN, including: branch code, bank code, account and key. | ||
|
||
```js | ||
console.log(result.document.inference.prediction.bban.value); | ||
``` | ||
|
||
## IBAN | ||
**iban** ([StringField](#string-field)): Full extraction of the IBAN number. | ||
|
||
```js | ||
console.log(result.document.inference.prediction.iban.value); | ||
``` | ||
|
||
## SWIFT Code | ||
**swiftCode** ([StringField](#string-field)): Full extraction of the SWIFT code. | ||
|
||
```js | ||
console.log(result.document.inference.prediction.swiftCode.value); | ||
``` | ||
|
||
# Questions? | ||
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
--- | ||
title: Bank Check OCR Node.js | ||
--- | ||
The Node.js OCR SDK supports the [Bank Check API](https://platform.mindee.com/mindee/bank_check). | ||
|
||
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/us/bank_check/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK. | ||
![Bank Check sample](https://github.com/mindee/client-lib-test-data/blob/main/us/bank_check/default_sample.jpg?raw=true) | ||
|
||
# Quick-Start | ||
```js | ||
const mindee = require("mindee"); | ||
// for TS or modules: | ||
// import * as mindee from "mindee"; | ||
|
||
// Init a new client | ||
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" }); | ||
|
||
// Load a file from disk | ||
const inputSource = mindeeClient.docFromPath("/path/to/the/file.ext"); | ||
|
||
// Parse the file | ||
const apiResponse = mindeeClient.parse( | ||
mindee.product.us.BankCheckV1, | ||
inputSource | ||
); | ||
|
||
// Handle the response Promise | ||
apiResponse.then((resp) => { | ||
// print a string summary | ||
console.log(resp.document.toString()); | ||
}); | ||
``` | ||
|
||
**Output (RST):** | ||
```rst | ||
######## | ||
Document | ||
######## | ||
:Mindee ID: b9809586-57ae-4f84-a35d-a85b2be1f2a2 | ||
:Filename: default_sample.jpg | ||
Inference | ||
######### | ||
:Product: mindee/bank_check v1.0 | ||
:Rotation applied: Yes | ||
Prediction | ||
========== | ||
:Check Issue Date: 2022-03-29 | ||
:Amount: 15332.90 | ||
:Payees: JOHN DOE | ||
JANE DOE | ||
:Routing Number: | ||
:Account Number: 7789778136 | ||
:Check Number: 0003401 | ||
Page Predictions | ||
================ | ||
Page 0 | ||
------ | ||
:Check Position: Polygon with 21 points. | ||
:Signature Positions: Polygon with 6 points. | ||
:Check Issue Date: 2022-03-29 | ||
:Amount: 15332.90 | ||
:Payees: JOHN DOE | ||
JANE DOE | ||
:Routing Number: | ||
:Account Number: 7789778136 | ||
:Check Number: 0003401 | ||
``` | ||
|
||
# Field Types | ||
## Standard Fields | ||
These fields are generic and used in several products. | ||
|
||
### Basic Field | ||
Each prediction object contains a set of fields that inherit from the generic `Field` class. | ||
A typical `Field` object will have the following attributes: | ||
|
||
* **value** (number|string): corresponds to the field value. Can be `undefined` if no value was extracted. | ||
* **confidence** (`number`): the confidence score of the field prediction. | ||
* **boundingBox** (`[Point, Point, Point, Point]`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. | ||
* **polygon** (`Point[]`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. | ||
* **pageId** (`number`): the ID of the page, is `undefined` when at document-level. | ||
* **reconstructed** (`boolean`): indicates whether or not an object was reconstructed (not extracted as the API gave it). | ||
|
||
> **Note:** A `Point` simply refers to an array of two numbers (`[number, number]`). | ||
|
||
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. | ||
|
||
|
||
### Amount Field | ||
The amount field `AmountField` only has one constraint: its **value** is a `number` (or `undefined`). | ||
|
||
### Date Field | ||
Aside from the basic `Field` attributes, the date field `DateField` also implements the following: | ||
|
||
* **dateObject** (`Date`): an accessible representation of the value as a JavaScript object. | ||
|
||
|
||
### Position Field | ||
The position field `PositionField` does not implement all the basic `Field` attributes, only **boundingBox**, **polygon** and **pageId**. On top of these, it has access to: | ||
|
||
* **rectangle** (`[Point, Point, Point, Point]`): a Polygon with four points that may be oriented (even beyond canvas). | ||
* **quadrangle** (`[Point, Point, Point, Point]`): a free polygon made up of four points. | ||
|
||
### String Field | ||
The text field `StringField` only has one constraint: it's **value** is a `string` (or `undefined`). | ||
|
||
## Page-Level Fields | ||
Some fields are constrained to the page level, and so will not be retrievable to through the document. | ||
|
||
# Attributes | ||
The following fields are extracted for Bank Check V1: | ||
|
||
## Account Number | ||
**accountNumber** ([StringField](#string-field)): The check payer's account number. | ||
|
||
```js | ||
console.log(result.document.inference.prediction.accountNumber.value); | ||
``` | ||
|
||
## Amount | ||
**amount** ([AmountField](#amount-field)): The amount of the check. | ||
|
||
```js | ||
console.log(result.document.inference.prediction.amount.value); | ||
``` | ||
|
||
## Check Number | ||
**checkNumber** ([StringField](#string-field)): The issuer's check number. | ||
|
||
```js | ||
console.log(result.document.inference.prediction.checkNumber.value); | ||
``` | ||
|
||
## Check Position | ||
[📄](#page-level-fields "This field is only present on individual pages.")**checkPosition** ([PositionField](#position-field)): The position of the check on the document. | ||
|
||
```js | ||
console.log(result.document.inference.pages[0].prediction.checkPosition.polygon); | ||
``` | ||
|
||
## Check Issue Date | ||
**date** ([DateField](#date-field)): The date the check was issued. | ||
|
||
```js | ||
console.log(result.document.inference.prediction.date.value); | ||
``` | ||
|
||
## Payees | ||
**payees** ([StringField](#string-field)): List of the check's payees (recipients). | ||
|
||
```js | ||
console.log(result.document.inference.prediction.payees.value); | ||
``` | ||
|
||
## Routing Number | ||
**routingNumber** ([StringField](#string-field)): The check issuer's routing number. | ||
|
||
```js | ||
console.log(result.document.inference.prediction.routingNumber.value); | ||
``` | ||
|
||
## Signature Positions | ||
[📄](#page-level-fields "This field is only present on individual pages.")**signaturesPositions** ([PositionField](#position-field)): List of signature positions | ||
|
||
```js | ||
console.log(result.document.inference.pages[0].prediction.signaturesPositions.polygon); | ||
``` | ||
|
||
# Questions? | ||
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw) |
Oops, something went wrong.