mindee 3.12.0 → 3.13.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/.rubocop.yml +1 -1
- data/CHANGELOG.md +18 -0
- data/README.md +23 -23
- data/Rakefile +5 -0
- data/docs/bank_account_details_v2.md +5 -1
- data/docs/bank_check_v1.md +6 -2
- data/docs/bank_statement_fr_v1.md +3 -0
- data/docs/barcode_reader_v1.md +5 -1
- data/docs/bill_of_lading_v1.md +202 -0
- data/docs/carte_grise_v1.md +5 -1
- data/docs/carte_vitale_v1.md +5 -1
- data/docs/code_samples/bill_of_lading_v1_async.txt +19 -0
- data/docs/code_samples/energy_bill_fra_v1_async.txt +19 -0
- data/docs/code_samples/invoices_v4_async.txt +19 -0
- data/docs/code_samples/nutrition_facts_v1_async.txt +19 -0
- data/docs/code_samples/payslip_fra_v2_async.txt +19 -0
- data/docs/cropper_v1.md +6 -2
- data/docs/custom_v1.md +5 -3
- data/docs/energy_bill_fra_v1.md +249 -0
- data/docs/eu_driver_license_v1.md +6 -2
- data/docs/expense_receipts_v5.md +26 -1
- data/docs/financial_document_v1.md +29 -1
- data/docs/generated_v1.md +3 -0
- data/docs/getting_started.md +3 -0
- data/docs/idcard_fr_v2.md +15 -2
- data/docs/international_id_v2.md +13 -1
- data/docs/invoice_splitter_v1.md +16 -13
- data/docs/invoices_v4.md +54 -21
- data/docs/license_plates_v1.md +5 -1
- data/docs/multi_receipts_detector_v1.md +5 -1
- data/docs/nutrition_facts_v1.md +295 -0
- data/docs/passport_v1.md +5 -1
- data/docs/payslip_fra_v2.md +218 -0
- data/docs/proof_of_address_v1.md +5 -1
- data/docs/resume_v1.md +24 -1
- data/docs/us_driver_license_v1.md +6 -2
- data/docs/us_healthcare_cards_v1.md +5 -1
- data/docs/us_mail_v2.md +5 -1
- data/docs/us_w9_v1.md +6 -2
- data/examples/auto_invoice_splitter_extraction.rb +43 -0
- data/lib/mindee/client.rb +20 -8
- data/lib/mindee/{image_extraction → extraction}/common/image_extractor.rb +2 -4
- data/lib/mindee/{image_extraction → extraction}/common.rb +1 -0
- data/lib/mindee/extraction/pdf_extractor/extracted_pdf.rb +55 -0
- data/lib/mindee/extraction/pdf_extractor/pdf_extractor.rb +111 -0
- data/lib/mindee/extraction/pdf_extractor.rb +4 -0
- data/lib/mindee/extraction/tax_extractor/tax_extractor.rb +322 -0
- data/lib/mindee/extraction/tax_extractor.rb +1 -320
- data/lib/mindee/extraction.rb +3 -0
- data/lib/mindee/http/endpoint.rb +18 -6
- data/lib/mindee/parsing/common/api_response.rb +1 -1
- data/lib/mindee/parsing/common/document.rb +31 -1
- data/lib/mindee/parsing/common/extras/cropper_extra.rb +29 -0
- data/lib/mindee/parsing/common/extras/extras.rb +50 -0
- data/lib/mindee/parsing/common/extras/full_text_ocr_extra.rb +32 -0
- data/lib/mindee/parsing/common/extras.rb +5 -0
- data/lib/mindee/parsing/common/page.rb +5 -0
- data/lib/mindee/parsing/standard/base_field.rb +1 -0
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1.rb +39 -0
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier.rb +52 -0
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_item.rb +95 -0
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_consignee.rb +58 -0
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_document.rb +136 -0
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_notify_party.rb +58 -0
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_page.rb +32 -0
- data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_shipper.rb +58 -0
- data/lib/mindee/product/financial_document/financial_document_v1_line_item.rb +15 -1
- data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2_bban.rb +4 -15
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1.rb +41 -0
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_document.rb +235 -0
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_consumer.rb +48 -0
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_supplier.rb +48 -0
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_usage.rb +97 -0
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rb +54 -0
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_page.rb +34 -0
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_subscription.rb +97 -0
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contribution.rb +97 -0
- data/lib/mindee/product/fr/payslip/payslip_v2.rb +41 -0
- data/lib/mindee/product/fr/payslip/payslip_v2_bank_account_detail.rb +54 -0
- data/lib/mindee/product/fr/payslip/payslip_v2_document.rb +128 -0
- data/lib/mindee/product/fr/payslip/payslip_v2_employee.rb +78 -0
- data/lib/mindee/product/fr/payslip/payslip_v2_employer.rb +78 -0
- data/lib/mindee/product/fr/payslip/payslip_v2_employment.rb +72 -0
- data/lib/mindee/product/fr/payslip/payslip_v2_page.rb +34 -0
- data/lib/mindee/product/fr/payslip/payslip_v2_pay_detail.rb +100 -0
- data/lib/mindee/product/fr/payslip/payslip_v2_pay_period.rb +66 -0
- data/lib/mindee/product/fr/payslip/payslip_v2_pto.rb +56 -0
- data/lib/mindee/product/fr/payslip/payslip_v2_salary_detail.rb +81 -0
- data/lib/mindee/product/invoice/invoice_v4_line_item.rb +15 -1
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_document.rb +1 -1
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1.rb +39 -0
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_added_sugar.rb +52 -0
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_calorie.rb +52 -0
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_cholesterol.rb +52 -0
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_dietary_fiber.rb +52 -0
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_document.rb +173 -0
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrient.rb +87 -0
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_page.rb +32 -0
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_protein.rb +52 -0
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_saturated_fat.rb +52 -0
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_serving_size.rb +46 -0
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_sodium.rb +58 -0
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_carbohydrate.rb +52 -0
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_fat.rb +52 -0
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_sugar.rb +52 -0
- data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_trans_fat.rb +52 -0
- data/lib/mindee/product/receipt/receipt_v5_line_item.rb +11 -1
- data/lib/mindee/product/resume/resume_v1_certificate.rb +11 -1
- data/lib/mindee/product/resume/resume_v1_education.rb +14 -1
- data/lib/mindee/product/resume/resume_v1_language.rb +9 -1
- data/lib/mindee/product/resume/resume_v1_professional_experience.rb +15 -1
- data/lib/mindee/product/resume/resume_v1_social_networks_url.rb +9 -1
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb +9 -1
- data/lib/mindee/product/us/us_mail/us_mail_v2_recipient_address.rb +14 -1
- data/lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb +5 -17
- data/lib/mindee/product.rb +5 -1
- data/lib/mindee/version.rb +1 -1
- metadata +70 -9
- data/lib/mindee/image_extraction.rb +0 -4
- /data/lib/mindee/{image_extraction → extraction}/common/extracted_image.rb +0 -0
- /data/lib/mindee/{image_extraction → extraction}/multi_receipts_extractor/multi_receipts_extractor.rb +0 -0
- /data/lib/mindee/{image_extraction → extraction}/multi_receipts_extractor.rb +0 -0
- /data/lib/mindee/extraction/{ocr_extractor.rb → tax_extractor/ocr_extractor.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04d255d5113e3dc0f77b2f1d73bc13c9c5de423e7999d984480279488ee65835
|
4
|
+
data.tar.gz: 02cfd3cec62b74c7bcbb90068deb6c791fa4f9e36837614f6712b36f32557b5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d95a14c6fdd4238b135907c5b98eee4026287dbe14c2e71aac3d214f3cd92fd83472ff3bf9d59256892ee806c2375c97a6bdd3889a717ba76a3557c722cf3e9d
|
7
|
+
data.tar.gz: ac8b4b8dd66883be7f6669d0da7e68740fdf1dc64c9db9dd6228ec927f300e0bbc43f1498ed231110932fc5531e7d840f7d5f1b40f60bde1415481b699f3d304
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# Mindee Ruby API Library Changelog
|
2
2
|
|
3
|
+
## v3.13.0 - 2024-09-18
|
4
|
+
### Changes
|
5
|
+
* :sparkles: add support for BillOfLadingV1
|
6
|
+
* :sparkles: add support for (US) UsMailV2
|
7
|
+
* :sparkles: add support for (FR) EnergyBillV1
|
8
|
+
* :sparkles: add support for (FR) PayslipV1
|
9
|
+
* :sparkles: add support for NutritionFactsLabelV1
|
10
|
+
* :sparkles: add support for cropper Extra
|
11
|
+
* :sparkles: add support for full text Extra
|
12
|
+
* :sparkles: add support for invoice splitter auto-extraction
|
13
|
+
|
14
|
+
### Fixes
|
15
|
+
* :bug: fixed a bug that prevented longer decimals from appearing in the string representation of some objects
|
16
|
+
* :bug: fixed a bug that caused non-table elements to unexpectedly appear truncated when printed to the console
|
17
|
+
* :memo: fix a few documentation errors & typos
|
18
|
+
* :wrench: updated CI dependencies
|
19
|
+
|
20
|
+
|
3
21
|
## v3.12.0 - 2024-07-24
|
4
22
|
### Changes
|
5
23
|
* :sparkles: add support for Multi-Receipts Extraction
|
data/README.md
CHANGED
@@ -167,29 +167,29 @@ bundle exec ruby ./bin/mindee.rb invoice path/to/your/file.ext
|
|
167
167
|
There's more to it than that for those that need more features, or want to
|
168
168
|
customize the experience.
|
169
169
|
|
170
|
-
* [Ruby Overview](https://developers.mindee.com/docs/getting-started
|
171
|
-
* [Custom OCR Ruby](https://developers.mindee.com/docs/api-builder-ocr
|
172
|
-
* [Generated API Ruby](https://developers.mindee.com/docs/generated-
|
173
|
-
* [Invoice OCR Ruby](https://developers.mindee.com/docs/invoice-ocr
|
174
|
-
* [International Id OCR Ruby](https://developers.mindee.com/docs/international-id-ocr
|
175
|
-
* [Financial Document OCR Ruby](https://developers.mindee.com/docs/financial-document-ocr
|
176
|
-
* [Passport OCR Ruby](https://developers.mindee.com/docs/passport-ocr
|
177
|
-
* [Proof of Address OCR Ruby](https://developers.mindee.com/docs/proof-of-address-ocr
|
178
|
-
* [Receipt OCR Ruby](https://developers.mindee.com/docs/receipt-ocr
|
179
|
-
* [Resume OCR Ruby](https://developers.mindee.com/docs/resume-ocr
|
180
|
-
* [EU License Plate OCR Ruby](https://developers.mindee.com/docs/eu-license-plate-ocr
|
181
|
-
* [EU Driver License OCR Ruby](https://developers.mindee.com/docs/eu-driver-license-ocr
|
182
|
-
* [FR Bank Account Details OCR Ruby](https://developers.mindee.com/docs/fr-bank-account-details-ocr
|
183
|
-
* [FR Bank Statement OCR Ruby](https://developers.mindee.com/docs/fr-bank-statement-ocr
|
184
|
-
* [FR Carte Vitale OCR Ruby](https://developers.mindee.com/docs/fr-carte-vitale-ocr
|
185
|
-
* [FR ID Card OCR Ruby](https://developers.mindee.com/docs/fr-
|
186
|
-
* [US Bank Check OCR Ruby](https://developers.mindee.com/docs/us-bank-check-ocr
|
187
|
-
* [US Driver License OCR Ruby](https://developers.mindee.com/docs/us-driver-license-ocr
|
188
|
-
* [US W9 API Ruby](https://developers.mindee.com/docs/us-w9-
|
189
|
-
* [Barcode Reader API Ruby](https://developers.mindee.com/docs/barcode-reader-
|
190
|
-
* [Cropper API Ruby](https://developers.mindee.com/docs/cropper-
|
191
|
-
* [Invoice Splitter API Ruby](https://developers.mindee.com/docs/invoice-splitter-
|
192
|
-
* [Multi Receipts Detector API Ruby](https://developers.mindee.com/docs/multi-receipts-detector-
|
170
|
+
* [Ruby Overview](https://developers.mindee.com/docs/ruby-getting-started)
|
171
|
+
* [Custom OCR Ruby (Deprecated)](https://developers.mindee.com/docs/ruby-api-builder-ocr)
|
172
|
+
* [Generated API Ruby](https://developers.mindee.com/docs/ruby-generated-ocr)
|
173
|
+
* [Invoice OCR Ruby](https://developers.mindee.com/docs/ruby-invoice-ocr)
|
174
|
+
* [International Id OCR Ruby](https://developers.mindee.com/docs/ruby-international-id-ocr)
|
175
|
+
* [Financial Document OCR Ruby](https://developers.mindee.com/docs/ruby-financial-document-ocr)
|
176
|
+
* [Passport OCR Ruby](https://developers.mindee.com/docs/ruby-passport-ocr)
|
177
|
+
* [Proof of Address OCR Ruby](https://developers.mindee.com/docs/ruby-proof-of-address-ocr)
|
178
|
+
* [Receipt OCR Ruby](https://developers.mindee.com/docs/ruby-receipt-ocr)
|
179
|
+
* [Resume OCR Ruby](https://developers.mindee.com/docs/ruby-resume-ocr)
|
180
|
+
* [EU License Plate OCR Ruby](https://developers.mindee.com/docs/ruby-eu-license-plate-ocr)
|
181
|
+
* [EU Driver License OCR Ruby](https://developers.mindee.com/docs/ruby-eu-driver-license-ocr)
|
182
|
+
* [FR Bank Account Details OCR Ruby](https://developers.mindee.com/docs/ruby-fr-bank-account-details-ocr)
|
183
|
+
* [FR Bank Statement OCR Ruby](https://developers.mindee.com/docs/ruby-fr-bank-statement-ocr)
|
184
|
+
* [FR Carte Vitale OCR Ruby](https://developers.mindee.com/docs/ruby-fr-carte-vitale-ocr)
|
185
|
+
* [FR ID Card OCR Ruby](https://developers.mindee.com/docs/ruby-fr-carte-nationale-didentite-ocr)
|
186
|
+
* [US Bank Check OCR Ruby](https://developers.mindee.com/docs/ruby-us-bank-check-ocr)
|
187
|
+
* [US Driver License OCR Ruby](https://developers.mindee.com/docs/ruby-us-driver-license-ocr)
|
188
|
+
* [US W9 API Ruby](https://developers.mindee.com/docs/ruby-us-w9-ocr)
|
189
|
+
* [Barcode Reader API Ruby](https://developers.mindee.com/docs/ruby-barcode-reader-ocr)
|
190
|
+
* [Cropper API Ruby](https://developers.mindee.com/docs/ruby-cropper-ocr)
|
191
|
+
* [Invoice Splitter API Ruby](https://developers.mindee.com/docs/ruby-invoice-splitter-ocr)
|
192
|
+
* [Multi Receipts Detector API Ruby](https://developers.mindee.com/docs/ruby-multi-receipts-detector-ocr)
|
193
193
|
|
194
194
|
You can also take a look at the
|
195
195
|
[Reference Documentation](https://mindee.github.io/mindee-api-ruby/).
|
data/Rakefile
CHANGED
@@ -20,6 +20,11 @@ YARD::Rake::YardocTask.new(:doc) do |task|
|
|
20
20
|
task.files = ['lib/**/*.rb']
|
21
21
|
end
|
22
22
|
|
23
|
+
desc 'Run integration tests'
|
24
|
+
RSpec::Core::RakeTask.new(:integration) do |t|
|
25
|
+
t.pattern = 'spec/**/*_integration.rb'
|
26
|
+
end
|
27
|
+
|
23
28
|
Rake::Task[:doc].enhance do
|
24
29
|
FileUtils.cp_r(
|
25
30
|
File.join('docs', 'code_samples'),
|
@@ -1,5 +1,8 @@
|
|
1
1
|
---
|
2
2
|
title: FR Bank Account Details OCR Ruby
|
3
|
+
category: 622b805aaec68102ea7fcbc2
|
4
|
+
slug: ruby-fr-bank-account-details-ocr
|
5
|
+
parentDoc: 6294d97ee723f1008d2ab28e
|
3
6
|
---
|
4
7
|
The Ruby OCR SDK supports the [Bank Account Details API](https://platform.mindee.com/mindee/bank_account_details).
|
5
8
|
|
@@ -27,6 +30,7 @@ puts result.document
|
|
27
30
|
|
28
31
|
# Print the document-level parsed data
|
29
32
|
# puts result.document.inference.prediction
|
33
|
+
|
30
34
|
```
|
31
35
|
|
32
36
|
**Output (RST):**
|
@@ -80,7 +84,7 @@ A typical `Field` object will have the following attributes:
|
|
80
84
|
* **confidence** (Float, nil): the confidence score of the field prediction.
|
81
85
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
82
86
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
83
|
-
* **page_id** (`Integer`, `nil`): the ID of the page,
|
87
|
+
* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
|
84
88
|
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
85
89
|
|
86
90
|
|
data/docs/bank_check_v1.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
---
|
2
2
|
title: US Bank Check OCR Ruby
|
3
|
+
category: 622b805aaec68102ea7fcbc2
|
4
|
+
slug: ruby-us-bank-check-ocr
|
5
|
+
parentDoc: 6294d97ee723f1008d2ab28e
|
3
6
|
---
|
4
7
|
The Ruby OCR SDK supports the [Bank Check API](https://platform.mindee.com/mindee/bank_check).
|
5
8
|
|
@@ -27,6 +30,7 @@ puts result.document
|
|
27
30
|
|
28
31
|
# Print the document-level parsed data
|
29
32
|
# puts result.document.inference.prediction
|
33
|
+
|
30
34
|
```
|
31
35
|
|
32
36
|
**Output (RST):**
|
@@ -80,7 +84,7 @@ A typical `Field` object will have the following attributes:
|
|
80
84
|
* **confidence** (Float, nil): the confidence score of the field prediction.
|
81
85
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
82
86
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
83
|
-
* **page_id** (`Integer`, `nil`): the ID of the page,
|
87
|
+
* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
|
84
88
|
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
85
89
|
|
86
90
|
|
@@ -106,7 +110,7 @@ The position field `PositionField` does not implement all the basic `Field` attr
|
|
106
110
|
The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
|
107
111
|
|
108
112
|
## Page-Level Fields
|
109
|
-
Some fields are constrained to the page level, and so will not be retrievable
|
113
|
+
Some fields are constrained to the page level, and so will not be retrievable at document level.
|
110
114
|
|
111
115
|
# Attributes
|
112
116
|
The following fields are extracted for Bank Check V1:
|
@@ -1,5 +1,8 @@
|
|
1
1
|
---
|
2
2
|
title: FR Bank Statement (FR) OCR Ruby
|
3
|
+
category: 622b805aaec68102ea7fcbc2
|
4
|
+
slug: ruby-fr-bank-statement-ocr
|
5
|
+
parentDoc: 6294d97ee723f1008d2ab28e
|
3
6
|
---
|
4
7
|
The Ruby OCR SDK supports the [Bank Statement (FR) API](https://platform.mindee.com/mindee/bank_statement_fr).
|
5
8
|
|
data/docs/barcode_reader_v1.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
---
|
2
2
|
title: Barcode Reader OCR Ruby
|
3
|
+
category: 622b805aaec68102ea7fcbc2
|
4
|
+
slug: ruby-barcode-reader-ocr
|
5
|
+
parentDoc: 6294d97ee723f1008d2ab28e
|
3
6
|
---
|
4
7
|
The Ruby OCR SDK supports the [Barcode Reader API](https://platform.mindee.com/mindee/barcode_reader).
|
5
8
|
|
@@ -27,6 +30,7 @@ puts result.document
|
|
27
30
|
|
28
31
|
# Print the document-level parsed data
|
29
32
|
# puts result.document.inference.prediction
|
33
|
+
|
30
34
|
```
|
31
35
|
|
32
36
|
**Output (RST):**
|
@@ -70,7 +74,7 @@ A typical `Field` object will have the following attributes:
|
|
70
74
|
* **confidence** (Float, nil): the confidence score of the field prediction.
|
71
75
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
72
76
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
73
|
-
* **page_id** (`Integer`, `nil`): the ID of the page,
|
77
|
+
* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
|
74
78
|
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
75
79
|
|
76
80
|
|
@@ -0,0 +1,202 @@
|
|
1
|
+
---
|
2
|
+
title: Bill of Lading OCR Ruby
|
3
|
+
category: 622b805aaec68102ea7fcbc2
|
4
|
+
slug: ruby-bill-of-lading-ocr
|
5
|
+
parentDoc: 6294d97ee723f1008d2ab28e
|
6
|
+
---
|
7
|
+
The Ruby OCR SDK supports the [Bill of Lading API](https://platform.mindee.com/mindee/bill_of_lading).
|
8
|
+
|
9
|
+
The [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/bill_of_lading/default_sample.jpg) can be used for testing purposes.
|
10
|
+

|
11
|
+
|
12
|
+
# Quick-Start
|
13
|
+
```rb
|
14
|
+
require 'mindee'
|
15
|
+
|
16
|
+
# Init a new client
|
17
|
+
mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
18
|
+
|
19
|
+
# Load a file from disk
|
20
|
+
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
21
|
+
|
22
|
+
# Parse the file
|
23
|
+
result = mindee_client.enqueue_and_parse(
|
24
|
+
input_source,
|
25
|
+
Mindee::Product::BillOfLading::BillOfLadingV1
|
26
|
+
)
|
27
|
+
|
28
|
+
# Print a full summary of the parsed data in RST format
|
29
|
+
puts result.document
|
30
|
+
|
31
|
+
# Print the document-level parsed data
|
32
|
+
# puts result.document.inference.prediction
|
33
|
+
|
34
|
+
```
|
35
|
+
# Field Types
|
36
|
+
## Standard Fields
|
37
|
+
These fields are generic and used in several products.
|
38
|
+
|
39
|
+
### Basic Field
|
40
|
+
Each prediction object contains a set of fields that inherit from the generic `Field` class.
|
41
|
+
A typical `Field` object will have the following attributes:
|
42
|
+
|
43
|
+
* **value** (`String`, `Float`, `Integer`, `Boolean`): corresponds to the field value. Can be `nil` if no value was extracted.
|
44
|
+
* **confidence** (Float, nil): the confidence score of the field prediction.
|
45
|
+
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
46
|
+
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
47
|
+
* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
|
48
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
49
|
+
|
50
|
+
|
51
|
+
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.
|
52
|
+
|
53
|
+
### Date Field
|
54
|
+
Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
|
55
|
+
|
56
|
+
* **date_object** (`Date`): an accessible representation of the value as a JavaScript object.
|
57
|
+
|
58
|
+
### String Field
|
59
|
+
The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
|
60
|
+
|
61
|
+
## Specific Fields
|
62
|
+
Fields which are specific to this product; they are not used in any other product.
|
63
|
+
|
64
|
+
### Carrier Field
|
65
|
+
The shipping company responsible for transporting the goods.
|
66
|
+
|
67
|
+
A `BillOfLadingV1Carrier` implements the following attributes:
|
68
|
+
|
69
|
+
* `name` (String): The name of the carrier.
|
70
|
+
* `professional_number` (String): The professional number of the carrier.
|
71
|
+
* `scac` (String): The Standard Carrier Alpha Code (SCAC) of the carrier.
|
72
|
+
Fields which are specific to this product; they are not used in any other product.
|
73
|
+
|
74
|
+
### Consignee Field
|
75
|
+
The party to whom the goods are being shipped.
|
76
|
+
|
77
|
+
A `BillOfLadingV1Consignee` implements the following attributes:
|
78
|
+
|
79
|
+
* `address` (String): The address of the consignee.
|
80
|
+
* `email` (String): The email of the shipper.
|
81
|
+
* `name` (String): The name of the consignee.
|
82
|
+
* `phone` (String): The phone number of the consignee.
|
83
|
+
Fields which are specific to this product; they are not used in any other product.
|
84
|
+
|
85
|
+
### Items Field
|
86
|
+
The goods being shipped.
|
87
|
+
|
88
|
+
A `BillOfLadingV1CarrierItem` implements the following attributes:
|
89
|
+
|
90
|
+
* `description` (String): A description of the item.
|
91
|
+
* `gross_weight` (Float): The gross weight of the item.
|
92
|
+
* `measurement` (Float): The measurement of the item.
|
93
|
+
* `measurement_unit` (String): The unit of measurement for the measurement.
|
94
|
+
* `quantity` (Float): The quantity of the item being shipped.
|
95
|
+
* `weight_unit` (String): The unit of measurement for weights.
|
96
|
+
Fields which are specific to this product; they are not used in any other product.
|
97
|
+
|
98
|
+
### Notify Party Field
|
99
|
+
The party to be notified of the arrival of the goods.
|
100
|
+
|
101
|
+
A `BillOfLadingV1NotifyParty` implements the following attributes:
|
102
|
+
|
103
|
+
* `address` (String): The address of the notify party.
|
104
|
+
* `email` (String): The email of the shipper.
|
105
|
+
* `name` (String): The name of the notify party.
|
106
|
+
* `phone` (String): The phone number of the notify party.
|
107
|
+
Fields which are specific to this product; they are not used in any other product.
|
108
|
+
|
109
|
+
### Shipper Field
|
110
|
+
The party responsible for shipping the goods.
|
111
|
+
|
112
|
+
A `BillOfLadingV1Shipper` implements the following attributes:
|
113
|
+
|
114
|
+
* `address` (String): The address of the shipper.
|
115
|
+
* `email` (String): The email of the shipper.
|
116
|
+
* `name` (String): The name of the shipper.
|
117
|
+
* `phone` (String): The phone number of the shipper.
|
118
|
+
|
119
|
+
# Attributes
|
120
|
+
The following fields are extracted for Bill of Lading V1:
|
121
|
+
|
122
|
+
## Bill of Lading Number
|
123
|
+
**bill_of_lading_number** ([StringField](#string-field)): A unique identifier assigned to a Bill of Lading document.
|
124
|
+
|
125
|
+
```rb
|
126
|
+
puts result.document.inference.prediction.bill_of_lading_number.value
|
127
|
+
```
|
128
|
+
|
129
|
+
## Carrier
|
130
|
+
**carrier** ([BillOfLadingV1Carrier](#carrier-field)): The shipping company responsible for transporting the goods.
|
131
|
+
|
132
|
+
```rb
|
133
|
+
puts result.document.inference.prediction.carrier.value
|
134
|
+
```
|
135
|
+
|
136
|
+
## Items
|
137
|
+
**carrier_items** (Array<[BillOfLadingV1CarrierItem](#items-field)>): The goods being shipped.
|
138
|
+
|
139
|
+
```rb
|
140
|
+
for carrier_items_elem in result.document.inference.prediction.carrier_items do
|
141
|
+
puts carrier_items_elem.value
|
142
|
+
end
|
143
|
+
```
|
144
|
+
|
145
|
+
## Consignee
|
146
|
+
**consignee** ([BillOfLadingV1Consignee](#consignee-field)): The party to whom the goods are being shipped.
|
147
|
+
|
148
|
+
```rb
|
149
|
+
puts result.document.inference.prediction.consignee.value
|
150
|
+
```
|
151
|
+
|
152
|
+
## Date of issue
|
153
|
+
**date_of_issue** ([DateField](#date-field)): The date when the bill of lading is issued.
|
154
|
+
|
155
|
+
```rb
|
156
|
+
puts result.document.inference.prediction.date_of_issue.value
|
157
|
+
```
|
158
|
+
|
159
|
+
## Departure Date
|
160
|
+
**departure_date** ([DateField](#date-field)): The date when the vessel departs from the port of loading.
|
161
|
+
|
162
|
+
```rb
|
163
|
+
puts result.document.inference.prediction.departure_date.value
|
164
|
+
```
|
165
|
+
|
166
|
+
## Notify Party
|
167
|
+
**notify_party** ([BillOfLadingV1NotifyParty](#notify-party-field)): The party to be notified of the arrival of the goods.
|
168
|
+
|
169
|
+
```rb
|
170
|
+
puts result.document.inference.prediction.notify_party.value
|
171
|
+
```
|
172
|
+
|
173
|
+
## Place of Delivery
|
174
|
+
**place_of_delivery** ([StringField](#string-field)): The place where the goods are to be delivered.
|
175
|
+
|
176
|
+
```rb
|
177
|
+
puts result.document.inference.prediction.place_of_delivery.value
|
178
|
+
```
|
179
|
+
|
180
|
+
## Port of Discharge
|
181
|
+
**port_of_discharge** ([StringField](#string-field)): The port where the goods are unloaded from the vessel.
|
182
|
+
|
183
|
+
```rb
|
184
|
+
puts result.document.inference.prediction.port_of_discharge.value
|
185
|
+
```
|
186
|
+
|
187
|
+
## Port of Loading
|
188
|
+
**port_of_loading** ([StringField](#string-field)): The port where the goods are loaded onto the vessel.
|
189
|
+
|
190
|
+
```rb
|
191
|
+
puts result.document.inference.prediction.port_of_loading.value
|
192
|
+
```
|
193
|
+
|
194
|
+
## Shipper
|
195
|
+
**shipper** ([BillOfLadingV1Shipper](#shipper-field)): The party responsible for shipping the goods.
|
196
|
+
|
197
|
+
```rb
|
198
|
+
puts result.document.inference.prediction.shipper.value
|
199
|
+
```
|
200
|
+
|
201
|
+
# Questions?
|
202
|
+
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
|
data/docs/carte_grise_v1.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
---
|
2
2
|
title: FR Carte Grise OCR Ruby
|
3
|
+
category: 622b805aaec68102ea7fcbc2
|
4
|
+
slug: ruby-fr-carte-grise-ocr
|
5
|
+
parentDoc: 6294d97ee723f1008d2ab28e
|
3
6
|
---
|
4
7
|
The Ruby OCR SDK supports the [Carte Grise API](https://platform.mindee.com/mindee/carte_grise).
|
5
8
|
|
@@ -27,6 +30,7 @@ puts result.document
|
|
27
30
|
|
28
31
|
# Print the document-level parsed data
|
29
32
|
# puts result.document.inference.prediction
|
33
|
+
|
30
34
|
```
|
31
35
|
|
32
36
|
**Output (RST):**
|
@@ -146,7 +150,7 @@ A typical `Field` object will have the following attributes:
|
|
146
150
|
* **confidence** (Float, nil): the confidence score of the field prediction.
|
147
151
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
148
152
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
149
|
-
* **page_id** (`Integer`, `nil`): the ID of the page,
|
153
|
+
* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
|
150
154
|
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
151
155
|
|
152
156
|
|
data/docs/carte_vitale_v1.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
---
|
2
2
|
title: FR Carte Vitale OCR Ruby
|
3
|
+
category: 622b805aaec68102ea7fcbc2
|
4
|
+
slug: ruby-fr-carte-vitale-ocr
|
5
|
+
parentDoc: 6294d97ee723f1008d2ab28e
|
3
6
|
---
|
4
7
|
The Ruby OCR SDK supports the [Carte Vitale API](https://platform.mindee.com/mindee/carte_vitale).
|
5
8
|
|
@@ -27,6 +30,7 @@ puts result.document
|
|
27
30
|
|
28
31
|
# Print the document-level parsed data
|
29
32
|
# puts result.document.inference.prediction
|
33
|
+
|
30
34
|
```
|
31
35
|
|
32
36
|
**Output (RST):**
|
@@ -72,7 +76,7 @@ A typical `Field` object will have the following attributes:
|
|
72
76
|
* **confidence** (Float, nil): the confidence score of the field prediction.
|
73
77
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
74
78
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
75
|
-
* **page_id** (`Integer`, `nil`): the ID of the page,
|
79
|
+
* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
|
76
80
|
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
77
81
|
|
78
82
|
|
@@ -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::BillOfLading::BillOfLadingV1
|
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::FR::EnergyBill::EnergyBillV1
|
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::Invoice::InvoiceV4
|
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::NutritionFactsLabel::NutritionFactsLabelV1
|
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::FR::Payslip::PayslipV2
|
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
@@ -1,5 +1,8 @@
|
|
1
1
|
---
|
2
2
|
title: Cropper OCR Ruby
|
3
|
+
category: 622b805aaec68102ea7fcbc2
|
4
|
+
slug: ruby-cropper-ocr
|
5
|
+
parentDoc: 6294d97ee723f1008d2ab28e
|
3
6
|
---
|
4
7
|
The Ruby OCR SDK supports the [Cropper API](https://platform.mindee.com/mindee/cropper).
|
5
8
|
|
@@ -24,6 +27,7 @@ result = mindee_client.parse(
|
|
24
27
|
|
25
28
|
# Print a full summary of the parsed data in RST format
|
26
29
|
puts result.document
|
30
|
+
|
27
31
|
```
|
28
32
|
|
29
33
|
**Output (RST):**
|
@@ -63,7 +67,7 @@ A typical `Field` object will have the following attributes:
|
|
63
67
|
* **confidence** (Float, nil): the confidence score of the field prediction.
|
64
68
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
65
69
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
66
|
-
* **page_id** (`Integer`, `nil`): the ID of the page,
|
70
|
+
* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
|
67
71
|
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
68
72
|
|
69
73
|
|
@@ -77,7 +81,7 @@ The position field `PositionField` does not implement all the basic `Field` attr
|
|
77
81
|
* **quadrangle** (`Mindee::Geometry::Quadrilateral`): a free polygon made up of four points.
|
78
82
|
|
79
83
|
## Page-Level Fields
|
80
|
-
Some fields are constrained to the page level, and so will not be retrievable
|
84
|
+
Some fields are constrained to the page level, and so will not be retrievable at document level.
|
81
85
|
|
82
86
|
# Attributes
|
83
87
|
The following fields are extracted for Cropper V1:
|
data/docs/custom_v1.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
---
|
2
|
-
title: Custom API Ruby
|
2
|
+
title: Custom API Ruby (Deprecated)
|
3
|
+
category: 622b805aaec68102ea7fcbc2
|
4
|
+
slug: ruby-api-builder-ocr
|
5
|
+
parentDoc: 6294d97ee723f1008d2ab28e
|
3
6
|
---
|
4
|
-
|
5
|
-
If your document isn't covered by one of Mindee's Off-the-Shelf APIs, you can create your own API using the[API Builder](https://platform.mindee.com/api-builder).
|
7
|
+
> 🚧 This product is still supported, but is considered to be deprecated. If you are looking for the DocTI API documentation, you can find it [here](https://developers.mindee.com/docs/ruby-generated-ocr).
|
6
8
|
|
7
9
|
# Quick-Start
|
8
10
|
|