mindee 3.12.0 → 3.14.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.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/CHANGELOG.md +26 -0
  4. data/README.md +23 -23
  5. data/Rakefile +5 -0
  6. data/docs/bank_account_details_v2.md +5 -1
  7. data/docs/bank_check_v1.md +6 -2
  8. data/docs/bank_statement_fr_v1.md +3 -0
  9. data/docs/barcode_reader_v1.md +5 -1
  10. data/docs/bill_of_lading_v1.md +251 -0
  11. data/docs/carte_grise_v1.md +5 -1
  12. data/docs/carte_vitale_v1.md +5 -1
  13. data/docs/code_samples/bill_of_lading_v1_async.txt +19 -0
  14. data/docs/code_samples/energy_bill_fra_v1_async.txt +19 -0
  15. data/docs/code_samples/invoices_v4_async.txt +19 -0
  16. data/docs/code_samples/nutrition_facts_v1_async.txt +19 -0
  17. data/docs/code_samples/payslip_fra_v2_async.txt +19 -0
  18. data/docs/cropper_v1.md +6 -2
  19. data/docs/custom_v1.md +5 -3
  20. data/docs/energy_bill_fra_v1.md +309 -0
  21. data/docs/eu_driver_license_v1.md +6 -2
  22. data/docs/expense_receipts_v5.md +30 -5
  23. data/docs/financial_document_v1.md +43 -1
  24. data/docs/generated_v1.md +3 -0
  25. data/docs/getting_started.md +3 -0
  26. data/docs/idcard_fr_v2.md +15 -2
  27. data/docs/international_id_v2.md +13 -1
  28. data/docs/invoice_splitter_v1.md +16 -13
  29. data/docs/invoices_v4.md +70 -23
  30. data/docs/license_plates_v1.md +5 -1
  31. data/docs/multi_receipts_detector_v1.md +5 -1
  32. data/docs/nutrition_facts_v1.md +374 -0
  33. data/docs/passport_v1.md +5 -1
  34. data/docs/payslip_fra_v2.md +294 -0
  35. data/docs/proof_of_address_v1.md +5 -1
  36. data/docs/resume_v1.md +24 -1
  37. data/docs/us_driver_license_v1.md +6 -2
  38. data/docs/us_healthcare_cards_v1.md +5 -1
  39. data/docs/us_mail_v2.md +6 -2
  40. data/docs/us_w9_v1.md +6 -2
  41. data/examples/auto_invoice_splitter_extraction.rb +48 -0
  42. data/examples/auto_multi_receipts_detector_extraction.rb +31 -0
  43. data/lib/mindee/client.rb +20 -8
  44. data/lib/mindee/{image_extraction → extraction}/common/extracted_image.rb +1 -1
  45. data/lib/mindee/extraction/common/image_extractor.rb +192 -0
  46. data/lib/mindee/{image_extraction → extraction}/common.rb +1 -0
  47. data/lib/mindee/extraction/multi_receipts_extractor/multi_receipts_extractor.rb +32 -0
  48. data/lib/mindee/extraction/pdf_extractor/extracted_pdf.rb +55 -0
  49. data/lib/mindee/extraction/pdf_extractor/pdf_extractor.rb +111 -0
  50. data/lib/mindee/extraction/pdf_extractor.rb +4 -0
  51. data/lib/mindee/extraction/tax_extractor/tax_extractor.rb +322 -0
  52. data/lib/mindee/extraction/tax_extractor.rb +1 -320
  53. data/lib/mindee/extraction.rb +3 -0
  54. data/lib/mindee/http/endpoint.rb +18 -6
  55. data/lib/mindee/parsing/common/api_response.rb +1 -1
  56. data/lib/mindee/parsing/common/document.rb +31 -1
  57. data/lib/mindee/parsing/common/extras/cropper_extra.rb +29 -0
  58. data/lib/mindee/parsing/common/extras/extras.rb +50 -0
  59. data/lib/mindee/parsing/common/extras/full_text_ocr_extra.rb +32 -0
  60. data/lib/mindee/parsing/common/extras.rb +5 -0
  61. data/lib/mindee/parsing/common/page.rb +5 -0
  62. data/lib/mindee/parsing/standard/base_field.rb +1 -0
  63. data/lib/mindee/parsing/standard/date_field.rb +4 -0
  64. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1.rb +39 -0
  65. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier.rb +52 -0
  66. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_item.rb +95 -0
  67. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_consignee.rb +58 -0
  68. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_document.rb +136 -0
  69. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_notify_party.rb +58 -0
  70. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_page.rb +32 -0
  71. data/lib/mindee/product/bill_of_lading/bill_of_lading_v1_shipper.rb +58 -0
  72. data/lib/mindee/product/financial_document/financial_document_v1_document.rb +11 -1
  73. data/lib/mindee/product/financial_document/financial_document_v1_line_item.rb +15 -1
  74. data/lib/mindee/product/financial_document/financial_document_v1_page.rb +1 -1
  75. data/lib/mindee/product/fr/bank_account_details/bank_account_details_v2_bban.rb +4 -15
  76. data/lib/mindee/product/fr/energy_bill/energy_bill_v1.rb +41 -0
  77. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_document.rb +235 -0
  78. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_consumer.rb +48 -0
  79. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_supplier.rb +48 -0
  80. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_usage.rb +97 -0
  81. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rb +54 -0
  82. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_page.rb +34 -0
  83. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_subscription.rb +97 -0
  84. data/lib/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contribution.rb +97 -0
  85. data/lib/mindee/product/fr/payslip/payslip_v2.rb +41 -0
  86. data/lib/mindee/product/fr/payslip/payslip_v2_bank_account_detail.rb +54 -0
  87. data/lib/mindee/product/fr/payslip/payslip_v2_document.rb +128 -0
  88. data/lib/mindee/product/fr/payslip/payslip_v2_employee.rb +78 -0
  89. data/lib/mindee/product/fr/payslip/payslip_v2_employer.rb +78 -0
  90. data/lib/mindee/product/fr/payslip/payslip_v2_employment.rb +72 -0
  91. data/lib/mindee/product/fr/payslip/payslip_v2_page.rb +34 -0
  92. data/lib/mindee/product/fr/payslip/payslip_v2_pay_detail.rb +100 -0
  93. data/lib/mindee/product/fr/payslip/payslip_v2_pay_period.rb +66 -0
  94. data/lib/mindee/product/fr/payslip/payslip_v2_pto.rb +56 -0
  95. data/lib/mindee/product/fr/payslip/payslip_v2_salary_detail.rb +81 -0
  96. data/lib/mindee/product/invoice/invoice_v4_document.rb +11 -1
  97. data/lib/mindee/product/invoice/invoice_v4_line_item.rb +15 -1
  98. data/lib/mindee/product/invoice/invoice_v4_page.rb +1 -1
  99. data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_document.rb +1 -1
  100. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1.rb +39 -0
  101. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_added_sugar.rb +52 -0
  102. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_calorie.rb +52 -0
  103. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_cholesterol.rb +52 -0
  104. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_dietary_fiber.rb +52 -0
  105. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_document.rb +173 -0
  106. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrient.rb +87 -0
  107. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_page.rb +32 -0
  108. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_protein.rb +52 -0
  109. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_saturated_fat.rb +52 -0
  110. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_serving_size.rb +46 -0
  111. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_sodium.rb +58 -0
  112. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_carbohydrate.rb +52 -0
  113. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_fat.rb +52 -0
  114. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_total_sugar.rb +52 -0
  115. data/lib/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_trans_fat.rb +52 -0
  116. data/lib/mindee/product/receipt/receipt_v5_line_item.rb +11 -1
  117. data/lib/mindee/product/resume/resume_v1_certificate.rb +11 -1
  118. data/lib/mindee/product/resume/resume_v1_education.rb +14 -1
  119. data/lib/mindee/product/resume/resume_v1_language.rb +9 -1
  120. data/lib/mindee/product/resume/resume_v1_professional_experience.rb +15 -1
  121. data/lib/mindee/product/resume/resume_v1_social_networks_url.rb +9 -1
  122. data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_copay.rb +9 -1
  123. data/lib/mindee/product/us/us_mail/us_mail_v2_recipient_address.rb +14 -1
  124. data/lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb +5 -17
  125. data/lib/mindee/product.rb +5 -1
  126. data/lib/mindee/version.rb +1 -1
  127. metadata +71 -9
  128. data/lib/mindee/image_extraction/common/image_extractor.rb +0 -191
  129. data/lib/mindee/image_extraction/multi_receipts_extractor/multi_receipts_extractor.rb +0 -26
  130. data/lib/mindee/image_extraction.rb +0 -4
  131. /data/lib/mindee/{image_extraction → extraction}/multi_receipts_extractor.rb +0 -0
  132. /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: ef77c472e79a3139844c6e719cb368c081466ceed4ded849a39eefb27484ca78
4
- data.tar.gz: 4d41a61f23ccad56d6f9e4a846feed4c67c613d17a80baf0191aec119eb0835a
3
+ metadata.gz: '043953eb35ed9f251d12ca8b984edcf9acbeb491689574450dc3682b83e9db37'
4
+ data.tar.gz: 5916ad8aeada6713ee5a846d634693fd1ed5e585495238649f9a9c1d2e9fbd00
5
5
  SHA512:
6
- metadata.gz: df1777eaec4a97d7524e0bf0cc3e2356169a9a62af6349a10abacc8d1977c83124cbdeafed2e1d94f4cef4e3986c5e488fea45c31c1048c3feed85cdc8e0fb74
7
- data.tar.gz: 998987a5877b57d1ef2fc078c144f247369c2824b5a84334297e2bed81e61a77b894a863d5a4920d23cb3093b18f86bb0201b7e51a971136f3c2c1bb33c065ea
6
+ metadata.gz: 7edd036d9666e1ffe0318b8ec68cdfe5b37b6bdbb90e36ae0c19efa5cc038f109af30d9e6df6838e4237db2f9495a6251f10164db7e0c7dff528720ef4477a2a
7
+ data.tar.gz: 7dfbb27c5175bda760ba816be62b1447acf4517d6741506cb458bbe4b2b4c77338eff1d799d19f4b0bdca663323523eb479bc468e80f9ed1943226694ef04143
data/.rubocop.yml CHANGED
@@ -38,7 +38,7 @@ Metrics/ClassLength:
38
38
  Max: 200
39
39
 
40
40
  Metrics/ParameterLists:
41
- Max: 7
41
+ Max: 8
42
42
 
43
43
  Metrics/AbcSize:
44
44
  Max: 60
data/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Mindee Ruby API Library Changelog
2
2
 
3
+ ## v3.14.0 - 2024-10-11
4
+ ### Changes
5
+ * :sparkles: add support for Financial Document v1.10
6
+ * :sparkles: add support for Invoice v4.8
7
+ ### Fixes
8
+ * :bug: fix multi-receipts extraction not working as intended
9
+
10
+
11
+ ## v3.13.0 - 2024-09-18
12
+ ### Changes
13
+ * :sparkles: add support for BillOfLadingV1
14
+ * :sparkles: add support for (US) UsMailV2
15
+ * :sparkles: add support for (FR) EnergyBillV1
16
+ * :sparkles: add support for (FR) PayslipV1
17
+ * :sparkles: add support for NutritionFactsLabelV1
18
+ * :sparkles: add support for cropper Extra
19
+ * :sparkles: add support for full text Extra
20
+ * :sparkles: add support for invoice splitter auto-extraction
21
+
22
+ ### Fixes
23
+ * :bug: fixed a bug that prevented longer decimals from appearing in the string representation of some objects
24
+ * :bug: fixed a bug that caused non-table elements to unexpectedly appear truncated when printed to the console
25
+ * :memo: fix a few documentation errors & typos
26
+ * :wrench: updated CI dependencies
27
+
28
+
3
29
  ## v3.12.0 - 2024-07-24
4
30
  ### Changes
5
31
  * :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-ocr-ruby)
171
- * [Custom OCR Ruby](https://developers.mindee.com/docs/api-builder-ocr-ruby)
172
- * [Generated API Ruby](https://developers.mindee.com/docs/generated-api-ruby)
173
- * [Invoice OCR Ruby](https://developers.mindee.com/docs/invoice-ocr-ruby)
174
- * [International Id OCR Ruby](https://developers.mindee.com/docs/international-id-ocr-ruby)
175
- * [Financial Document OCR Ruby](https://developers.mindee.com/docs/financial-document-ocr-ruby)
176
- * [Passport OCR Ruby](https://developers.mindee.com/docs/passport-ocr-ruby)
177
- * [Proof of Address OCR Ruby](https://developers.mindee.com/docs/proof-of-address-ocr-ruby)
178
- * [Receipt OCR Ruby](https://developers.mindee.com/docs/receipt-ocr-ruby)
179
- * [Resume OCR Ruby](https://developers.mindee.com/docs/resume-ocr-ruby)
180
- * [EU License Plate OCR Ruby](https://developers.mindee.com/docs/eu-license-plate-ocr-ruby)
181
- * [EU Driver License OCR Ruby](https://developers.mindee.com/docs/eu-driver-license-ocr-ruby)
182
- * [FR Bank Account Details OCR Ruby](https://developers.mindee.com/docs/fr-bank-account-details-ocr-ruby)
183
- * [FR Bank Statement OCR Ruby](https://developers.mindee.com/docs/fr-bank-statement-ocr-ruby)
184
- * [FR Carte Vitale OCR Ruby](https://developers.mindee.com/docs/fr-carte-vitale-ocr-ruby)
185
- * [FR ID Card OCR Ruby](https://developers.mindee.com/docs/fr-id-card-ocr-ruby)
186
- * [US Bank Check OCR Ruby](https://developers.mindee.com/docs/us-bank-check-ocr-ruby)
187
- * [US Driver License OCR Ruby](https://developers.mindee.com/docs/us-driver-license-ocr-ruby)
188
- * [US W9 API Ruby](https://developers.mindee.com/docs/us-w9-api-ruby)
189
- * [Barcode Reader API Ruby](https://developers.mindee.com/docs/barcode-reader-api-ruby)
190
- * [Cropper API Ruby](https://developers.mindee.com/docs/cropper-api-ruby)
191
- * [Invoice Splitter API Ruby](https://developers.mindee.com/docs/invoice-splitter-api-ruby)
192
- * [Multi Receipts Detector API Ruby](https://developers.mindee.com/docs/multi-receipts-detector-api-ruby)
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, is `nil` when at document-level.
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
 
@@ -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, is `nil` when at document-level.
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 to through the document.
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
 
@@ -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, is `nil` when at document-level.
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,251 @@
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
+ Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/bill_of_lading/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
10
+ ![Bill of Lading sample](https://github.com/mindee/client-lib-test-data/blob/main/products/bill_of_lading/default_sample.jpg?raw=true)
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
+
36
+ **Output (RST):**
37
+ ```rst
38
+ ########
39
+ Document
40
+ ########
41
+ :Mindee ID: 3b5250a1-b52c-4e0b-bc3e-2f0146b04e29
42
+ :Filename: default_sample.jpg
43
+
44
+ Inference
45
+ #########
46
+ :Product: mindee/bill_of_lading v1.1
47
+ :Rotation applied: No
48
+
49
+ Prediction
50
+ ==========
51
+ :Bill of Lading Number: XYZ123456
52
+ :Shipper:
53
+ :Address: 123 OCEAN DRIVE, SHANGHAI, CHINA
54
+ :Email:
55
+ :Name: GLOBAL FREIGHT SOLUTIONS INC.
56
+ :Phone: 86-21-12345678
57
+ :Consignee:
58
+ :Address: 789 TRADE STREET, SINGAPORE 567890, SINGAPORE
59
+ :Email:
60
+ :Name: PACIFIC TRADING CO.
61
+ :Phone: 65-65432100
62
+ :Notify Party:
63
+ :Address: 789 TRADE STREET, SINGAPORE 567890, SINGAPORE
64
+ :Email:
65
+ :Name: PACIFIC TRADING CO.
66
+ :Phone: 65-65432100
67
+ :Carrier:
68
+ :Name: GLOBAL SHIPPING CO.,LTD.
69
+ :Professional Number:
70
+ :SCAC:
71
+ :Items:
72
+ +--------------------------------------+--------------+-------------+------------------+----------+-------------+
73
+ | Description | Gross Weight | Measurement | Measurement Unit | Quantity | Weight Unit |
74
+ +======================================+==============+=============+==================+==========+=============+
75
+ | ELECTRONIC COMPONENTS\nP/N: 12345... | 500.00 | 1.50 | cbm | 1.00 | kgs |
76
+ +--------------------------------------+--------------+-------------+------------------+----------+-------------+
77
+ :Port of Loading: SHANGHAI, CHINA
78
+ :Port of Discharge: LOS ANGELES, USA
79
+ :Place of Delivery: LOS ANGELES, USA
80
+ :Date of issue: 2022-09-30
81
+ :Departure Date:
82
+ ```
83
+
84
+ # Field Types
85
+ ## Standard Fields
86
+ These fields are generic and used in several products.
87
+
88
+ ### Basic Field
89
+ Each prediction object contains a set of fields that inherit from the generic `Field` class.
90
+ A typical `Field` object will have the following attributes:
91
+
92
+ * **value** (`String`, `Float`, `Integer`, `Boolean`): corresponds to the field value. Can be `nil` if no value was extracted.
93
+ * **confidence** (Float, nil): the confidence score of the field prediction.
94
+ * **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
95
+ * **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
96
+ * **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
97
+ * **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
98
+
99
+
100
+ 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.
101
+
102
+ ### Date Field
103
+ Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
104
+
105
+ * **date_object** (`Date`): an accessible representation of the value as a JavaScript object.
106
+
107
+ ### String Field
108
+ The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
109
+
110
+ ## Specific Fields
111
+ Fields which are specific to this product; they are not used in any other product.
112
+
113
+ ### Carrier Field
114
+ The shipping company responsible for transporting the goods.
115
+
116
+ A `BillOfLadingV1Carrier` implements the following attributes:
117
+
118
+ * `name` (String): The name of the carrier.
119
+ * `professional_number` (String): The professional number of the carrier.
120
+ * `scac` (String): The Standard Carrier Alpha Code (SCAC) of the carrier.
121
+ Fields which are specific to this product; they are not used in any other product.
122
+
123
+ ### Consignee Field
124
+ The party to whom the goods are being shipped.
125
+
126
+ A `BillOfLadingV1Consignee` implements the following attributes:
127
+
128
+ * `address` (String): The address of the consignee.
129
+ * `email` (String): The email of the shipper.
130
+ * `name` (String): The name of the consignee.
131
+ * `phone` (String): The phone number of the consignee.
132
+ Fields which are specific to this product; they are not used in any other product.
133
+
134
+ ### Items Field
135
+ The goods being shipped.
136
+
137
+ A `BillOfLadingV1CarrierItem` implements the following attributes:
138
+
139
+ * `description` (String): A description of the item.
140
+ * `gross_weight` (Float): The gross weight of the item.
141
+ * `measurement` (Float): The measurement of the item.
142
+ * `measurement_unit` (String): The unit of measurement for the measurement.
143
+ * `quantity` (Float): The quantity of the item being shipped.
144
+ * `weight_unit` (String): The unit of measurement for weights.
145
+ Fields which are specific to this product; they are not used in any other product.
146
+
147
+ ### Notify Party Field
148
+ The party to be notified of the arrival of the goods.
149
+
150
+ A `BillOfLadingV1NotifyParty` implements the following attributes:
151
+
152
+ * `address` (String): The address of the notify party.
153
+ * `email` (String): The email of the shipper.
154
+ * `name` (String): The name of the notify party.
155
+ * `phone` (String): The phone number of the notify party.
156
+ Fields which are specific to this product; they are not used in any other product.
157
+
158
+ ### Shipper Field
159
+ The party responsible for shipping the goods.
160
+
161
+ A `BillOfLadingV1Shipper` implements the following attributes:
162
+
163
+ * `address` (String): The address of the shipper.
164
+ * `email` (String): The email of the shipper.
165
+ * `name` (String): The name of the shipper.
166
+ * `phone` (String): The phone number of the shipper.
167
+
168
+ # Attributes
169
+ The following fields are extracted for Bill of Lading V1:
170
+
171
+ ## Bill of Lading Number
172
+ **bill_of_lading_number** ([StringField](#string-field)): A unique identifier assigned to a Bill of Lading document.
173
+
174
+ ```rb
175
+ puts result.document.inference.prediction.bill_of_lading_number.value
176
+ ```
177
+
178
+ ## Carrier
179
+ **carrier** ([BillOfLadingV1Carrier](#carrier-field)): The shipping company responsible for transporting the goods.
180
+
181
+ ```rb
182
+ puts result.document.inference.prediction.carrier.value
183
+ ```
184
+
185
+ ## Items
186
+ **carrier_items** (Array<[BillOfLadingV1CarrierItem](#items-field)>): The goods being shipped.
187
+
188
+ ```rb
189
+ for carrier_items_elem in result.document.inference.prediction.carrier_items do
190
+ puts carrier_items_elem.value
191
+ end
192
+ ```
193
+
194
+ ## Consignee
195
+ **consignee** ([BillOfLadingV1Consignee](#consignee-field)): The party to whom the goods are being shipped.
196
+
197
+ ```rb
198
+ puts result.document.inference.prediction.consignee.value
199
+ ```
200
+
201
+ ## Date of issue
202
+ **date_of_issue** ([DateField](#date-field)): The date when the bill of lading is issued.
203
+
204
+ ```rb
205
+ puts result.document.inference.prediction.date_of_issue.value
206
+ ```
207
+
208
+ ## Departure Date
209
+ **departure_date** ([DateField](#date-field)): The date when the vessel departs from the port of loading.
210
+
211
+ ```rb
212
+ puts result.document.inference.prediction.departure_date.value
213
+ ```
214
+
215
+ ## Notify Party
216
+ **notify_party** ([BillOfLadingV1NotifyParty](#notify-party-field)): The party to be notified of the arrival of the goods.
217
+
218
+ ```rb
219
+ puts result.document.inference.prediction.notify_party.value
220
+ ```
221
+
222
+ ## Place of Delivery
223
+ **place_of_delivery** ([StringField](#string-field)): The place where the goods are to be delivered.
224
+
225
+ ```rb
226
+ puts result.document.inference.prediction.place_of_delivery.value
227
+ ```
228
+
229
+ ## Port of Discharge
230
+ **port_of_discharge** ([StringField](#string-field)): The port where the goods are unloaded from the vessel.
231
+
232
+ ```rb
233
+ puts result.document.inference.prediction.port_of_discharge.value
234
+ ```
235
+
236
+ ## Port of Loading
237
+ **port_of_loading** ([StringField](#string-field)): The port where the goods are loaded onto the vessel.
238
+
239
+ ```rb
240
+ puts result.document.inference.prediction.port_of_loading.value
241
+ ```
242
+
243
+ ## Shipper
244
+ **shipper** ([BillOfLadingV1Shipper](#shipper-field)): The party responsible for shipping the goods.
245
+
246
+ ```rb
247
+ puts result.document.inference.prediction.shipper.value
248
+ ```
249
+
250
+ # Questions?
251
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -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, is `nil` when at document-level.
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
 
@@ -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, is `nil` when at document-level.
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, is `nil` when at document-level.
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 to through the document.
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: