mindee 3.15.0 → 3.17.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 (70) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/bin/mindee.rb +20 -2
  4. data/docs/business_card_v1.md +169 -0
  5. data/docs/code_samples/{international_id_v1_async.txt → business_card_v1_async.txt} +1 -1
  6. data/docs/code_samples/delivery_notes_v1_async.txt +19 -0
  7. data/docs/code_samples/driver_license_v1_async.txt +19 -0
  8. data/docs/code_samples/expense_receipts_v5_async.txt +19 -0
  9. data/docs/code_samples/french_healthcard_v1_async.txt +19 -0
  10. data/docs/code_samples/ind_passport_v1_async.txt +19 -0
  11. data/docs/code_samples/payslip_fra_v3_async.txt +19 -0
  12. data/docs/code_samples/workflow_execution.txt +29 -0
  13. data/docs/delivery_notes_v1.md +143 -0
  14. data/docs/driver_license_v1.md +156 -0
  15. data/docs/energy_bill_fra_v1.md +2 -2
  16. data/docs/expense_receipts_v5.md +27 -2
  17. data/docs/financial_document_v1.md +8 -4
  18. data/docs/{carte_vitale_v1.md → french_healthcard_v1.md} +14 -24
  19. data/docs/ind_passport_v1.md +281 -0
  20. data/docs/invoices_v4.md +12 -8
  21. data/docs/payslip_fra_v3.md +319 -0
  22. data/docs/resume_v1.md +17 -16
  23. data/lib/mindee/client.rb +48 -8
  24. data/lib/mindee/http/workflow_endpoint.rb +90 -0
  25. data/lib/mindee/http.rb +1 -0
  26. data/lib/mindee/parsing/common/api_response.rb +22 -1
  27. data/lib/mindee/parsing/common/execution.rb +73 -0
  28. data/lib/mindee/parsing/common/execution_file.rb +24 -0
  29. data/lib/mindee/parsing/common/execution_priority.rb +30 -0
  30. data/lib/mindee/parsing/common.rb +3 -0
  31. data/lib/mindee/product/{international_id/international_id_v1.rb → business_card/business_card_v1.rb} +9 -9
  32. data/lib/mindee/product/business_card/business_card_v1_document.rb +85 -0
  33. data/lib/mindee/product/{international_id/international_id_v1_page.rb → business_card/business_card_v1_page.rb} +7 -7
  34. data/lib/mindee/product/delivery_note/delivery_note_v1.rb +39 -0
  35. data/lib/mindee/product/delivery_note/delivery_note_v1_document.rb +61 -0
  36. data/lib/mindee/product/delivery_note/delivery_note_v1_page.rb +32 -0
  37. data/lib/mindee/product/driver_license/driver_license_v1.rb +39 -0
  38. data/lib/mindee/product/driver_license/driver_license_v1_document.rb +91 -0
  39. data/lib/mindee/product/driver_license/driver_license_v1_page.rb +32 -0
  40. data/lib/mindee/product/financial_document/financial_document_v1_document.rb +1 -1
  41. data/lib/mindee/product/financial_document/financial_document_v1_page.rb +1 -1
  42. data/lib/mindee/product/fr/health_card/health_card_v1.rb +41 -0
  43. data/lib/mindee/product/fr/health_card/health_card_v1_document.rb +52 -0
  44. data/lib/mindee/product/fr/health_card/health_card_v1_page.rb +34 -0
  45. data/lib/mindee/product/fr/payslip/payslip_v3.rb +41 -0
  46. data/lib/mindee/product/fr/payslip/payslip_v3_bank_account_detail.rb +54 -0
  47. data/lib/mindee/product/fr/payslip/payslip_v3_document.rb +166 -0
  48. data/lib/mindee/product/fr/payslip/payslip_v3_employee.rb +78 -0
  49. data/lib/mindee/product/fr/payslip/payslip_v3_employer.rb +78 -0
  50. data/lib/mindee/product/fr/payslip/payslip_v3_employment.rb +78 -0
  51. data/lib/mindee/product/fr/payslip/payslip_v3_page.rb +34 -0
  52. data/lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb +89 -0
  53. data/lib/mindee/product/fr/payslip/payslip_v3_pay_detail.rb +100 -0
  54. data/lib/mindee/product/fr/payslip/payslip_v3_pay_period.rb +66 -0
  55. data/lib/mindee/product/fr/payslip/payslip_v3_salary_detail.rb +89 -0
  56. data/lib/mindee/product/ind/indian_passport/indian_passport_v1.rb +41 -0
  57. data/lib/mindee/product/ind/indian_passport/indian_passport_v1_document.rb +143 -0
  58. data/lib/mindee/product/ind/indian_passport/indian_passport_v1_page.rb +34 -0
  59. data/lib/mindee/product/invoice/invoice_v4_document.rb +1 -1
  60. data/lib/mindee/product/invoice/invoice_v4_page.rb +1 -1
  61. data/lib/mindee/product/resume/resume_v1_document.rb +3 -1
  62. data/lib/mindee/product/resume/resume_v1_page.rb +1 -1
  63. data/lib/mindee/product/resume/resume_v1_professional_experience.rb +8 -0
  64. data/lib/mindee/product.rb +13 -8
  65. data/lib/mindee/version.rb +1 -1
  66. metadata +46 -10
  67. data/docs/eu_driver_license_v1.md +0 -227
  68. data/docs/proof_of_address_v1.md +0 -211
  69. data/docs/us_driver_license_v1.md +0 -272
  70. data/lib/mindee/product/international_id/international_id_v1_document.rb +0 -109
@@ -2,15 +2,11 @@
2
2
 
3
3
  require_relative 'product/barcode_reader/barcode_reader_v1'
4
4
  require_relative 'product/bill_of_lading/bill_of_lading_v1'
5
+ require_relative 'product/business_card/business_card_v1'
5
6
  require_relative 'product/custom/custom_v1'
6
- require_relative 'product/proof_of_address/proof_of_address_v1'
7
- require_relative 'product/financial_document/financial_document_v1'
8
- require_relative 'product/invoice/invoice_v4'
9
7
  require_relative 'product/cropper/cropper_v1'
10
- require_relative 'product/multi_receipts_detector/multi_receipts_detector_v1'
11
- require_relative 'product/passport/passport_v1'
12
- require_relative 'product/receipt/receipt_v4'
13
- require_relative 'product/receipt/receipt_v5'
8
+ require_relative 'product/delivery_note/delivery_note_v1'
9
+ require_relative 'product/driver_license/driver_license_v1'
14
10
  require_relative 'product/eu/license_plate/license_plate_v1'
15
11
  require_relative 'product/eu/driver_license/driver_license_v1'
16
12
  require_relative 'product/fr/bank_account_details/bank_account_details_v1'
@@ -21,12 +17,21 @@ require_relative 'product/fr/carte_vitale/carte_vitale_v1'
21
17
  require_relative 'product/fr/id_card/id_card_v1'
22
18
  require_relative 'product/fr/id_card/id_card_v2'
23
19
  require_relative 'product/fr/energy_bill/energy_bill_v1'
20
+ require_relative 'product/fr/health_card/health_card_v1'
24
21
  require_relative 'product/fr/payslip/payslip_v2'
22
+ require_relative 'product/fr/payslip/payslip_v3'
23
+ require_relative 'product/financial_document/financial_document_v1'
25
24
  require_relative 'product/generated/generated_v1'
25
+ require_relative 'product/ind/indian_passport/indian_passport_v1'
26
+ require_relative 'product/invoice/invoice_v4'
26
27
  require_relative 'product/invoice_splitter/invoice_splitter_v1'
27
- require_relative 'product/international_id/international_id_v1'
28
28
  require_relative 'product/international_id/international_id_v2'
29
+ require_relative 'product/multi_receipts_detector/multi_receipts_detector_v1'
29
30
  require_relative 'product/nutrition_facts_label/nutrition_facts_label_v1'
31
+ require_relative 'product/passport/passport_v1'
32
+ require_relative 'product/proof_of_address/proof_of_address_v1'
33
+ require_relative 'product/receipt/receipt_v4'
34
+ require_relative 'product/receipt/receipt_v5'
30
35
  require_relative 'product/resume/resume_v1'
31
36
  require_relative 'product/us/bank_check/bank_check_v1'
32
37
  require_relative 'product/us/driver_license/driver_license_v1'
@@ -3,7 +3,7 @@
3
3
  # Mindee
4
4
  module Mindee
5
5
  # Current version.
6
- VERSION = '3.15.0'
6
+ VERSION = '3.17.0'
7
7
 
8
8
  # Finds and return the current platform.
9
9
  # @return [String]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mindee
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.15.0
4
+ version: 3.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mindee, SA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-29 00:00:00.000000000 Z
11
+ date: 2024-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: marcel
@@ -156,29 +156,34 @@ files:
156
156
  - docs/bank_statement_fr_v1.md
157
157
  - docs/barcode_reader_v1.md
158
158
  - docs/bill_of_lading_v1.md
159
+ - docs/business_card_v1.md
159
160
  - docs/carte_grise_v1.md
160
- - docs/carte_vitale_v1.md
161
161
  - docs/code_samples/bank_account_details_v1.txt
162
162
  - docs/code_samples/bank_account_details_v2.txt
163
163
  - docs/code_samples/bank_check_v1.txt
164
164
  - docs/code_samples/bank_statement_fr_v1_async.txt
165
165
  - docs/code_samples/barcode_reader_v1.txt
166
166
  - docs/code_samples/bill_of_lading_v1_async.txt
167
+ - docs/code_samples/business_card_v1_async.txt
167
168
  - docs/code_samples/carte_grise_v1.txt
168
169
  - docs/code_samples/carte_vitale_v1.txt
169
170
  - docs/code_samples/cropper_v1.txt
170
171
  - docs/code_samples/custom_v1.txt
171
172
  - docs/code_samples/default.txt
172
173
  - docs/code_samples/default_async.txt
174
+ - docs/code_samples/delivery_notes_v1_async.txt
175
+ - docs/code_samples/driver_license_v1_async.txt
173
176
  - docs/code_samples/energy_bill_fra_v1_async.txt
174
177
  - docs/code_samples/eu_driver_license_v1.txt
175
178
  - docs/code_samples/expense_receipts_v4.txt
176
179
  - docs/code_samples/expense_receipts_v5.txt
180
+ - docs/code_samples/expense_receipts_v5_async.txt
177
181
  - docs/code_samples/financial_document_v1.txt
178
182
  - docs/code_samples/financial_document_v1_async.txt
183
+ - docs/code_samples/french_healthcard_v1_async.txt
179
184
  - docs/code_samples/idcard_fr_v1.txt
180
185
  - docs/code_samples/idcard_fr_v2.txt
181
- - docs/code_samples/international_id_v1_async.txt
186
+ - docs/code_samples/ind_passport_v1_async.txt
182
187
  - docs/code_samples/international_id_v2_async.txt
183
188
  - docs/code_samples/invoice_splitter_v1_async.txt
184
189
  - docs/code_samples/invoices_v4.txt
@@ -188,21 +193,26 @@ files:
188
193
  - docs/code_samples/nutrition_facts_v1_async.txt
189
194
  - docs/code_samples/passport_v1.txt
190
195
  - docs/code_samples/payslip_fra_v2_async.txt
196
+ - docs/code_samples/payslip_fra_v3_async.txt
191
197
  - docs/code_samples/proof_of_address_v1.txt
192
198
  - docs/code_samples/resume_v1_async.txt
193
199
  - docs/code_samples/us_driver_license_v1.txt
194
200
  - docs/code_samples/us_healthcare_cards_v1_async.txt
195
201
  - docs/code_samples/us_mail_v2_async.txt
196
202
  - docs/code_samples/us_w9_v1.txt
203
+ - docs/code_samples/workflow_execution.txt
197
204
  - docs/cropper_v1.md
198
205
  - docs/custom_v1.md
206
+ - docs/delivery_notes_v1.md
207
+ - docs/driver_license_v1.md
199
208
  - docs/energy_bill_fra_v1.md
200
- - docs/eu_driver_license_v1.md
201
209
  - docs/expense_receipts_v5.md
202
210
  - docs/financial_document_v1.md
211
+ - docs/french_healthcard_v1.md
203
212
  - docs/generated_v1.md
204
213
  - docs/getting_started.md
205
214
  - docs/idcard_fr_v2.md
215
+ - docs/ind_passport_v1.md
206
216
  - docs/international_id_v2.md
207
217
  - docs/invoice_splitter_v1.md
208
218
  - docs/invoices_v4.md
@@ -211,9 +221,8 @@ files:
211
221
  - docs/nutrition_facts_v1.md
212
222
  - docs/passport_v1.md
213
223
  - docs/payslip_fra_v2.md
214
- - docs/proof_of_address_v1.md
224
+ - docs/payslip_fra_v3.md
215
225
  - docs/resume_v1.md
216
- - docs/us_driver_license_v1.md
217
226
  - docs/us_healthcare_cards_v1.md
218
227
  - docs/us_mail_v2.md
219
228
  - docs/us_w9_v1.md
@@ -244,6 +253,7 @@ files:
244
253
  - lib/mindee/http/endpoint.rb
245
254
  - lib/mindee/http/error.rb
246
255
  - lib/mindee/http/response_validation.rb
256
+ - lib/mindee/http/workflow_endpoint.rb
247
257
  - lib/mindee/image.rb
248
258
  - lib/mindee/image/image_compressor.rb
249
259
  - lib/mindee/image/image_utils.rb
@@ -254,6 +264,9 @@ files:
254
264
  - lib/mindee/parsing/common.rb
255
265
  - lib/mindee/parsing/common/api_response.rb
256
266
  - lib/mindee/parsing/common/document.rb
267
+ - lib/mindee/parsing/common/execution.rb
268
+ - lib/mindee/parsing/common/execution_file.rb
269
+ - lib/mindee/parsing/common/execution_priority.rb
257
270
  - lib/mindee/parsing/common/extras.rb
258
271
  - lib/mindee/parsing/common/extras/cropper_extra.rb
259
272
  - lib/mindee/parsing/common/extras/extras.rb
@@ -301,12 +314,21 @@ files:
301
314
  - lib/mindee/product/bill_of_lading/bill_of_lading_v1_notify_party.rb
302
315
  - lib/mindee/product/bill_of_lading/bill_of_lading_v1_page.rb
303
316
  - lib/mindee/product/bill_of_lading/bill_of_lading_v1_shipper.rb
317
+ - lib/mindee/product/business_card/business_card_v1.rb
318
+ - lib/mindee/product/business_card/business_card_v1_document.rb
319
+ - lib/mindee/product/business_card/business_card_v1_page.rb
304
320
  - lib/mindee/product/cropper/cropper_v1.rb
305
321
  - lib/mindee/product/cropper/cropper_v1_document.rb
306
322
  - lib/mindee/product/cropper/cropper_v1_page.rb
307
323
  - lib/mindee/product/custom/custom_v1.rb
308
324
  - lib/mindee/product/custom/custom_v1_document.rb
309
325
  - lib/mindee/product/custom/custom_v1_page.rb
326
+ - lib/mindee/product/delivery_note/delivery_note_v1.rb
327
+ - lib/mindee/product/delivery_note/delivery_note_v1_document.rb
328
+ - lib/mindee/product/delivery_note/delivery_note_v1_page.rb
329
+ - lib/mindee/product/driver_license/driver_license_v1.rb
330
+ - lib/mindee/product/driver_license/driver_license_v1_document.rb
331
+ - lib/mindee/product/driver_license/driver_license_v1_page.rb
310
332
  - lib/mindee/product/eu/driver_license/driver_license_v1.rb
311
333
  - lib/mindee/product/eu/driver_license/driver_license_v1_document.rb
312
334
  - lib/mindee/product/eu/driver_license/driver_license_v1_page.rb
@@ -343,6 +365,9 @@ files:
343
365
  - lib/mindee/product/fr/energy_bill/energy_bill_v1_page.rb
344
366
  - lib/mindee/product/fr/energy_bill/energy_bill_v1_subscription.rb
345
367
  - lib/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contribution.rb
368
+ - lib/mindee/product/fr/health_card/health_card_v1.rb
369
+ - lib/mindee/product/fr/health_card/health_card_v1_document.rb
370
+ - lib/mindee/product/fr/health_card/health_card_v1_page.rb
346
371
  - lib/mindee/product/fr/id_card/id_card_v1.rb
347
372
  - lib/mindee/product/fr/id_card/id_card_v1_document.rb
348
373
  - lib/mindee/product/fr/id_card/id_card_v1_page.rb
@@ -360,13 +385,24 @@ files:
360
385
  - lib/mindee/product/fr/payslip/payslip_v2_pay_period.rb
361
386
  - lib/mindee/product/fr/payslip/payslip_v2_pto.rb
362
387
  - lib/mindee/product/fr/payslip/payslip_v2_salary_detail.rb
388
+ - lib/mindee/product/fr/payslip/payslip_v3.rb
389
+ - lib/mindee/product/fr/payslip/payslip_v3_bank_account_detail.rb
390
+ - lib/mindee/product/fr/payslip/payslip_v3_document.rb
391
+ - lib/mindee/product/fr/payslip/payslip_v3_employee.rb
392
+ - lib/mindee/product/fr/payslip/payslip_v3_employer.rb
393
+ - lib/mindee/product/fr/payslip/payslip_v3_employment.rb
394
+ - lib/mindee/product/fr/payslip/payslip_v3_page.rb
395
+ - lib/mindee/product/fr/payslip/payslip_v3_paid_time_off.rb
396
+ - lib/mindee/product/fr/payslip/payslip_v3_pay_detail.rb
397
+ - lib/mindee/product/fr/payslip/payslip_v3_pay_period.rb
398
+ - lib/mindee/product/fr/payslip/payslip_v3_salary_detail.rb
363
399
  - lib/mindee/product/generated/generated_v1.rb
364
400
  - lib/mindee/product/generated/generated_v1_document.rb
365
401
  - lib/mindee/product/generated/generated_v1_page.rb
366
402
  - lib/mindee/product/generated/generated_v1_prediction.rb
367
- - lib/mindee/product/international_id/international_id_v1.rb
368
- - lib/mindee/product/international_id/international_id_v1_document.rb
369
- - lib/mindee/product/international_id/international_id_v1_page.rb
403
+ - lib/mindee/product/ind/indian_passport/indian_passport_v1.rb
404
+ - lib/mindee/product/ind/indian_passport/indian_passport_v1_document.rb
405
+ - lib/mindee/product/ind/indian_passport/indian_passport_v1_page.rb
370
406
  - lib/mindee/product/international_id/international_id_v2.rb
371
407
  - lib/mindee/product/international_id/international_id_v2_document.rb
372
408
  - lib/mindee/product/international_id/international_id_v2_page.rb
@@ -1,227 +0,0 @@
1
- ---
2
- title: EU Driver License OCR Ruby
3
- category: 622b805aaec68102ea7fcbc2
4
- slug: ruby-eu-driver-license-ocr
5
- parentDoc: 6294d97ee723f1008d2ab28e
6
- ---
7
- The Ruby OCR SDK supports the [Driver License API](https://platform.mindee.com/mindee/eu_driver_license).
8
-
9
- Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/eu_driver_license/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
10
- ![Driver License sample](https://github.com/mindee/client-lib-test-data/blob/main/products/eu_driver_license/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.parse(
24
- input_source,
25
- Mindee::Product::EU::DriverLicense::DriverLicenseV1
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: b19cc32e-b3e6-4ff9-bdc7-619199355d54
42
- :Filename: default_sample.jpg
43
-
44
- Inference
45
- #########
46
- :Product: mindee/eu_driver_license v1.0
47
- :Rotation applied: Yes
48
-
49
- Prediction
50
- ==========
51
- :Country Code: FR
52
- :Document ID: 13AA00002
53
- :Driver License Category: AM A1 B1 B D BE DE
54
- :Last Name: MARTIN
55
- :First Name: PAUL
56
- :Date Of Birth: 1981-07-14
57
- :Place Of Birth: Utopiacity
58
- :Expiry Date: 2018-12-31
59
- :Issue Date: 2013-01-01
60
- :Issue Authority: 99999UpiaCity
61
- :MRZ: D1FRA13AA000026181231MARTIN<<9
62
- :Address:
63
-
64
- Page Predictions
65
- ================
66
-
67
- Page 0
68
- ------
69
- :Photo: Polygon with 4 points.
70
- :Signature: Polygon with 4 points.
71
- :Country Code: FR
72
- :Document ID: 13AA00002
73
- :Driver License Category: AM A1 B1 B D BE DE
74
- :Last Name: MARTIN
75
- :First Name: PAUL
76
- :Date Of Birth: 1981-07-14
77
- :Place Of Birth: Utopiacity
78
- :Expiry Date: 2018-12-31
79
- :Issue Date: 2013-01-01
80
- :Issue Authority: 99999UpiaCity
81
- :MRZ: D1FRA13AA000026181231MARTIN<<9
82
- :Address:
83
- ```
84
-
85
- # Field Types
86
- ## Standard Fields
87
- These fields are generic and used in several products.
88
-
89
- ### Basic Field
90
- Each prediction object contains a set of fields that inherit from the generic `Field` class.
91
- A typical `Field` object will have the following attributes:
92
-
93
- * **value** (`String`, `Float`, `Integer`, `Boolean`): corresponds to the field value. Can be `nil` if no value was extracted.
94
- * **confidence** (Float, nil): the confidence score of the field prediction.
95
- * **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
96
- * **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
97
- * **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
98
- * **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
99
-
100
-
101
- 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.
102
-
103
- ### Date Field
104
- Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
105
-
106
- * **date_object** (`Date`): an accessible representation of the value as a JavaScript object.
107
-
108
-
109
- ### Position Field
110
- The position field `PositionField` does not implement all the basic `Field` attributes, only **bounding_box**, **polygon** and **page_id**. On top of these, it has access to:
111
-
112
- * **rectangle** (`Mindee::Geometry::Quadrilateral`): a Polygon with four points that may be oriented (even beyond canvas).
113
- * **quadrangle** (`Mindee::Geometry::Quadrilateral`): a free polygon made up of four points.
114
-
115
- ### String Field
116
- The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
117
-
118
- ## Page-Level Fields
119
- Some fields are constrained to the page level, and so will not be retrievable at document level.
120
-
121
- # Attributes
122
- The following fields are extracted for Driver License V1:
123
-
124
- ## Address
125
- **address** ([StringField](#string-field)): EU driver license holders address
126
-
127
- ```rb
128
- puts result.document.inference.prediction.address.value
129
- ```
130
-
131
- ## Driver License Category
132
- **category** ([StringField](#string-field)): EU driver license holders categories
133
-
134
- ```rb
135
- puts result.document.inference.prediction.category.value
136
- ```
137
-
138
- ## Country Code
139
- **country_code** ([StringField](#string-field)): Country code extracted as a string.
140
-
141
- ```rb
142
- puts result.document.inference.prediction.country_code.value
143
- ```
144
-
145
- ## Date Of Birth
146
- **date_of_birth** ([DateField](#date-field)): The date of birth of the document holder
147
-
148
- ```rb
149
- puts result.document.inference.prediction.date_of_birth.value
150
- ```
151
-
152
- ## Document ID
153
- **document_id** ([StringField](#string-field)): ID number of the Document.
154
-
155
- ```rb
156
- puts result.document.inference.prediction.document_id.value
157
- ```
158
-
159
- ## Expiry Date
160
- **expiry_date** ([DateField](#date-field)): Date the document expires
161
-
162
- ```rb
163
- puts result.document.inference.prediction.expiry_date.value
164
- ```
165
-
166
- ## First Name
167
- **first_name** ([StringField](#string-field)): First name(s) of the driver license holder
168
-
169
- ```rb
170
- puts result.document.inference.prediction.first_name.value
171
- ```
172
-
173
- ## Issue Authority
174
- **issue_authority** ([StringField](#string-field)): Authority that issued the document
175
-
176
- ```rb
177
- puts result.document.inference.prediction.issue_authority.value
178
- ```
179
-
180
- ## Issue Date
181
- **issue_date** ([DateField](#date-field)): Date the document was issued
182
-
183
- ```rb
184
- puts result.document.inference.prediction.issue_date.value
185
- ```
186
-
187
- ## Last Name
188
- **last_name** ([StringField](#string-field)): Last name of the driver license holder.
189
-
190
- ```rb
191
- puts result.document.inference.prediction.last_name.value
192
- ```
193
-
194
- ## MRZ
195
- **mrz** ([StringField](#string-field)): Machine-readable license number
196
-
197
- ```rb
198
- puts result.document.inference.prediction.mrz.value
199
- ```
200
-
201
- ## Photo
202
- [📄](#page-level-fields "This field is only present on individual pages.")**photo** ([PositionField](#position-field)): Has a photo of the EU driver license holder
203
-
204
- ```rb
205
- for photo_elem in result.document.photo do
206
- puts photo_elem.polygon
207
- end
208
- ```
209
-
210
- ## Place Of Birth
211
- **place_of_birth** ([StringField](#string-field)): Place where the driver license holder was born
212
-
213
- ```rb
214
- puts result.document.inference.prediction.place_of_birth.value
215
- ```
216
-
217
- ## Signature
218
- [📄](#page-level-fields "This field is only present on individual pages.")**signature** ([PositionField](#position-field)): Has a signature of the EU driver license holder
219
-
220
- ```rb
221
- for signature_elem in result.document.signature do
222
- puts signature_elem.polygon
223
- end
224
- ```
225
-
226
- # Questions?
227
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -1,211 +0,0 @@
1
- ---
2
- title: Proof of Address OCR Ruby
3
- category: 622b805aaec68102ea7fcbc2
4
- slug: ruby-proof-of-address-ocr
5
- parentDoc: 6294d97ee723f1008d2ab28e
6
- ---
7
- The Ruby OCR SDK supports the [Proof of Address API](https://platform.mindee.com/mindee/proof_of_address).
8
-
9
- Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/proof_of_address/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
10
- ![Proof of Address sample](https://github.com/mindee/client-lib-test-data/blob/main/products/proof_of_address/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.parse(
24
- input_source,
25
- Mindee::Product::ProofOfAddress::ProofOfAddressV1
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: 5d2361e9-405e-4fc1-8531-f92a3aef0c38
42
- :Filename: default_sample.jpg
43
-
44
- Inference
45
- #########
46
- :Product: mindee/proof_of_address v1.1
47
- :Rotation applied: Yes
48
-
49
- Prediction
50
- ==========
51
- :Locale: en; en; USD;
52
- :Issuer Name: PPL ELECTRIC UTILITIES
53
- :Issuer Company Registrations:
54
- :Issuer Address: 2 NORTH 9TH STREET CPC-GENN1 ALLENTOWN.PA 18101-1175
55
- :Recipient Name:
56
- :Recipient Company Registrations:
57
- :Recipient Address: 123 MAIN ST ANYTOWN,PA 18062
58
- :Dates: 2011-07-27
59
- 2011-07-06
60
- 2011-08-03
61
- 2011-07-27
62
- 2011-06-01
63
- 2011-07-01
64
- 2010-07-01
65
- 2010-08-01
66
- 2011-07-01
67
- 2009-08-01
68
- 2010-07-01
69
- 2011-07-27
70
- :Date of Issue: 2011-07-27
71
-
72
- Page Predictions
73
- ================
74
-
75
- Page 0
76
- ------
77
- :Locale: en; en; USD;
78
- :Issuer Name: PPL ELECTRIC UTILITIES
79
- :Issuer Company Registrations:
80
- :Issuer Address: 2 NORTH 9TH STREET CPC-GENN1 ALLENTOWN.PA 18101-1175
81
- :Recipient Name:
82
- :Recipient Company Registrations:
83
- :Recipient Address: 123 MAIN ST ANYTOWN,PA 18062
84
- :Dates: 2011-07-27
85
- 2011-07-06
86
- 2011-08-03
87
- 2011-07-27
88
- 2011-06-01
89
- 2011-07-01
90
- 2010-07-01
91
- 2010-08-01
92
- 2011-07-01
93
- 2009-08-01
94
- 2010-07-01
95
- 2011-07-27
96
- :Date of Issue: 2011-07-27
97
- ```
98
-
99
- # Field Types
100
- ## Standard Fields
101
- These fields are generic and used in several products.
102
-
103
- ### Basic Field
104
- Each prediction object contains a set of fields that inherit from the generic `Field` class.
105
- A typical `Field` object will have the following attributes:
106
-
107
- * **value** (`String`, `Float`, `Integer`, `Boolean`): corresponds to the field value. Can be `nil` if no value was extracted.
108
- * **confidence** (Float, nil): the confidence score of the field prediction.
109
- * **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
110
- * **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
111
- * **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
112
- * **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
113
-
114
-
115
- 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.
116
-
117
-
118
- ### Company Registration Field
119
- Aside from the basic `Field` attributes, the company registration field `CompanyRegistrationField` also implements the following:
120
-
121
- * **type** (`String`): the type of company.
122
-
123
- ### Date Field
124
- Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
125
-
126
- * **date_object** (`Date`): an accessible representation of the value as a JavaScript object.
127
-
128
- ### Locale Field
129
- The locale field `LocaleField` only implements the **value**, **confidence** and **page_id** base `Field` attributes, but it comes with its own:
130
-
131
- * **language** (`String`): ISO 639-1 language code (e.g.: `en` for English). Can be `nil`.
132
- * **country** (`String`): ISO 3166-1 alpha-2 or ISO 3166-1 alpha-3 code for countries (e.g.: `GRB` or `GB` for "Great Britain"). Can be `nil`.
133
- * **currency** (`String`): ISO 4217 code for currencies (e.g.: `USD` for "US Dollars"). Can be `nil`.
134
-
135
- ### String Field
136
- The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
137
-
138
- # Attributes
139
- The following fields are extracted for Proof of Address V1:
140
-
141
- ## Date of Issue
142
- **date** ([DateField](#date-field)): The date the document was issued.
143
-
144
- ```rb
145
- puts result.document.inference.prediction.date.value
146
- ```
147
-
148
- ## Dates
149
- **dates** (Array<[DateField](#date-field)>): List of dates found on the document.
150
-
151
- ```rb
152
- for dates_elem in result.document.inference.prediction.dates do
153
- puts dates_elem.value
154
- end
155
- ```
156
-
157
- ## Issuer Address
158
- **issuer_address** ([StringField](#string-field)): The address of the document's issuer.
159
-
160
- ```rb
161
- puts result.document.inference.prediction.issuer_address.value
162
- ```
163
-
164
- ## Issuer Company Registrations
165
- **issuer_company_registration** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company registrations found for the issuer.
166
-
167
- ```rb
168
- for issuer_company_registration_elem in result.document.inference.prediction.issuer_company_registration do
169
- puts issuer_company_registration_elem.value
170
- end
171
- ```
172
-
173
- ## Issuer Name
174
- **issuer_name** ([StringField](#string-field)): The name of the person or company issuing the document.
175
-
176
- ```rb
177
- puts result.document.inference.prediction.issuer_name.value
178
- ```
179
-
180
- ## Locale
181
- **locale** ([LocaleField](#locale-field)): The locale detected on the document.
182
-
183
- ```rb
184
- puts result.document.inference.prediction.locale.value
185
- ```
186
-
187
- ## Recipient Address
188
- **recipient_address** ([StringField](#string-field)): The address of the recipient.
189
-
190
- ```rb
191
- puts result.document.inference.prediction.recipient_address.value
192
- ```
193
-
194
- ## Recipient Company Registrations
195
- **recipient_company_registration** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company registrations found for the recipient.
196
-
197
- ```rb
198
- for recipient_company_registration_elem in result.document.inference.prediction.recipient_company_registration do
199
- puts recipient_company_registration_elem.value
200
- end
201
- ```
202
-
203
- ## Recipient Name
204
- **recipient_name** ([StringField](#string-field)): The name of the person or company receiving the document.
205
-
206
- ```rb
207
- puts result.document.inference.prediction.recipient_name.value
208
- ```
209
-
210
- # Questions?
211
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)