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
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
- The Ruby OCR SDK supports [custom-built APIs](https://developers.mindee.com/docs/build-your-first-document-parsing-api).
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
 
@@ -0,0 +1,309 @@
1
+ ---
2
+ title: FR Energy Bill OCR Ruby
3
+ category: 622b805aaec68102ea7fcbc2
4
+ slug: ruby-fr-energy-bill-ocr
5
+ parentDoc: 6294d97ee723f1008d2ab28e
6
+ ---
7
+ The Ruby OCR SDK supports the [Energy Bill API](https://platform.mindee.com/mindee/energy_bill_fra).
8
+
9
+ Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/energy_bill_fra/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
10
+ ![Energy Bill sample](https://github.com/mindee/client-lib-test-data/blob/main/products/energy_bill_fra/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::FR::EnergyBill::EnergyBillV1
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: 17f0ccef-e3fe-4a28-838d-d704489d6ce7
42
+ :Filename: default_sample.pdf
43
+
44
+ Inference
45
+ #########
46
+ :Product: mindee/energy_bill_fra v1.0
47
+ :Rotation applied: No
48
+
49
+ Prediction
50
+ ==========
51
+ :Invoice Number: 10123590373
52
+ :Contract ID: 1234567890
53
+ :Delivery Point: 98765432109876
54
+ :Invoice Date: 2021-01-29
55
+ :Due Date: 2021-02-15
56
+ :Total Before Taxes: 1241.03
57
+ :Total Taxes: 238.82
58
+ :Total Amount: 1479.85
59
+ :Energy Supplier:
60
+ :Address: TSA 12345, 12345 DEMOCITY CEDEX, 75001 PARIS
61
+ :Name: EDF
62
+ :Energy Consumer:
63
+ :Address: 12 AVENUE DES RÊVES, RDC A 123 COUR FAUSSE A, 75000 PARIS
64
+ :Name: John Doe
65
+ :Subscription:
66
+ +--------------------------------------+------------+------------+----------+-----------+------------+
67
+ | Description | End Date | Start Date | Tax Rate | Total | Unit Price |
68
+ +======================================+============+============+==========+===========+============+
69
+ | Abonnement électricité | 2021-02-28 | 2021-01-01 | 5.50 | 59.00 | 29.50 |
70
+ +--------------------------------------+------------+------------+----------+-----------+------------+
71
+ :Energy Usage:
72
+ +--------------------------------------+------------+------------+----------+-----------+------------+
73
+ | Description | End Date | Start Date | Tax Rate | Total | Unit Price |
74
+ +======================================+============+============+==========+===========+============+
75
+ | Consommation (HT) | 2021-01-27 | 2020-11-28 | 20.00 | 898.43 | 10.47 |
76
+ +--------------------------------------+------------+------------+----------+-----------+------------+
77
+ :Taxes and Contributions:
78
+ +--------------------------------------+------------+------------+----------+-----------+------------+
79
+ | Description | End Date | Start Date | Tax Rate | Total | Unit Price |
80
+ +======================================+============+============+==========+===========+============+
81
+ | Contribution au Service Public de... | 2021-01-27 | 2020-11-28 | 20.00 | 193.07 | 2.25 |
82
+ +--------------------------------------+------------+------------+----------+-----------+------------+
83
+ | Départementale sur la Conso Final... | 2020-12-31 | 2020-11-28 | 20.00 | 13.98 | 0.3315 |
84
+ +--------------------------------------+------------+------------+----------+-----------+------------+
85
+ | Communale sur la Conso Finale Ele... | 2021-01-27 | 2021-01-01 | 20.00 | 28.56 | 0.6545 |
86
+ +--------------------------------------+------------+------------+----------+-----------+------------+
87
+ | Contribution Tarifaire d'Achemine... | 2020-12-31 | 2020-11-28 | 20.00 | 27.96 | 0.663 |
88
+ +--------------------------------------+------------+------------+----------+-----------+------------+
89
+ :Meter Details:
90
+ :Meter Number: 620
91
+ :Meter Type: electricity
92
+ :Unit of Measure: kWh
93
+ ```
94
+
95
+ # Field Types
96
+ ## Standard Fields
97
+ These fields are generic and used in several products.
98
+
99
+ ### Basic Field
100
+ Each prediction object contains a set of fields that inherit from the generic `Field` class.
101
+ A typical `Field` object will have the following attributes:
102
+
103
+ * **value** (`String`, `Float`, `Integer`, `Boolean`): corresponds to the field value. Can be `nil` if no value was extracted.
104
+ * **confidence** (Float, nil): the confidence score of the field prediction.
105
+ * **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
106
+ * **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
107
+ * **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
108
+ * **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
109
+
110
+
111
+ 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.
112
+
113
+
114
+ ### Amount Field
115
+ The amount field `AmountField` only has one constraint: its **value** is a `Float` (or `nil`).
116
+
117
+ ### Date Field
118
+ Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
119
+
120
+ * **date_object** (`Date`): an accessible representation of the value as a JavaScript object.
121
+
122
+ ### String Field
123
+ The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
124
+
125
+ ## Specific Fields
126
+ Fields which are specific to this product; they are not used in any other product.
127
+
128
+ ### Energy Consumer Field
129
+ The entity that consumes the energy.
130
+
131
+ A `EnergyBillV1EnergyConsumer` implements the following attributes:
132
+
133
+ * `address` (String): The address of the energy consumer.
134
+ * `name` (String): The name of the energy consumer.
135
+ Fields which are specific to this product; they are not used in any other product.
136
+
137
+ ### Energy Supplier Field
138
+ The company that supplies the energy.
139
+
140
+ A `EnergyBillV1EnergySupplier` implements the following attributes:
141
+
142
+ * `address` (String): The address of the energy supplier.
143
+ * `name` (String): The name of the energy supplier.
144
+ Fields which are specific to this product; they are not used in any other product.
145
+
146
+ ### Energy Usage Field
147
+ Details of energy consumption.
148
+
149
+ A `EnergyBillV1EnergyUsage` implements the following attributes:
150
+
151
+ * `description` (String): Description or details of the energy usage.
152
+ * `end_date` (String): The end date of the energy usage.
153
+ * `start_date` (String): The start date of the energy usage.
154
+ * `tax_rate` (Float): The rate of tax applied to the total cost.
155
+ * `total` (Float): The total cost of energy consumed.
156
+ * `unit_price` (Float): The price per unit of energy consumed.
157
+ Fields which are specific to this product; they are not used in any other product.
158
+
159
+ ### Meter Details Field
160
+ Information about the energy meter.
161
+
162
+ A `EnergyBillV1MeterDetail` implements the following attributes:
163
+
164
+ * `meter_number` (String): The unique identifier of the energy meter.
165
+ * `meter_type` (String): The type of energy meter.
166
+
167
+ #### Possible values include:
168
+ - electricity
169
+ - gas
170
+ - water
171
+ - None
172
+
173
+ * `unit` (String): The unit of measurement for energy consumption, which can be kW, m³, or L.
174
+ Fields which are specific to this product; they are not used in any other product.
175
+
176
+ ### Subscription Field
177
+ The subscription details fee for the energy service.
178
+
179
+ A `EnergyBillV1Subscription` implements the following attributes:
180
+
181
+ * `description` (String): Description or details of the subscription.
182
+ * `end_date` (String): The end date of the subscription.
183
+ * `start_date` (String): The start date of the subscription.
184
+ * `tax_rate` (Float): The rate of tax applied to the total cost.
185
+ * `total` (Float): The total cost of subscription.
186
+ * `unit_price` (Float): The price per unit of subscription.
187
+ Fields which are specific to this product; they are not used in any other product.
188
+
189
+ ### Taxes and Contributions Field
190
+ Details of Taxes and Contributions.
191
+
192
+ A `EnergyBillV1TaxesAndContribution` implements the following attributes:
193
+
194
+ * `description` (String): Description or details of the Taxes and Contributions.
195
+ * `end_date` (String): The end date of the Taxes and Contributions.
196
+ * `start_date` (String): The start date of the Taxes and Contributions.
197
+ * `tax_rate` (Float): The rate of tax applied to the total cost.
198
+ * `total` (Float): The total cost of Taxes and Contributions.
199
+ * `unit_price` (Float): The price per unit of Taxes and Contributions.
200
+
201
+ # Attributes
202
+ The following fields are extracted for Energy Bill V1:
203
+
204
+ ## Contract ID
205
+ **contract_id** ([StringField](#string-field)): The unique identifier associated with a specific contract.
206
+
207
+ ```rb
208
+ puts result.document.inference.prediction.contract_id.value
209
+ ```
210
+
211
+ ## Delivery Point
212
+ **delivery_point** ([StringField](#string-field)): The unique identifier assigned to each electricity or gas consumption point. It specifies the exact location where the energy is delivered.
213
+
214
+ ```rb
215
+ puts result.document.inference.prediction.delivery_point.value
216
+ ```
217
+
218
+ ## Due Date
219
+ **due_date** ([DateField](#date-field)): The date by which the payment for the energy invoice is due.
220
+
221
+ ```rb
222
+ puts result.document.inference.prediction.due_date.value
223
+ ```
224
+
225
+ ## Energy Consumer
226
+ **energy_consumer** ([EnergyBillV1EnergyConsumer](#energy-consumer-field)): The entity that consumes the energy.
227
+
228
+ ```rb
229
+ puts result.document.inference.prediction.energy_consumer.value
230
+ ```
231
+
232
+ ## Energy Supplier
233
+ **energy_supplier** ([EnergyBillV1EnergySupplier](#energy-supplier-field)): The company that supplies the energy.
234
+
235
+ ```rb
236
+ puts result.document.inference.prediction.energy_supplier.value
237
+ ```
238
+
239
+ ## Energy Usage
240
+ **energy_usage** (Array<[EnergyBillV1EnergyUsage](#energy-usage-field)>): Details of energy consumption.
241
+
242
+ ```rb
243
+ for energy_usage_elem in result.document.inference.prediction.energy_usage do
244
+ puts energy_usage_elem.value
245
+ end
246
+ ```
247
+
248
+ ## Invoice Date
249
+ **invoice_date** ([DateField](#date-field)): The date when the energy invoice was issued.
250
+
251
+ ```rb
252
+ puts result.document.inference.prediction.invoice_date.value
253
+ ```
254
+
255
+ ## Invoice Number
256
+ **invoice_number** ([StringField](#string-field)): The unique identifier of the energy invoice.
257
+
258
+ ```rb
259
+ puts result.document.inference.prediction.invoice_number.value
260
+ ```
261
+
262
+ ## Meter Details
263
+ **meter_details** ([EnergyBillV1MeterDetail](#meter-details-field)): Information about the energy meter.
264
+
265
+ ```rb
266
+ puts result.document.inference.prediction.meter_details.value
267
+ ```
268
+
269
+ ## Subscription
270
+ **subscription** (Array<[EnergyBillV1Subscription](#subscription-field)>): The subscription details fee for the energy service.
271
+
272
+ ```rb
273
+ for subscription_elem in result.document.inference.prediction.subscription do
274
+ puts subscription_elem.value
275
+ end
276
+ ```
277
+
278
+ ## Taxes and Contributions
279
+ **taxes_and_contributions** (Array<[EnergyBillV1TaxesAndContribution](#taxes-and-contributions-field)>): Details of Taxes and Contributions.
280
+
281
+ ```rb
282
+ for taxes_and_contributions_elem in result.document.inference.prediction.taxes_and_contributions do
283
+ puts taxes_and_contributions_elem.value
284
+ end
285
+ ```
286
+
287
+ ## Total Amount
288
+ **total_amount** ([AmountField](#amount-field)): The total amount to be paid for the energy invoice.
289
+
290
+ ```rb
291
+ puts result.document.inference.prediction.total_amount.value
292
+ ```
293
+
294
+ ## Total Before Taxes
295
+ **total_before_taxes** ([AmountField](#amount-field)): The total amount to be paid for the energy invoice before taxes.
296
+
297
+ ```rb
298
+ puts result.document.inference.prediction.total_before_taxes.value
299
+ ```
300
+
301
+ ## Total Taxes
302
+ **total_taxes** ([AmountField](#amount-field)): Total of taxes applied to the invoice.
303
+
304
+ ```rb
305
+ puts result.document.inference.prediction.total_taxes.value
306
+ ```
307
+
308
+ # Questions?
309
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -1,5 +1,8 @@
1
1
  ---
2
2
  title: EU Driver License OCR Ruby
3
+ category: 622b805aaec68102ea7fcbc2
4
+ slug: ruby-eu-driver-license-ocr
5
+ parentDoc: 6294d97ee723f1008d2ab28e
3
6
  ---
4
7
  The Ruby OCR SDK supports the [Driver License API](https://platform.mindee.com/mindee/eu_driver_license).
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):**
@@ -90,7 +94,7 @@ A typical `Field` object will have the following attributes:
90
94
  * **confidence** (Float, nil): the confidence score of the field prediction.
91
95
  * **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
92
96
  * **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
93
- * **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
97
+ * **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
94
98
  * **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
95
99
 
96
100
 
@@ -112,7 +116,7 @@ The position field `PositionField` does not implement all the basic `Field` attr
112
116
  The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
113
117
 
114
118
  ## Page-Level Fields
115
- Some fields are constrained to the page level, and so will not be retrievable to through the document.
119
+ Some fields are constrained to the page level, and so will not be retrievable at document level.
116
120
 
117
121
  # Attributes
118
122
  The following fields are extracted for Driver License V1:
@@ -1,5 +1,8 @@
1
1
  ---
2
2
  title: Receipt OCR Ruby
3
+ category: 622b805aaec68102ea7fcbc2
4
+ slug: ruby-receipt-ocr
5
+ parentDoc: 6294d97ee723f1008d2ab28e
3
6
  ---
4
7
  The Ruby OCR SDK supports the [Receipt API](https://platform.mindee.com/mindee/expense_receipts).
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):**
@@ -46,7 +50,7 @@ Prediction
46
50
  ==========
47
51
  :Expense Locale: en-GB; en; GB; GBP;
48
52
  :Purchase Category: food
49
- :Purchase Subcategory: restaurant
53
+ :Purchase Subcategory:
50
54
  :Document Type: EXPENSE RECEIPT
51
55
  :Purchase Date: 2016-02-26
52
56
  :Purchase Time: 15:20
@@ -60,7 +64,7 @@ Prediction
60
64
  +===============+========+==========+===============+
61
65
  | 8.50 | VAT | 20.00 | 1.70 |
62
66
  +---------------+--------+----------+---------------+
63
- :Supplier Name: clachan
67
+ :Supplier Name: Clachan
64
68
  :Supplier Company Registrations: Type: VAT NUMBER, Value: 232153895
65
69
  Type: VAT NUMBER, Value: 232153895
66
70
  :Supplier Address: 34 Kingley Street W1B 50H
@@ -80,7 +84,7 @@ Page 0
80
84
  ------
81
85
  :Expense Locale: en-GB; en; GB; GBP;
82
86
  :Purchase Category: food
83
- :Purchase Subcategory: restaurant
87
+ :Purchase Subcategory:
84
88
  :Document Type: EXPENSE RECEIPT
85
89
  :Purchase Date: 2016-02-26
86
90
  :Purchase Time: 15:20
@@ -94,7 +98,7 @@ Page 0
94
98
  +===============+========+==========+===============+
95
99
  | 8.50 | VAT | 20.00 | 1.70 |
96
100
  +---------------+--------+----------+---------------+
97
- :Supplier Name: clachan
101
+ :Supplier Name: Clachan
98
102
  :Supplier Company Registrations: Type: VAT NUMBER, Value: 232153895
99
103
  Type: VAT NUMBER, Value: 232153895
100
104
  :Supplier Address: 34 Kingley Street W1B 50H
@@ -120,7 +124,7 @@ A typical `Field` object will have the following attributes:
120
124
  * **confidence** (Float, nil): the confidence score of the field prediction.
121
125
  * **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
122
126
  * **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
123
- * **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
127
+ * **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
124
128
  * **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
125
129
 
126
130
 
@@ -189,6 +193,16 @@ The following fields are extracted for Receipt V5:
189
193
  ## Purchase Category
190
194
  **category** ([ClassificationField](#classification-field)): The purchase category among predefined classes.
191
195
 
196
+ #### Possible values include:
197
+ - toll
198
+ - food
199
+ - parking
200
+ - transport
201
+ - accommodation
202
+ - gasoline
203
+ - telecom
204
+ - miscellaneous
205
+
192
206
  ```rb
193
207
  puts result.document.inference.prediction.category.value
194
208
  ```
@@ -203,6 +217,10 @@ puts result.document.inference.prediction.date.value
203
217
  ## Document Type
204
218
  **document_type** ([ClassificationField](#classification-field)): One of: 'CREDIT CARD RECEIPT', 'EXPENSE RECEIPT'.
205
219
 
220
+ #### Possible values include:
221
+ - expense_receipt
222
+ - credit_card_receipt
223
+
206
224
  ```rb
207
225
  puts result.document.inference.prediction.document_type.value
208
226
  ```
@@ -233,6 +251,13 @@ puts result.document.inference.prediction.receipt_number.value
233
251
  ## Purchase Subcategory
234
252
  **subcategory** ([ClassificationField](#classification-field)): The purchase subcategory among predefined classes for transport and food.
235
253
 
254
+ #### Possible values include:
255
+ - plane
256
+ - taxi
257
+ - train
258
+ - restaurant
259
+ - shopping
260
+
236
261
  ```rb
237
262
  puts result.document.inference.prediction.subcategory.value
238
263
  ```
@@ -1,5 +1,8 @@
1
1
  ---
2
2
  title: Financial Document OCR Ruby
3
+ category: 622b805aaec68102ea7fcbc2
4
+ slug: ruby-financial-document-ocr
5
+ parentDoc: 6294d97ee723f1008d2ab28e
3
6
  ---
4
7
  The Ruby OCR SDK supports the [Financial Document API](https://platform.mindee.com/mindee/financial_document).
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
  You can also call this product asynchronously:
@@ -51,6 +55,7 @@ puts result.document
51
55
 
52
56
  # Print the document-level parsed data
53
57
  # puts result.document.inference.prediction
58
+
54
59
  ```
55
60
 
56
61
  **Output (RST):**
@@ -176,7 +181,7 @@ A typical `Field` object will have the following attributes:
176
181
  * **confidence** (Float, nil): the confidence score of the field prediction.
177
182
  * **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
178
183
  * **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
179
- * **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
184
+ * **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
180
185
  * **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
181
186
 
182
187
 
@@ -264,6 +269,16 @@ puts result.document.inference.prediction.billing_address.value
264
269
  ## Purchase Category
265
270
  **category** ([ClassificationField](#classification-field)): The purchase category among predefined classes.
266
271
 
272
+ #### Possible values include:
273
+ - toll
274
+ - food
275
+ - parking
276
+ - transport
277
+ - accommodation
278
+ - gasoline
279
+ - telecom
280
+ - miscellaneous
281
+
267
282
  ```rb
268
283
  puts result.document.inference.prediction.category.value
269
284
  ```
@@ -315,6 +330,12 @@ puts result.document.inference.prediction.document_number.value
315
330
  ## Document Type
316
331
  **document_type** ([ClassificationField](#classification-field)): One of: 'INVOICE', 'CREDIT NOTE', 'CREDIT CARD RECEIPT', 'EXPENSE RECEIPT'.
317
332
 
333
+ #### Possible values include:
334
+ - INVOICE
335
+ - CREDIT NOTE
336
+ - CREDIT CARD RECEIPT
337
+ - EXPENSE RECEIPT
338
+
318
339
  ```rb
319
340
  puts result.document.inference.prediction.document_type.value
320
341
  ```
@@ -349,6 +370,20 @@ end
349
370
  puts result.document.inference.prediction.locale.value
350
371
  ```
351
372
 
373
+ ## Payment Date
374
+ **payment_date** ([DateField](#date-field)): The date on which the payment is due / fullfilled.
375
+
376
+ ```rb
377
+ puts result.document.inference.prediction.payment_date.value
378
+ ```
379
+
380
+ ## Purchase Order Number
381
+ **po_number** ([StringField](#string-field)): The purchase order number.
382
+
383
+ ```rb
384
+ puts result.document.inference.prediction.po_number.value
385
+ ```
386
+
352
387
  ## Receipt Number
353
388
  **receipt_number** ([StringField](#string-field)): The receipt number or identifier only if document is a receipt.
354
389
 
@@ -375,6 +410,13 @@ puts result.document.inference.prediction.shipping_address.value
375
410
  ## Purchase Subcategory
376
411
  **subcategory** ([ClassificationField](#classification-field)): The purchase subcategory among predefined classes for transport and food.
377
412
 
413
+ #### Possible values include:
414
+ - plane
415
+ - taxi
416
+ - train
417
+ - restaurant
418
+ - shopping
419
+
378
420
  ```rb
379
421
  puts result.document.inference.prediction.subcategory.value
380
422
  ```
data/docs/generated_v1.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ---
2
2
  title: Generated API Ruby
3
+ category: 622b805aaec68102ea7fcbc2
4
+ slug: ruby-generated-ocr
5
+ parentDoc: 6294d97ee723f1008d2ab28e
3
6
  ---
4
7
  The Ruby OCR SDK supports generated APIs.
5
8
  Generated APIs can theoretically support all APIs in a catch-all generic format.
@@ -1,5 +1,8 @@
1
1
  ---
2
2
  title: Ruby Getting Started
3
+ category: 622b805aaec68102ea7fcbc2
4
+ slug: ruby-getting-started
5
+ parentDoc: 6294d97ee723f1008d2ab28e
3
6
  ---
4
7
  This guide will help you get the most out of the Mindee Ruby client library to easily extract data from your documents.
5
8
 
data/docs/idcard_fr_v2.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ---
2
2
  title: FR Carte Nationale d'Identité OCR Ruby
3
+ category: 622b805aaec68102ea7fcbc2
4
+ slug: ruby-fr-carte-nationale-didentite-ocr
5
+ parentDoc: 6294d97ee723f1008d2ab28e
3
6
  ---
4
7
  The Ruby OCR SDK supports the [Carte Nationale d'Identité API](https://platform.mindee.com/mindee/idcard_fr).
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):**
@@ -98,7 +102,7 @@ A typical `Field` object will have the following attributes:
98
102
  * **confidence** (Float, nil): the confidence score of the field prediction.
99
103
  * **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
100
104
  * **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
101
- * **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
105
+ * **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
102
106
  * **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
103
107
 
104
108
 
@@ -119,7 +123,7 @@ Aside from the basic `Field` attributes, the date field `DateField` also impleme
119
123
  The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
120
124
 
121
125
  ## Page-Level Fields
122
- Some fields are constrained to the page level, and so will not be retrievable to through the document.
126
+ Some fields are constrained to the page level, and so will not be retrievable at document level.
123
127
 
124
128
  # Attributes
125
129
  The following fields are extracted for Carte Nationale d'Identité V2:
@@ -169,6 +173,11 @@ puts result.document.inference.prediction.document_number.value
169
173
  ## Document Sides
170
174
  [📄](#page-level-fields "This field is only present on individual pages.")**document_side** ([ClassificationField](#classification-field)): The sides of the document which are visible.
171
175
 
176
+ #### Possible values include:
177
+ - RECTO
178
+ - VERSO
179
+ - RECTO & VERSO
180
+
172
181
  ```rb
173
182
  for document_side_elem in result.document.document_side do
174
183
  puts document_side_elem.value
@@ -178,6 +187,10 @@ end
178
187
  ## Document Type
179
188
  [📄](#page-level-fields "This field is only present on individual pages.")**document_type** ([ClassificationField](#classification-field)): The document type or format.
180
189
 
190
+ #### Possible values include:
191
+ - NEW
192
+ - OLD
193
+
181
194
  ```rb
182
195
  for document_type_elem in result.document.document_type do
183
196
  puts document_type_elem.value
@@ -1,5 +1,8 @@
1
1
  ---
2
2
  title: International ID OCR Ruby
3
+ category: 622b805aaec68102ea7fcbc2
4
+ slug: ruby-international-id-ocr
5
+ parentDoc: 6294d97ee723f1008d2ab28e
3
6
  ---
4
7
  The Ruby OCR SDK supports the [International ID API](https://platform.mindee.com/mindee/international_id).
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):**
@@ -76,7 +80,7 @@ A typical `Field` object will have the following attributes:
76
80
  * **confidence** (Float, nil): the confidence score of the field prediction.
77
81
  * **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
78
82
  * **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
79
- * **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
83
+ * **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
80
84
  * **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
81
85
 
82
86
 
@@ -137,6 +141,14 @@ puts result.document.inference.prediction.document_number.value
137
141
  ## Document Type
138
142
  **document_type** ([ClassificationField](#classification-field)): The type of personal identification document.
139
143
 
144
+ #### Possible values include:
145
+ - IDENTIFICATION_CARD
146
+ - PASSPORT
147
+ - DRIVER_LICENSE
148
+ - VISA
149
+ - RESIDENCY_CARD
150
+ - VOTER_REGISTRATION
151
+
140
152
  ```rb
141
153
  puts result.document.inference.prediction.document_type.value
142
154
  ```