mindee 3.4.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/README.md +4 -0
- data/bin/mindee.rb +39 -15
- data/docs/bank_statement_fr_v1.md +175 -0
- data/docs/carte_grise_v1.md +4 -4
- data/docs/code_samples/bank_statement_fr_v1_async.txt +19 -0
- data/docs/code_samples/default.txt +19 -19
- data/docs/code_samples/default_async.txt +25 -0
- data/docs/code_samples/eu_driver_license_v1.txt +19 -0
- data/docs/code_samples/international_id_v1_async.txt +19 -0
- data/docs/code_samples/international_id_v2_async.txt +19 -0
- data/docs/eu_driver_license_v1.md +223 -0
- data/docs/financial_document_v1.md +48 -40
- data/docs/generated_v1.md +90 -0
- data/docs/invoices_v4.md +4 -1
- data/docs/proof_of_address_v1.md +4 -4
- data/docs/us_driver_license_v1.md +2 -2
- data/lib/mindee/client.rb +5 -3
- data/lib/mindee/http/endpoint.rb +13 -12
- data/lib/mindee/input/sources.rb +28 -5
- data/lib/mindee/parsing/common/inference.rb +3 -1
- data/lib/mindee/parsing/generated/generated_list_field.rb +58 -0
- data/lib/mindee/parsing/generated/generated_object_field.rb +109 -0
- data/lib/mindee/parsing/generated.rb +4 -0
- data/lib/mindee/parsing.rb +1 -0
- data/lib/mindee/product/barcode_reader/barcode_reader_v1.rb +3 -1
- data/lib/mindee/product/cropper/cropper_v1.rb +3 -1
- data/lib/mindee/product/eu/driver_license/driver_license_v1.rb +41 -0
- data/lib/mindee/product/eu/driver_license/driver_license_v1_document.rb +88 -0
- data/lib/mindee/product/eu/driver_license/driver_license_v1_page.rb +53 -0
- data/lib/mindee/product/eu/license_plate/license_plate_v1.rb +3 -1
- data/lib/mindee/product/financial_document/financial_document_v1.rb +3 -1
- data/lib/mindee/product/fr/bank_account_details/bank_account_details_v1.rb +3 -1
- data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2.rb +3 -1
- data/lib/mindee/product/fr/bank_statement/bank_statement_v1.rb +41 -0
- data/lib/mindee/product/fr/bank_statement/bank_statement_v1_document.rb +130 -0
- data/lib/mindee/product/fr/bank_statement/bank_statement_v1_page.rb +34 -0
- data/lib/mindee/product/fr/bank_statement/bank_statement_v1_transaction.rb +64 -0
- data/lib/mindee/product/fr/carte_grise/carte_grise_v1.rb +3 -1
- data/lib/mindee/product/fr/carte_vitale/carte_vitale_v1.rb +3 -1
- data/lib/mindee/product/fr/id_card/id_card_v1.rb +3 -1
- data/lib/mindee/product/fr/id_card/id_card_v2.rb +3 -1
- data/lib/mindee/product/generated/generated_v1.rb +38 -0
- data/lib/mindee/product/generated/generated_v1_document.rb +35 -0
- data/lib/mindee/product/generated/generated_v1_page.rb +51 -0
- data/lib/mindee/product/generated/generated_v1_prediction.rb +114 -0
- data/lib/mindee/product/international_id/international_id_v1.rb +39 -0
- data/lib/mindee/product/international_id/international_id_v1_document.rb +109 -0
- data/lib/mindee/product/international_id/international_id_v1_page.rb +32 -0
- data/lib/mindee/product/international_id/international_id_v2.rb +39 -0
- data/lib/mindee/product/international_id/international_id_v2_document.rb +119 -0
- data/lib/mindee/product/international_id/international_id_v2_page.rb +32 -0
- data/lib/mindee/product/invoice/invoice_v4.rb +3 -1
- data/lib/mindee/product/multi_receipts_detector/multi_receipts_detector_v1.rb +3 -1
- data/lib/mindee/product/passport/passport_v1.rb +3 -1
- data/lib/mindee/product/proof_of_address/proof_of_address_v1.rb +3 -1
- data/lib/mindee/product/receipt/receipt_v5.rb +3 -1
- data/lib/mindee/product/us/bank_check/bank_check_v1.rb +3 -1
- data/lib/mindee/product/us/driver_license/driver_license_v1.rb +3 -1
- data/lib/mindee/product/us/w9/w9_v1.rb +3 -1
- data/lib/mindee/product.rb +5 -0
- data/lib/mindee/version.rb +1 -1
- data/lib/mindee.rb +4 -0
- metadata +30 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3711d1d33d9aeb118b9c891443d0e2ecf4973db242797f15d7628f3a157c0f8
|
4
|
+
data.tar.gz: b63e5dfd3a85fb3b234b0ae6d0afd8b1b2386eba3a2977788298e2cbf7ce79c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ec2c83d25ca5e1cd72cc1045a5a6ed8f299dbdf3de2729344eac833a37351dd16a71d14b73679b441b7263e2992a577c618b3143484c8bfac262fd41697fbe5
|
7
|
+
data.tar.gz: 2de29dd3f708a25ef53e2c61aa86f40684d8ae2aac6cd875e931cd1e0cc0ed8e972439e75c8731e570b7fd7aa1a3884f5c341afe2a29fef40a37bc542ae60c15
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,25 @@
|
|
1
1
|
# Mindee Ruby API Library Changelog
|
2
2
|
|
3
|
+
## v3.5.0 - 2024-02-16
|
4
|
+
### Changes
|
5
|
+
* :sparkles: add support for Generated V1 API
|
6
|
+
* :recycle: documents now aren't automatically converted to b64 when enqueued as non-PDF files
|
7
|
+
* :recycle: increase max async delay to 60 tries
|
8
|
+
* :sparkles: add support for FR bank statements
|
9
|
+
* :sparkles: add support for International ID V2
|
10
|
+
* :sparkles: add support for EU Driver License V1
|
11
|
+
* :recycle: update existing products
|
12
|
+
* :arrow_up: upgrade test lib
|
13
|
+
|
14
|
+
### Fixes
|
15
|
+
* :memo: add missing default async sample code
|
16
|
+
* :bug: fix rst display issues
|
17
|
+
* :bug: fix display issues for single page models
|
18
|
+
* :bug: fix miscellaneous issues related to data display (no changes expected on existing models)
|
19
|
+
* :bug: fix CLI breaking for custom products
|
20
|
+
* :bug: fix encoding issue that prevented UNICODE file names from being properly sent to the server
|
21
|
+
|
22
|
+
|
3
23
|
## v3.4.0 - 2024-01-30
|
4
24
|
### Changes
|
5
25
|
* :arrow_up: update invoices to v4.4
|
data/README.md
CHANGED
@@ -135,13 +135,17 @@ customize the experience.
|
|
135
135
|
|
136
136
|
* [Ruby Overview](https://developers.mindee.com/docs/getting-started-ocr-ruby)
|
137
137
|
* [Custom OCR Ruby](https://developers.mindee.com/docs/api-builder-ocr-ruby)
|
138
|
+
* [Generated API Ruby](https://developers.mindee.com/docs/generated-api-ruby)
|
138
139
|
* [Invoice OCR Ruby](https://developers.mindee.com/docs/invoice-ocr-ruby)
|
140
|
+
* [International Id OCR Ruby](https://developers.mindee.com/docs/international-id-ocr-ruby)
|
139
141
|
* [Financial Document OCR Ruby](https://developers.mindee.com/docs/financial-document-ocr-ruby)
|
140
142
|
* [Passport OCR Ruby](https://developers.mindee.com/docs/passport-ocr-ruby)
|
141
143
|
* [Proof of Address OCR Ruby](https://developers.mindee.com/docs/proof-of-address-ocr-ruby)
|
142
144
|
* [Receipt OCR Ruby](https://developers.mindee.com/docs/receipt-ocr-ruby)
|
143
145
|
* [EU License Plate OCR Ruby](https://developers.mindee.com/docs/eu-license-plate-ocr-ruby)
|
146
|
+
* [EU Driver License OCR Ruby](https://developers.mindee.com/docs/eu-driver-license-ocr-ruby)
|
144
147
|
* [FR Bank Account Details OCR Ruby](https://developers.mindee.com/docs/fr-bank-account-details-ocr-ruby)
|
148
|
+
* [FR Bank Statement OCR Ruby](https://developers.mindee.com/docs/fr-bank-statement-ocr-ruby)
|
145
149
|
* [FR Carte Vitale OCR Ruby](https://developers.mindee.com/docs/fr-carte-vitale-ocr-ruby)
|
146
150
|
* [FR ID Card OCR Ruby](https://developers.mindee.com/docs/fr-id-card-ocr-ruby)
|
147
151
|
* [US Bank Check OCR Ruby](https://developers.mindee.com/docs/us-bank-check-ocr-ruby)
|
data/bin/mindee.rb
CHANGED
@@ -5,6 +5,7 @@ require 'bundler/setup'
|
|
5
5
|
require 'optparse'
|
6
6
|
require 'mindee'
|
7
7
|
|
8
|
+
options = {}
|
8
9
|
DOCUMENTS = {
|
9
10
|
"custom" => {
|
10
11
|
description: "Custom document type from API builder",
|
@@ -12,6 +13,12 @@ DOCUMENTS = {
|
|
12
13
|
sync: true,
|
13
14
|
async: false,
|
14
15
|
},
|
16
|
+
"generated" => {
|
17
|
+
description: "Generated document type from API builder",
|
18
|
+
doc_class: Mindee::Product::Generated::GeneratedV1,
|
19
|
+
sync: true,
|
20
|
+
async: true,
|
21
|
+
},
|
15
22
|
"proof-of-address" => {
|
16
23
|
description: 'Proof of Address',
|
17
24
|
doc_class: Mindee::Product::ProofOfAddress::ProofOfAddressV1,
|
@@ -36,6 +43,12 @@ DOCUMENTS = {
|
|
36
43
|
sync: true,
|
37
44
|
async: false,
|
38
45
|
},
|
46
|
+
"international-id" => {
|
47
|
+
description: 'International Id',
|
48
|
+
doc_class: Mindee::Product::InternationalId::InternationalIdV2,
|
49
|
+
sync: false,
|
50
|
+
async: true,
|
51
|
+
},
|
39
52
|
"receipt" => {
|
40
53
|
description: "Expense Receipt",
|
41
54
|
doc_class: Mindee::Product::Receipt::ReceiptV5,
|
@@ -54,12 +67,24 @@ DOCUMENTS = {
|
|
54
67
|
sync: true,
|
55
68
|
async: false,
|
56
69
|
},
|
70
|
+
"eu-driver-license" => {
|
71
|
+
description: "EU Driver License",
|
72
|
+
doc_class: Mindee::Product::EU::DriverLicense::DriverLicenseV1,
|
73
|
+
sync: true,
|
74
|
+
async: false,
|
75
|
+
},
|
57
76
|
"fr-bank-account-details" => {
|
58
77
|
description: "FR Bank Account Details",
|
59
78
|
doc_class: Mindee::Product::FR::BankAccountDetails::BankAccountDetailsV2,
|
60
79
|
sync: true,
|
61
80
|
async: false,
|
62
81
|
},
|
82
|
+
"fr-bank-statement" => {
|
83
|
+
description: "FR Bank Statement",
|
84
|
+
doc_class: Mindee::Product::FR::BankStatement::BankStatementV1,
|
85
|
+
sync: false,
|
86
|
+
async: true,
|
87
|
+
},
|
63
88
|
"fr-carte-vitale" => {
|
64
89
|
description: "FR Carte Vitale",
|
65
90
|
doc_class: Mindee::Product::FR::CarteVitale::CarteVitaleV1,
|
@@ -105,11 +130,11 @@ DEFAULT_CUTTING = {
|
|
105
130
|
on_min_pages: 0,
|
106
131
|
}
|
107
132
|
|
108
|
-
# Initializes custom-specific options
|
133
|
+
# Initializes custom & generated-specific options
|
109
134
|
# @param cli_parser [OptionParser]
|
110
|
-
def custom_subcommand(cli_parser)
|
135
|
+
def custom_subcommand(cli_parser, options)
|
111
136
|
cli_parser.on('-v [VERSION]', '--version [VERSION]', 'Model version for the API') do |v|
|
112
|
-
options[:
|
137
|
+
options[:endpoint_version] = v
|
113
138
|
end
|
114
139
|
cli_parser.on('-a ACCOUNT_NAME', '--account ACCOUNT_NAME', 'API account name for the endpoint') do |v|
|
115
140
|
options[:account_name] = v
|
@@ -118,7 +143,7 @@ end
|
|
118
143
|
|
119
144
|
product_parser = {}
|
120
145
|
DOCUMENTS.each do |doc_key, doc_value|
|
121
|
-
product_parser[doc_key] = OptionParser.new do |
|
146
|
+
product_parser[doc_key] = OptionParser.new do |opts|
|
122
147
|
opts.on('-w', '--all-words', 'Include words in response') do |v|
|
123
148
|
options[:all_words] = v
|
124
149
|
end
|
@@ -134,11 +159,11 @@ DOCUMENTS.each do |doc_key, doc_value|
|
|
134
159
|
opts.on('-F', '--fix-pdf', "Attempts to fix broken PDF files before sending them to the server.") do |v|
|
135
160
|
options[:fix_pdf] = true
|
136
161
|
end
|
137
|
-
if (doc_key != 'custom')
|
162
|
+
if (doc_key != 'custom' && doc_key != 'generated')
|
138
163
|
opts.banner = "Product: #{doc_value[:description]}. \nUsage: mindee.rb #{doc_key} [options] file"
|
139
164
|
else
|
140
|
-
opts.banner = "#{doc_value[:description]}. \nUsage:
|
141
|
-
custom_subcommand(opts)
|
165
|
+
opts.banner = "#{doc_value[:description]}. \nUsage: \nmindee.rb custom [options] endpoint_name file\nor\nmindee.rb generated [options] endpoint_name file"
|
166
|
+
custom_subcommand(opts, options)
|
142
167
|
end
|
143
168
|
if doc_value[:async]
|
144
169
|
if doc_value[:sync]
|
@@ -150,7 +175,7 @@ DOCUMENTS.each do |doc_key, doc_value|
|
|
150
175
|
end
|
151
176
|
end
|
152
177
|
|
153
|
-
global_parser = OptionParser.new do |
|
178
|
+
global_parser = OptionParser.new do |opts|
|
154
179
|
opts.banner = "Usage: mindee.rb product [options] file"
|
155
180
|
opts.separator "Available products:"
|
156
181
|
opts.separator " #{DOCUMENTS.keys.join("\n ")}"
|
@@ -163,9 +188,9 @@ end
|
|
163
188
|
doc_class = DOCUMENTS[command][:doc_class]
|
164
189
|
product_parser[command].parse!
|
165
190
|
|
166
|
-
if command == 'custom'
|
191
|
+
if command == 'custom' || command == 'generated'
|
167
192
|
if ARGV.length < 2
|
168
|
-
$stderr.puts "The '
|
193
|
+
$stderr.puts "The '#{command}' command requires both ENDPOINT_NAME and file arguments."
|
169
194
|
abort(product_parser[command].help)
|
170
195
|
end
|
171
196
|
endpoint_name = ARGV[0]
|
@@ -186,12 +211,11 @@ else
|
|
186
211
|
input_source = mindee_client.source_from_path(options[:file_path], fix_pdf: options[:fix_pdf])
|
187
212
|
end
|
188
213
|
|
189
|
-
if command == 'custom'
|
190
|
-
endpoint_name = 'endpoint_name'
|
214
|
+
if command == 'custom' || command == 'generated'
|
191
215
|
custom_endpoint = mindee_client.create_endpoint(
|
192
|
-
|
193
|
-
|
194
|
-
|
216
|
+
endpoint_name: endpoint_name,
|
217
|
+
account_name: options[:account_name],
|
218
|
+
version: options[:endpoint_version].nil? ? "1" : options[:endpoint_version]
|
195
219
|
)
|
196
220
|
else
|
197
221
|
custom_endpoint = nil
|
@@ -0,0 +1,175 @@
|
|
1
|
+
---
|
2
|
+
title: FR Bank Statement (FR) OCR Ruby
|
3
|
+
---
|
4
|
+
The Ruby OCR SDK supports the [Bank Statement (FR) API](https://platform.mindee.com/mindee/bank_statement_fr).
|
5
|
+
|
6
|
+
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/bank_statement_fr/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
|
7
|
+

|
8
|
+
|
9
|
+
# Quick-Start
|
10
|
+
```rb
|
11
|
+
require 'mindee'
|
12
|
+
|
13
|
+
# Init a new client
|
14
|
+
mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
15
|
+
|
16
|
+
# Load a file from disk
|
17
|
+
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
18
|
+
|
19
|
+
# Parse the file
|
20
|
+
result = mindee_client.enqueue_and_parse(
|
21
|
+
input_source,
|
22
|
+
Mindee::Product::FR::BankStatement::BankStatementV1
|
23
|
+
)
|
24
|
+
|
25
|
+
# Print a full summary of the parsed data in RST format
|
26
|
+
puts result.document
|
27
|
+
|
28
|
+
# Print the document-level parsed data
|
29
|
+
# puts result.document.inference.prediction
|
30
|
+
```
|
31
|
+
|
32
|
+
**Output (RST):**
|
33
|
+
```rst
|
34
|
+
```
|
35
|
+
|
36
|
+
# Field Types
|
37
|
+
## Standard Fields
|
38
|
+
These fields are generic and used in several products.
|
39
|
+
|
40
|
+
### Basic Field
|
41
|
+
Each prediction object contains a set of fields that inherit from the generic `Field` class.
|
42
|
+
A typical `Field` object will have the following attributes:
|
43
|
+
|
44
|
+
* **value** (`String`, `Float`, `Integer`, `Boolean`): corresponds to the field value. Can be `nil` if no value was extracted.
|
45
|
+
* **confidence** (Float, nil): the confidence score of the field prediction.
|
46
|
+
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
47
|
+
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
48
|
+
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
49
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
50
|
+
|
51
|
+
|
52
|
+
Aside from the previous attributes, all basic fields have access to a `to_s` method that can be used to print their value as a string.
|
53
|
+
|
54
|
+
|
55
|
+
### Amount Field
|
56
|
+
The amount field `AmountField` only has one constraint: its **value** is a `Float` (or `nil`).
|
57
|
+
|
58
|
+
### Date Field
|
59
|
+
Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
|
60
|
+
|
61
|
+
* **date_object** (`Date`): an accessible representation of the value as a JavaScript object.
|
62
|
+
|
63
|
+
### String Field
|
64
|
+
The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
|
65
|
+
|
66
|
+
## Specific Fields
|
67
|
+
Fields which are specific to this product; they are not used in any other product.
|
68
|
+
|
69
|
+
### Transactions Field
|
70
|
+
The list of values that represent the financial transactions recorded in a bank statement.
|
71
|
+
|
72
|
+
A `BankStatementV1Transaction` implements the following attributes:
|
73
|
+
|
74
|
+
* `amount` (Float): The monetary amount of the transaction.
|
75
|
+
* `date` (String): The date on which the transaction occurred.
|
76
|
+
* `description` (String): The additional information about the transaction.
|
77
|
+
|
78
|
+
# Attributes
|
79
|
+
The following fields are extracted for Bank Statement (FR) V1:
|
80
|
+
|
81
|
+
## Account Number
|
82
|
+
**account_number** ([StringField](#string-field)): The unique identifier for a customer's account in the bank's system.
|
83
|
+
|
84
|
+
```rb
|
85
|
+
puts result.document.inference.prediction.account_number.value
|
86
|
+
```
|
87
|
+
|
88
|
+
## Bank Address
|
89
|
+
**bank_address** ([StringField](#string-field)): The physical location of the bank where the statement was issued.
|
90
|
+
|
91
|
+
```rb
|
92
|
+
puts result.document.inference.prediction.bank_address.value
|
93
|
+
```
|
94
|
+
|
95
|
+
## Bank Name
|
96
|
+
**bank_name** ([StringField](#string-field)): The name of the bank that issued the statement.
|
97
|
+
|
98
|
+
```rb
|
99
|
+
puts result.document.inference.prediction.bank_name.value
|
100
|
+
```
|
101
|
+
|
102
|
+
## Client Address
|
103
|
+
**client_address** ([StringField](#string-field)): The address of the client associated with the bank statement.
|
104
|
+
|
105
|
+
```rb
|
106
|
+
puts result.document.inference.prediction.client_address.value
|
107
|
+
```
|
108
|
+
|
109
|
+
## Client Name
|
110
|
+
**client_name** ([StringField](#string-field)): The name of the client who owns the bank statement.
|
111
|
+
|
112
|
+
```rb
|
113
|
+
puts result.document.inference.prediction.client_name.value
|
114
|
+
```
|
115
|
+
|
116
|
+
## Closing Balance
|
117
|
+
**closing_balance** ([AmountField](#amount-field)): The final amount of money in the account at the end of the statement period.
|
118
|
+
|
119
|
+
```rb
|
120
|
+
puts result.document.inference.prediction.closing_balance.value
|
121
|
+
```
|
122
|
+
|
123
|
+
## Opening Balance
|
124
|
+
**opening_balance** ([AmountField](#amount-field)): The initial amount of money in an account at the start of the period.
|
125
|
+
|
126
|
+
```rb
|
127
|
+
puts result.document.inference.prediction.opening_balance.value
|
128
|
+
```
|
129
|
+
|
130
|
+
## Statement Date
|
131
|
+
**statement_date** ([DateField](#date-field)): The date on which the bank statement was generated.
|
132
|
+
|
133
|
+
```rb
|
134
|
+
puts result.document.inference.prediction.statement_date.value
|
135
|
+
```
|
136
|
+
|
137
|
+
## Statement End Date
|
138
|
+
**statement_end_date** ([DateField](#date-field)): The date when the statement period ends.
|
139
|
+
|
140
|
+
```rb
|
141
|
+
puts result.document.inference.prediction.statement_end_date.value
|
142
|
+
```
|
143
|
+
|
144
|
+
## Statement Start Date
|
145
|
+
**statement_start_date** ([DateField](#date-field)): The date when the bank statement period begins.
|
146
|
+
|
147
|
+
```rb
|
148
|
+
puts result.document.inference.prediction.statement_start_date.value
|
149
|
+
```
|
150
|
+
|
151
|
+
## Total Credits
|
152
|
+
**total_credits** ([AmountField](#amount-field)): The total amount of money deposited into the account.
|
153
|
+
|
154
|
+
```rb
|
155
|
+
puts result.document.inference.prediction.total_credits.value
|
156
|
+
```
|
157
|
+
|
158
|
+
## Total Debits
|
159
|
+
**total_debits** ([AmountField](#amount-field)): The total amount of money debited from the account.
|
160
|
+
|
161
|
+
```rb
|
162
|
+
puts result.document.inference.prediction.total_debits.value
|
163
|
+
```
|
164
|
+
|
165
|
+
## Transactions
|
166
|
+
**transactions** (Array<[BankStatementV1Transaction](#transactions-field)>): The list of values that represent the financial transactions recorded in a bank statement.
|
167
|
+
|
168
|
+
```rb
|
169
|
+
for transactions_elem in result.document.inference.prediction.transactions do
|
170
|
+
puts transactions_elem.value
|
171
|
+
end
|
172
|
+
```
|
173
|
+
|
174
|
+
# Questions?
|
175
|
+
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
|
data/docs/carte_grise_v1.md
CHANGED
@@ -34,12 +34,12 @@ puts result.document
|
|
34
34
|
########
|
35
35
|
Document
|
36
36
|
########
|
37
|
-
:Mindee ID:
|
37
|
+
:Mindee ID: 4443182b-57c1-4426-a288-01b94f226e84
|
38
38
|
:Filename: default_sample.jpg
|
39
39
|
|
40
40
|
Inference
|
41
41
|
#########
|
42
|
-
:Product: mindee/carte_grise v1.
|
42
|
+
:Product: mindee/carte_grise v1.1
|
43
43
|
:Rotation applied: Yes
|
44
44
|
|
45
45
|
Prediction
|
@@ -67,14 +67,14 @@ Prediction
|
|
67
67
|
:p2: 90
|
68
68
|
:p3: GO
|
69
69
|
:p6: 6
|
70
|
-
:q:
|
70
|
+
:q: 006
|
71
71
|
:s1: 5
|
72
72
|
:s2:
|
73
73
|
:u1: 77
|
74
74
|
:u2: 3000
|
75
75
|
:v7: 155
|
76
76
|
:x1: 2011-07-06
|
77
|
-
:y1:
|
77
|
+
:y1: 17835
|
78
78
|
:y2:
|
79
79
|
:y3: 0
|
80
80
|
:y4: 4
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'mindee'
|
2
|
+
|
3
|
+
# Init a new client
|
4
|
+
mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
5
|
+
|
6
|
+
# Load a file from disk
|
7
|
+
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
8
|
+
|
9
|
+
# Parse the file
|
10
|
+
result = mindee_client.enqueue_and_parse(
|
11
|
+
input_source,
|
12
|
+
Mindee::Product::FR::BankStatement::BankStatementV1
|
13
|
+
)
|
14
|
+
|
15
|
+
# Print a full summary of the parsed data in RST format
|
16
|
+
puts result.document
|
17
|
+
|
18
|
+
# Print the document-level parsed data
|
19
|
+
# puts result.document.inference.prediction
|
@@ -1,24 +1,24 @@
|
|
1
|
-
require '
|
2
|
-
require 'net/http'
|
3
|
-
require 'net/https'
|
1
|
+
require 'mindee'
|
4
2
|
|
5
|
-
|
6
|
-
|
7
|
-
endpoint = "my-endpoint"
|
8
|
-
version = "my-version"
|
3
|
+
# Init a new client
|
4
|
+
mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
9
5
|
|
10
|
-
|
11
|
-
|
6
|
+
# Load a file from disk
|
7
|
+
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
12
8
|
|
13
|
-
|
14
|
-
|
9
|
+
# Initialize a custom endpoint for this product
|
10
|
+
custom_endpoint = mindee_client.create_endpoint(
|
11
|
+
account_name: 'my-account',
|
12
|
+
endpoint_name: 'my-endpoint',
|
13
|
+
version: 'my-version'
|
14
|
+
)
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
# Parse the file
|
17
|
+
result = mindee_client.parse(
|
18
|
+
input_source,
|
19
|
+
Mindee::Product::Generated::GeneratedV1,
|
20
|
+
endpoint: custom_endpoint
|
21
|
+
)
|
19
22
|
|
20
|
-
|
21
|
-
|
22
|
-
raise response.msg
|
23
|
-
end
|
24
|
-
puts response.read_body
|
23
|
+
# Print a full summary of the parsed data in RST format
|
24
|
+
puts result.document
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'mindee'
|
2
|
+
|
3
|
+
# Init a new client
|
4
|
+
mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
5
|
+
|
6
|
+
# Load a file from disk
|
7
|
+
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
8
|
+
|
9
|
+
# Initialize a custom endpoint for this product
|
10
|
+
custom_endpoint = mindee_client.create_endpoint(
|
11
|
+
account_name: 'my-account',
|
12
|
+
endpoint_name: 'my-endpoint',
|
13
|
+
version: 'my-version'
|
14
|
+
)
|
15
|
+
|
16
|
+
# Parse the file
|
17
|
+
result = mindee_client.enqueue_and_parse(
|
18
|
+
input_source,
|
19
|
+
Mindee::Product::Generated::GeneratedV1,
|
20
|
+
endpoint: custom_endpoint
|
21
|
+
)
|
22
|
+
|
23
|
+
# Print a full summary of the parsed data in RST format
|
24
|
+
puts result.document
|
25
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'mindee'
|
2
|
+
|
3
|
+
# Init a new client
|
4
|
+
mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
5
|
+
|
6
|
+
# Load a file from disk
|
7
|
+
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
8
|
+
|
9
|
+
# Parse the file
|
10
|
+
result = mindee_client.parse(
|
11
|
+
input_source,
|
12
|
+
Mindee::Product::EU::DriverLicense::DriverLicenseV1
|
13
|
+
)
|
14
|
+
|
15
|
+
# Print a full summary of the parsed data in RST format
|
16
|
+
puts result.document
|
17
|
+
|
18
|
+
# Print the document-level parsed data
|
19
|
+
# puts result.document.inference.prediction
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'mindee'
|
2
|
+
|
3
|
+
# Init a new client
|
4
|
+
mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
5
|
+
|
6
|
+
# Load a file from disk
|
7
|
+
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
8
|
+
|
9
|
+
# Parse the file
|
10
|
+
result = mindee_client.enqueue_and_parse(
|
11
|
+
input_source,
|
12
|
+
Mindee::Product::InternationalId::InternationalIdV1
|
13
|
+
)
|
14
|
+
|
15
|
+
# Print a full summary of the parsed data in RST format
|
16
|
+
puts result.document
|
17
|
+
|
18
|
+
# Print the document-level parsed data
|
19
|
+
# puts result.document.inference.prediction
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'mindee'
|
2
|
+
|
3
|
+
# Init a new client
|
4
|
+
mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
5
|
+
|
6
|
+
# Load a file from disk
|
7
|
+
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
8
|
+
|
9
|
+
# Parse the file
|
10
|
+
result = mindee_client.enqueue_and_parse(
|
11
|
+
input_source,
|
12
|
+
Mindee::Product::InternationalId::InternationalIdV2
|
13
|
+
)
|
14
|
+
|
15
|
+
# Print a full summary of the parsed data in RST format
|
16
|
+
puts result.document
|
17
|
+
|
18
|
+
# Print the document-level parsed data
|
19
|
+
# puts result.document.inference.prediction
|