mindee 3.4.0 → 3.6.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 +25 -0
- data/README.md +6 -1
- data/bin/mindee.rb +45 -15
- data/docs/bank_account_details_v2.md +1 -1
- data/docs/bank_check_v1.md +1 -1
- data/docs/bank_statement_fr_v1.md +175 -0
- data/docs/barcode_reader_v1.md +1 -1
- data/docs/carte_grise_v1.md +5 -5
- data/docs/carte_vitale_v1.md +1 -1
- 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/code_samples/resume_v1_async.txt +19 -0
- data/docs/cropper_v1.md +1 -1
- data/docs/custom_v1.md +1 -1
- data/docs/eu_driver_license_v1.md +223 -0
- data/docs/expense_receipts_v5.md +1 -1
- data/docs/financial_document_v1.md +49 -41
- data/docs/generated_v1.md +90 -0
- data/docs/getting_started.md +1 -1
- data/docs/idcard_fr_v2.md +1 -1
- data/docs/international_id_v2.md +195 -0
- data/docs/invoice_splitter_v1.md +1 -1
- data/docs/invoices_v4.md +5 -2
- data/docs/license_plates_v1.md +1 -1
- data/docs/multi_receipts_detector_v1.md +1 -1
- data/docs/passport_v1.md +1 -1
- data/docs/proof_of_address_v1.md +5 -5
- data/docs/resume_v1.md +334 -0
- data/docs/us_driver_license_v1.md +3 -3
- data/docs/us_w9_v1.md +1 -1
- 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/standard/base_field.rb +1 -1
- data/lib/mindee/parsing.rb +1 -0
- data/lib/mindee/product/.rubocop.yml +7 -2
- 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_grise/carte_grise_v1_document.rb +0 -2
- 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/resume/resume_v1.rb +39 -0
- data/lib/mindee/product/resume/resume_v1_certificate.rb +69 -0
- data/lib/mindee/product/resume/resume_v1_document.rb +322 -0
- data/lib/mindee/product/resume/resume_v1_education.rb +90 -0
- data/lib/mindee/product/resume/resume_v1_language.rb +55 -0
- data/lib/mindee/product/resume/resume_v1_page.rb +32 -0
- data/lib/mindee/product/resume/resume_v1_professional_experience.rb +97 -0
- data/lib/mindee/product/resume/resume_v1_social_networks_url.rb +55 -0
- 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 +6 -0
- data/lib/mindee/version.rb +1 -1
- data/lib/mindee.rb +4 -0
- metadata +41 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 28d1e6c48c575030a3c6519080f7cff23b52745c212d8db9cc43f8c800c1c3d8
|
|
4
|
+
data.tar.gz: a96015beeeac1378f72f77bd3bcb73c3032e0946e39cc7a4519b5db3eca3e8c4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2ca08ce6349eb1ebeaf7cf2bbba6004ff638cfc0db480d7b41bf183f6f6a4066bd1a76a36edbf4282eb65f31c89487cad388cc1f2ea6bfa2bb6bed7ff6c6e517
|
|
7
|
+
data.tar.gz: e18f1c1f8190c73987b036745fba0e6dca91b98ee71bc6144d8f1612be4c497cbb5f0301951b91db494c4812ca07ef6ec86fdeee17bdb3e83aacaef481b2fb3f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Mindee Ruby API Library Changelog
|
|
2
2
|
|
|
3
|
+
## v3.6.0 - 2024-02-21
|
|
4
|
+
### Changes
|
|
5
|
+
* :sparkles: add support for resume V1
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## v3.5.0 - 2024-02-16
|
|
9
|
+
### Changes
|
|
10
|
+
* :sparkles: add support for Generated V1 API
|
|
11
|
+
* :recycle: documents now aren't automatically converted to b64 when enqueued as non-PDF files
|
|
12
|
+
* :recycle: increase max async delay to 60 tries
|
|
13
|
+
* :sparkles: add support for FR bank statements
|
|
14
|
+
* :sparkles: add support for International ID V2
|
|
15
|
+
* :sparkles: add support for EU Driver License V1
|
|
16
|
+
* :recycle: update existing products
|
|
17
|
+
* :arrow_up: upgrade test lib
|
|
18
|
+
|
|
19
|
+
### Fixes
|
|
20
|
+
* :memo: add missing default async sample code
|
|
21
|
+
* :bug: fix rst display issues
|
|
22
|
+
* :bug: fix display issues for single page models
|
|
23
|
+
* :bug: fix miscellaneous issues related to data display (no changes expected on existing models)
|
|
24
|
+
* :bug: fix CLI breaking for custom products
|
|
25
|
+
* :bug: fix encoding issue that prevented UNICODE file names from being properly sent to the server
|
|
26
|
+
|
|
27
|
+
|
|
3
28
|
## v3.4.0 - 2024-01-30
|
|
4
29
|
### Changes
|
|
5
30
|
* :arrow_up: update invoices to v4.4
|
data/README.md
CHANGED
|
@@ -135,13 +135,18 @@ 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)
|
|
145
|
+
* [Resume OCR Ruby](https://developers.mindee.com/docs/resume-ocr-ruby)
|
|
143
146
|
* [EU License Plate OCR Ruby](https://developers.mindee.com/docs/eu-license-plate-ocr-ruby)
|
|
147
|
+
* [EU Driver License OCR Ruby](https://developers.mindee.com/docs/eu-driver-license-ocr-ruby)
|
|
144
148
|
* [FR Bank Account Details OCR Ruby](https://developers.mindee.com/docs/fr-bank-account-details-ocr-ruby)
|
|
149
|
+
* [FR Bank Statement OCR Ruby](https://developers.mindee.com/docs/fr-bank-statement-ocr-ruby)
|
|
145
150
|
* [FR Carte Vitale OCR Ruby](https://developers.mindee.com/docs/fr-carte-vitale-ocr-ruby)
|
|
146
151
|
* [FR ID Card OCR Ruby](https://developers.mindee.com/docs/fr-id-card-ocr-ruby)
|
|
147
152
|
* [US Bank Check OCR Ruby](https://developers.mindee.com/docs/us-bank-check-ocr-ruby)
|
|
@@ -163,4 +168,4 @@ Copyright © Mindee, SA
|
|
|
163
168
|
Available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
164
169
|
|
|
165
170
|
## Questions?
|
|
166
|
-
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-
|
|
171
|
+
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
|
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,12 +43,24 @@ 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,
|
|
42
55
|
sync: true,
|
|
43
56
|
async: false,
|
|
44
57
|
},
|
|
58
|
+
"resume" => {
|
|
59
|
+
description: "Resume",
|
|
60
|
+
doc_class: Mindee::Product::Resume::ResumeV1,
|
|
61
|
+
sync: false,
|
|
62
|
+
async: true,
|
|
63
|
+
},
|
|
45
64
|
"passport" => {
|
|
46
65
|
description: "Passport",
|
|
47
66
|
doc_class: Mindee::Product::Passport::PassportV1,
|
|
@@ -54,12 +73,24 @@ DOCUMENTS = {
|
|
|
54
73
|
sync: true,
|
|
55
74
|
async: false,
|
|
56
75
|
},
|
|
76
|
+
"eu-driver-license" => {
|
|
77
|
+
description: "EU Driver License",
|
|
78
|
+
doc_class: Mindee::Product::EU::DriverLicense::DriverLicenseV1,
|
|
79
|
+
sync: true,
|
|
80
|
+
async: false,
|
|
81
|
+
},
|
|
57
82
|
"fr-bank-account-details" => {
|
|
58
83
|
description: "FR Bank Account Details",
|
|
59
84
|
doc_class: Mindee::Product::FR::BankAccountDetails::BankAccountDetailsV2,
|
|
60
85
|
sync: true,
|
|
61
86
|
async: false,
|
|
62
87
|
},
|
|
88
|
+
"fr-bank-statement" => {
|
|
89
|
+
description: "FR Bank Statement",
|
|
90
|
+
doc_class: Mindee::Product::FR::BankStatement::BankStatementV1,
|
|
91
|
+
sync: false,
|
|
92
|
+
async: true,
|
|
93
|
+
},
|
|
63
94
|
"fr-carte-vitale" => {
|
|
64
95
|
description: "FR Carte Vitale",
|
|
65
96
|
doc_class: Mindee::Product::FR::CarteVitale::CarteVitaleV1,
|
|
@@ -105,11 +136,11 @@ DEFAULT_CUTTING = {
|
|
|
105
136
|
on_min_pages: 0,
|
|
106
137
|
}
|
|
107
138
|
|
|
108
|
-
# Initializes custom-specific options
|
|
139
|
+
# Initializes custom & generated-specific options
|
|
109
140
|
# @param cli_parser [OptionParser]
|
|
110
|
-
def custom_subcommand(cli_parser)
|
|
141
|
+
def custom_subcommand(cli_parser, options)
|
|
111
142
|
cli_parser.on('-v [VERSION]', '--version [VERSION]', 'Model version for the API') do |v|
|
|
112
|
-
options[:
|
|
143
|
+
options[:endpoint_version] = v
|
|
113
144
|
end
|
|
114
145
|
cli_parser.on('-a ACCOUNT_NAME', '--account ACCOUNT_NAME', 'API account name for the endpoint') do |v|
|
|
115
146
|
options[:account_name] = v
|
|
@@ -118,7 +149,7 @@ end
|
|
|
118
149
|
|
|
119
150
|
product_parser = {}
|
|
120
151
|
DOCUMENTS.each do |doc_key, doc_value|
|
|
121
|
-
product_parser[doc_key] = OptionParser.new do |
|
|
152
|
+
product_parser[doc_key] = OptionParser.new do |opts|
|
|
122
153
|
opts.on('-w', '--all-words', 'Include words in response') do |v|
|
|
123
154
|
options[:all_words] = v
|
|
124
155
|
end
|
|
@@ -134,11 +165,11 @@ DOCUMENTS.each do |doc_key, doc_value|
|
|
|
134
165
|
opts.on('-F', '--fix-pdf', "Attempts to fix broken PDF files before sending them to the server.") do |v|
|
|
135
166
|
options[:fix_pdf] = true
|
|
136
167
|
end
|
|
137
|
-
if (doc_key != 'custom')
|
|
168
|
+
if (doc_key != 'custom' && doc_key != 'generated')
|
|
138
169
|
opts.banner = "Product: #{doc_value[:description]}. \nUsage: mindee.rb #{doc_key} [options] file"
|
|
139
170
|
else
|
|
140
|
-
opts.banner = "#{doc_value[:description]}. \nUsage:
|
|
141
|
-
custom_subcommand(opts)
|
|
171
|
+
opts.banner = "#{doc_value[:description]}. \nUsage: \nmindee.rb custom [options] endpoint_name file\nor\nmindee.rb generated [options] endpoint_name file"
|
|
172
|
+
custom_subcommand(opts, options)
|
|
142
173
|
end
|
|
143
174
|
if doc_value[:async]
|
|
144
175
|
if doc_value[:sync]
|
|
@@ -150,7 +181,7 @@ DOCUMENTS.each do |doc_key, doc_value|
|
|
|
150
181
|
end
|
|
151
182
|
end
|
|
152
183
|
|
|
153
|
-
global_parser = OptionParser.new do |
|
|
184
|
+
global_parser = OptionParser.new do |opts|
|
|
154
185
|
opts.banner = "Usage: mindee.rb product [options] file"
|
|
155
186
|
opts.separator "Available products:"
|
|
156
187
|
opts.separator " #{DOCUMENTS.keys.join("\n ")}"
|
|
@@ -163,9 +194,9 @@ end
|
|
|
163
194
|
doc_class = DOCUMENTS[command][:doc_class]
|
|
164
195
|
product_parser[command].parse!
|
|
165
196
|
|
|
166
|
-
if command == 'custom'
|
|
197
|
+
if command == 'custom' || command == 'generated'
|
|
167
198
|
if ARGV.length < 2
|
|
168
|
-
$stderr.puts "The '
|
|
199
|
+
$stderr.puts "The '#{command}' command requires both ENDPOINT_NAME and file arguments."
|
|
169
200
|
abort(product_parser[command].help)
|
|
170
201
|
end
|
|
171
202
|
endpoint_name = ARGV[0]
|
|
@@ -186,12 +217,11 @@ else
|
|
|
186
217
|
input_source = mindee_client.source_from_path(options[:file_path], fix_pdf: options[:fix_pdf])
|
|
187
218
|
end
|
|
188
219
|
|
|
189
|
-
if command == 'custom'
|
|
190
|
-
endpoint_name = 'endpoint_name'
|
|
220
|
+
if command == 'custom' || command == 'generated'
|
|
191
221
|
custom_endpoint = mindee_client.create_endpoint(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
222
|
+
endpoint_name: endpoint_name,
|
|
223
|
+
account_name: options[:account_name],
|
|
224
|
+
version: options[:endpoint_version].nil? ? "1" : options[:endpoint_version]
|
|
195
225
|
)
|
|
196
226
|
else
|
|
197
227
|
custom_endpoint = nil
|
|
@@ -134,4 +134,4 @@ puts result.document.inference.prediction.swift_code.value
|
|
|
134
134
|
```
|
|
135
135
|
|
|
136
136
|
# Questions?
|
|
137
|
-
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-
|
|
137
|
+
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
|
data/docs/bank_check_v1.md
CHANGED
|
@@ -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-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
|
data/docs/barcode_reader_v1.md
CHANGED
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
|
|
@@ -451,4 +451,4 @@ puts result.document.inference.prediction.y6.value
|
|
|
451
451
|
```
|
|
452
452
|
|
|
453
453
|
# Questions?
|
|
454
|
-
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-
|
|
454
|
+
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
|
data/docs/carte_vitale_v1.md
CHANGED
|
@@ -120,4 +120,4 @@ puts result.document.inference.prediction.surname.value
|
|
|
120
120
|
```
|
|
121
121
|
|
|
122
122
|
# Questions?
|
|
123
|
-
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-
|
|
123
|
+
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
|
|
@@ -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
|
|
@@ -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::Resume::ResumeV1
|
|
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
|
data/docs/cropper_v1.md
CHANGED
data/docs/custom_v1.md
CHANGED
|
@@ -106,4 +106,4 @@ console.log(result.document.inference.prediction.classifications["my-classificat
|
|
|
106
106
|
|
|
107
107
|
# Questions?
|
|
108
108
|
|
|
109
|
-
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-
|
|
109
|
+
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
|