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
@@ -0,0 +1,249 @@
|
|
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
|
+
The [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/energy_bill_fra/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::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
|
+
# 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
|
+
|
54
|
+
### Amount Field
|
55
|
+
The amount field `AmountField` only has one constraint: its **value** is a `Float` (or `nil`).
|
56
|
+
|
57
|
+
### Date Field
|
58
|
+
Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
|
59
|
+
|
60
|
+
* **date_object** (`Date`): an accessible representation of the value as a JavaScript object.
|
61
|
+
|
62
|
+
### String Field
|
63
|
+
The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
|
64
|
+
|
65
|
+
## Specific Fields
|
66
|
+
Fields which are specific to this product; they are not used in any other product.
|
67
|
+
|
68
|
+
### Energy Consumer Field
|
69
|
+
The entity that consumes the energy.
|
70
|
+
|
71
|
+
A `EnergyBillV1EnergyConsumer` implements the following attributes:
|
72
|
+
|
73
|
+
* `address` (String): The address of the energy consumer.
|
74
|
+
* `name` (String): The name of the energy consumer.
|
75
|
+
Fields which are specific to this product; they are not used in any other product.
|
76
|
+
|
77
|
+
### Energy Supplier Field
|
78
|
+
The company that supplies the energy.
|
79
|
+
|
80
|
+
A `EnergyBillV1EnergySupplier` implements the following attributes:
|
81
|
+
|
82
|
+
* `address` (String): The address of the energy supplier.
|
83
|
+
* `name` (String): The name of the energy supplier.
|
84
|
+
Fields which are specific to this product; they are not used in any other product.
|
85
|
+
|
86
|
+
### Energy Usage Field
|
87
|
+
Details of energy consumption.
|
88
|
+
|
89
|
+
A `EnergyBillV1EnergyUsage` implements the following attributes:
|
90
|
+
|
91
|
+
* `description` (String): Description or details of the energy usage.
|
92
|
+
* `end_date` (String): The end date of the energy usage.
|
93
|
+
* `start_date` (String): The start date of the energy usage.
|
94
|
+
* `tax_rate` (Float): The rate of tax applied to the total cost.
|
95
|
+
* `total` (Float): The total cost of energy consumed.
|
96
|
+
* `unit_price` (Float): The price per unit of energy consumed.
|
97
|
+
Fields which are specific to this product; they are not used in any other product.
|
98
|
+
|
99
|
+
### Meter Details Field
|
100
|
+
Information about the energy meter.
|
101
|
+
|
102
|
+
A `EnergyBillV1MeterDetail` implements the following attributes:
|
103
|
+
|
104
|
+
* `meter_number` (String): The unique identifier of the energy meter.
|
105
|
+
* `meter_type` (String): The type of energy meter.
|
106
|
+
|
107
|
+
#### Possible values include:
|
108
|
+
- electricity
|
109
|
+
- gas
|
110
|
+
- water
|
111
|
+
- None
|
112
|
+
|
113
|
+
* `unit` (String): The unit of measurement for energy consumption, which can be kW, m³, or L.
|
114
|
+
Fields which are specific to this product; they are not used in any other product.
|
115
|
+
|
116
|
+
### Subscription Field
|
117
|
+
The subscription details fee for the energy service.
|
118
|
+
|
119
|
+
A `EnergyBillV1Subscription` implements the following attributes:
|
120
|
+
|
121
|
+
* `description` (String): Description or details of the subscription.
|
122
|
+
* `end_date` (String): The end date of the subscription.
|
123
|
+
* `start_date` (String): The start date of the subscription.
|
124
|
+
* `tax_rate` (Float): The rate of tax applied to the total cost.
|
125
|
+
* `total` (Float): The total cost of subscription.
|
126
|
+
* `unit_price` (Float): The price per unit of subscription.
|
127
|
+
Fields which are specific to this product; they are not used in any other product.
|
128
|
+
|
129
|
+
### Taxes and Contributions Field
|
130
|
+
Details of Taxes and Contributions.
|
131
|
+
|
132
|
+
A `EnergyBillV1TaxesAndContribution` implements the following attributes:
|
133
|
+
|
134
|
+
* `description` (String): Description or details of the Taxes and Contributions.
|
135
|
+
* `end_date` (String): The end date of the Taxes and Contributions.
|
136
|
+
* `start_date` (String): The start date of the Taxes and Contributions.
|
137
|
+
* `tax_rate` (Float): The rate of tax applied to the total cost.
|
138
|
+
* `total` (Float): The total cost of Taxes and Contributions.
|
139
|
+
* `unit_price` (Float): The price per unit of Taxes and Contributions.
|
140
|
+
|
141
|
+
# Attributes
|
142
|
+
The following fields are extracted for Energy Bill V1:
|
143
|
+
|
144
|
+
## Contract ID
|
145
|
+
**contract_id** ([StringField](#string-field)): The unique identifier associated with a specific contract.
|
146
|
+
|
147
|
+
```rb
|
148
|
+
puts result.document.inference.prediction.contract_id.value
|
149
|
+
```
|
150
|
+
|
151
|
+
## Delivery Point
|
152
|
+
**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.
|
153
|
+
|
154
|
+
```rb
|
155
|
+
puts result.document.inference.prediction.delivery_point.value
|
156
|
+
```
|
157
|
+
|
158
|
+
## Due Date
|
159
|
+
**due_date** ([DateField](#date-field)): The date by which the payment for the energy invoice is due.
|
160
|
+
|
161
|
+
```rb
|
162
|
+
puts result.document.inference.prediction.due_date.value
|
163
|
+
```
|
164
|
+
|
165
|
+
## Energy Consumer
|
166
|
+
**energy_consumer** ([EnergyBillV1EnergyConsumer](#energy-consumer-field)): The entity that consumes the energy.
|
167
|
+
|
168
|
+
```rb
|
169
|
+
puts result.document.inference.prediction.energy_consumer.value
|
170
|
+
```
|
171
|
+
|
172
|
+
## Energy Supplier
|
173
|
+
**energy_supplier** ([EnergyBillV1EnergySupplier](#energy-supplier-field)): The company that supplies the energy.
|
174
|
+
|
175
|
+
```rb
|
176
|
+
puts result.document.inference.prediction.energy_supplier.value
|
177
|
+
```
|
178
|
+
|
179
|
+
## Energy Usage
|
180
|
+
**energy_usage** (Array<[EnergyBillV1EnergyUsage](#energy-usage-field)>): Details of energy consumption.
|
181
|
+
|
182
|
+
```rb
|
183
|
+
for energy_usage_elem in result.document.inference.prediction.energy_usage do
|
184
|
+
puts energy_usage_elem.value
|
185
|
+
end
|
186
|
+
```
|
187
|
+
|
188
|
+
## Invoice Date
|
189
|
+
**invoice_date** ([DateField](#date-field)): The date when the energy invoice was issued.
|
190
|
+
|
191
|
+
```rb
|
192
|
+
puts result.document.inference.prediction.invoice_date.value
|
193
|
+
```
|
194
|
+
|
195
|
+
## Invoice Number
|
196
|
+
**invoice_number** ([StringField](#string-field)): The unique identifier of the energy invoice.
|
197
|
+
|
198
|
+
```rb
|
199
|
+
puts result.document.inference.prediction.invoice_number.value
|
200
|
+
```
|
201
|
+
|
202
|
+
## Meter Details
|
203
|
+
**meter_details** ([EnergyBillV1MeterDetail](#meter-details-field)): Information about the energy meter.
|
204
|
+
|
205
|
+
```rb
|
206
|
+
puts result.document.inference.prediction.meter_details.value
|
207
|
+
```
|
208
|
+
|
209
|
+
## Subscription
|
210
|
+
**subscription** (Array<[EnergyBillV1Subscription](#subscription-field)>): The subscription details fee for the energy service.
|
211
|
+
|
212
|
+
```rb
|
213
|
+
for subscription_elem in result.document.inference.prediction.subscription do
|
214
|
+
puts subscription_elem.value
|
215
|
+
end
|
216
|
+
```
|
217
|
+
|
218
|
+
## Taxes and Contributions
|
219
|
+
**taxes_and_contributions** (Array<[EnergyBillV1TaxesAndContribution](#taxes-and-contributions-field)>): Details of Taxes and Contributions.
|
220
|
+
|
221
|
+
```rb
|
222
|
+
for taxes_and_contributions_elem in result.document.inference.prediction.taxes_and_contributions do
|
223
|
+
puts taxes_and_contributions_elem.value
|
224
|
+
end
|
225
|
+
```
|
226
|
+
|
227
|
+
## Total Amount
|
228
|
+
**total_amount** ([AmountField](#amount-field)): The total amount to be paid for the energy invoice.
|
229
|
+
|
230
|
+
```rb
|
231
|
+
puts result.document.inference.prediction.total_amount.value
|
232
|
+
```
|
233
|
+
|
234
|
+
## Total Before Taxes
|
235
|
+
**total_before_taxes** ([AmountField](#amount-field)): The total amount to be paid for the energy invoice before taxes.
|
236
|
+
|
237
|
+
```rb
|
238
|
+
puts result.document.inference.prediction.total_before_taxes.value
|
239
|
+
```
|
240
|
+
|
241
|
+
## Total Taxes
|
242
|
+
**total_taxes** ([AmountField](#amount-field)): Total of taxes applied to the invoice.
|
243
|
+
|
244
|
+
```rb
|
245
|
+
puts result.document.inference.prediction.total_taxes.value
|
246
|
+
```
|
247
|
+
|
248
|
+
# Questions?
|
249
|
+
[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,
|
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
|
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:
|
data/docs/expense_receipts_v5.md
CHANGED
@@ -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):**
|
@@ -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,
|
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,
|
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
|
```
|
@@ -375,6 +396,13 @@ puts result.document.inference.prediction.shipping_address.value
|
|
375
396
|
## Purchase Subcategory
|
376
397
|
**subcategory** ([ClassificationField](#classification-field)): The purchase subcategory among predefined classes for transport and food.
|
377
398
|
|
399
|
+
#### Possible values include:
|
400
|
+
- plane
|
401
|
+
- taxi
|
402
|
+
- train
|
403
|
+
- restaurant
|
404
|
+
- shopping
|
405
|
+
|
378
406
|
```rb
|
379
407
|
puts result.document.inference.prediction.subcategory.value
|
380
408
|
```
|
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.
|
data/docs/getting_started.md
CHANGED
@@ -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,
|
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
|
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
|
data/docs/international_id_v2.md
CHANGED
@@ -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,
|
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
|
```
|
data/docs/invoice_splitter_v1.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
---
|
2
2
|
title: Invoice Splitter API Ruby
|
3
|
+
category: 622b805aaec68102ea7fcbc2
|
4
|
+
slug: ruby-invoice-splitter-ocr
|
5
|
+
parentDoc: 6294d97ee723f1008d2ab28e
|
3
6
|
---
|
4
7
|
The Ruby OCR SDK supports the [Invoice Splitter API](https://platform.mindee.com/mindee/invoice_splitter).
|
5
8
|
|
@@ -33,30 +36,30 @@ puts result.document
|
|
33
36
|
########
|
34
37
|
Document
|
35
38
|
########
|
36
|
-
:Mindee ID:
|
37
|
-
:Filename: default_sample.
|
39
|
+
:Mindee ID: 15ad7a19-7b75-43d0-b0c6-9a641a12b49b
|
40
|
+
:Filename: default_sample.pdf
|
38
41
|
|
39
42
|
Inference
|
40
43
|
#########
|
41
|
-
:Product: mindee/
|
42
|
-
:Rotation applied:
|
44
|
+
:Product: mindee/invoice_splitter v1.1
|
45
|
+
:Rotation applied: No
|
43
46
|
|
44
47
|
Prediction
|
45
48
|
==========
|
46
|
-
:
|
47
|
-
:
|
48
|
-
:
|
49
|
-
:Issuance Date: 2007-01-01
|
49
|
+
:Invoice Page Groups:
|
50
|
+
:Page indexes: 0
|
51
|
+
:Page indexes: 1
|
50
52
|
|
51
53
|
Page Predictions
|
52
54
|
================
|
53
55
|
|
54
56
|
Page 0
|
55
57
|
------
|
56
|
-
:
|
57
|
-
|
58
|
-
|
59
|
-
|
58
|
+
:Invoice Page Groups:
|
59
|
+
|
60
|
+
Page 1
|
61
|
+
------
|
62
|
+
:Invoice Page Groups:
|
60
63
|
```
|
61
64
|
|
62
65
|
# Field Types
|
@@ -77,7 +80,7 @@ The following fields are extracted for Invoice Splitter V1:
|
|
77
80
|
|
78
81
|
```rb
|
79
82
|
for invoice_page_groups_elem in result.document.inference.prediction.invoice_page_groups do
|
80
|
-
puts
|
83
|
+
puts invoice_page_groups_elem.page_indexes.join(', ')
|
81
84
|
end
|
82
85
|
```
|
83
86
|
|