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
@@ -0,0 +1,156 @@
1
+ ---
2
+ title: Driver License OCR Ruby
3
+ category: 622b805aaec68102ea7fcbc2
4
+ slug: ruby-driver-license-ocr
5
+ parentDoc: 6294d97ee723f1008d2ab28e
6
+ ---
7
+ The Ruby OCR SDK supports the [Driver License API](https://platform.mindee.com/mindee/driver_license).
8
+
9
+ The [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/driver_license/default_sample.jpg) can be used for testing purposes.
10
+ ![Driver License sample](https://github.com/mindee/client-lib-test-data/blob/main/products/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.enqueue_and_parse(
24
+ input_source,
25
+ Mindee::Product::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
+ # Field Types
36
+ ## Standard Fields
37
+ These fields are generic and used in several products.
38
+
39
+ ### Basic Field
40
+ Each prediction object contains a set of fields that inherit from the generic `Field` class.
41
+ A typical `Field` object will have the following attributes:
42
+
43
+ * **value** (`String`, `Float`, `Integer`, `Boolean`): corresponds to the field value. Can be `nil` if no value was extracted.
44
+ * **confidence** (Float, nil): the confidence score of the field prediction.
45
+ * **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
46
+ * **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
47
+ * **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
48
+ * **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
49
+
50
+
51
+ Aside from the previous attributes, all basic fields have access to a `to_s` method that can be used to print their value as a string.
52
+
53
+ ### Date Field
54
+ Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
55
+
56
+ * **date_object** (`Date`): an accessible representation of the value as a JavaScript object.
57
+
58
+ ### String Field
59
+ The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
60
+
61
+ # Attributes
62
+ The following fields are extracted for Driver License V1:
63
+
64
+ ## Category
65
+ **category** ([StringField](#string-field)): The category or class of the driver license.
66
+
67
+ ```rb
68
+ puts result.document.inference.prediction.category.value
69
+ ```
70
+
71
+ ## Country Code
72
+ **country_code** ([StringField](#string-field)): The alpha-3 ISO 3166 code of the country where the driver license was issued.
73
+
74
+ ```rb
75
+ puts result.document.inference.prediction.country_code.value
76
+ ```
77
+
78
+ ## Date of Birth
79
+ **date_of_birth** ([DateField](#date-field)): The date of birth of the driver license holder.
80
+
81
+ ```rb
82
+ puts result.document.inference.prediction.date_of_birth.value
83
+ ```
84
+
85
+ ## DD Number
86
+ **dd_number** ([StringField](#string-field)): The DD number of the driver license.
87
+
88
+ ```rb
89
+ puts result.document.inference.prediction.dd_number.value
90
+ ```
91
+
92
+ ## Expiry Date
93
+ **expiry_date** ([DateField](#date-field)): The expiry date of the driver license.
94
+
95
+ ```rb
96
+ puts result.document.inference.prediction.expiry_date.value
97
+ ```
98
+
99
+ ## First Name
100
+ **first_name** ([StringField](#string-field)): The first name of the driver license holder.
101
+
102
+ ```rb
103
+ puts result.document.inference.prediction.first_name.value
104
+ ```
105
+
106
+ ## ID
107
+ **id** ([StringField](#string-field)): The unique identifier of the driver license.
108
+
109
+ ```rb
110
+ puts result.document.inference.prediction.id.value
111
+ ```
112
+
113
+ ## Issued Date
114
+ **issued_date** ([DateField](#date-field)): The date when the driver license was issued.
115
+
116
+ ```rb
117
+ puts result.document.inference.prediction.issued_date.value
118
+ ```
119
+
120
+ ## Issuing Authority
121
+ **issuing_authority** ([StringField](#string-field)): The authority that issued the driver license.
122
+
123
+ ```rb
124
+ puts result.document.inference.prediction.issuing_authority.value
125
+ ```
126
+
127
+ ## Last Name
128
+ **last_name** ([StringField](#string-field)): The last name of the driver license holder.
129
+
130
+ ```rb
131
+ puts result.document.inference.prediction.last_name.value
132
+ ```
133
+
134
+ ## MRZ
135
+ **mrz** ([StringField](#string-field)): The Machine Readable Zone (MRZ) of the driver license.
136
+
137
+ ```rb
138
+ puts result.document.inference.prediction.mrz.value
139
+ ```
140
+
141
+ ## Place of Birth
142
+ **place_of_birth** ([StringField](#string-field)): The place of birth of the driver license holder.
143
+
144
+ ```rb
145
+ puts result.document.inference.prediction.place_of_birth.value
146
+ ```
147
+
148
+ ## State
149
+ **state** ([StringField](#string-field)): Second part of the ISO 3166-2 code, consisting of two letters indicating the US State.
150
+
151
+ ```rb
152
+ puts result.document.inference.prediction.state.value
153
+ ```
154
+
155
+ # Questions?
156
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -6,8 +6,8 @@ parentDoc: 6294d97ee723f1008d2ab28e
6
6
  ---
7
7
  The Ruby OCR SDK supports the [Energy Bill API](https://platform.mindee.com/mindee/energy_bill_fra).
8
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)
9
+ Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/energy_bill_fra/default_sample.pdf), 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.pdf?raw=true)
11
11
 
12
12
  # Quick-Start
13
13
  ```rb
@@ -33,6 +33,31 @@ puts result.document
33
33
 
34
34
  ```
35
35
 
36
+ You can also call this product asynchronously:
37
+
38
+ ```rb
39
+ require 'mindee'
40
+
41
+ # Init a new client
42
+ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
43
+
44
+ # Load a file from disk
45
+ input_source = mindee_client.source_from_path('/path/to/the/file.ext')
46
+
47
+ # Parse the file
48
+ result = mindee_client.enqueue_and_parse(
49
+ input_source,
50
+ Mindee::Product::Receipt::ReceiptV5
51
+ )
52
+
53
+ # Print a full summary of the parsed data in RST format
54
+ puts result.document
55
+
56
+ # Print the document-level parsed data
57
+ # puts result.document.inference.prediction
58
+
59
+ ```
60
+
36
61
  **Output (RST):**
37
62
  ```rst
38
63
  ########
@@ -50,7 +75,7 @@ Prediction
50
75
  ==========
51
76
  :Expense Locale: en-GB; en; GB; GBP;
52
77
  :Purchase Category: food
53
- :Purchase Subcategory:
78
+ :Purchase Subcategory: restaurant
54
79
  :Document Type: EXPENSE RECEIPT
55
80
  :Purchase Date: 2016-02-26
56
81
  :Purchase Time: 15:20
@@ -84,7 +109,7 @@ Page 0
84
109
  ------
85
110
  :Expense Locale: en-GB; en; GB; GBP;
86
111
  :Purchase Category: food
87
- :Purchase Subcategory:
112
+ :Purchase Subcategory: restaurant
88
113
  :Document Type: EXPENSE RECEIPT
89
114
  :Purchase Date: 2016-02-26
90
115
  :Purchase Time: 15:20
@@ -63,23 +63,25 @@ puts result.document
63
63
  ########
64
64
  Document
65
65
  ########
66
- :Mindee ID: 3859a462-e05f-4f4c-a736-febca66b9aa9
66
+ :Mindee ID: b26161ce-35d0-4984-b1ff-886645e160e6
67
67
  :Filename: default_sample.jpg
68
68
 
69
69
  Inference
70
70
  #########
71
- :Product: mindee/financial_document v1.9
71
+ :Product: mindee/financial_document v1.11
72
72
  :Rotation applied: Yes
73
73
 
74
74
  Prediction
75
75
  ==========
76
- :Locale: en; en; USD;
76
+ :Locale: en-US; en; US; USD;
77
77
  :Invoice Number: INT-001
78
+ :Purchase Order Number: 2412/2019
78
79
  :Receipt Number:
79
80
  :Document Number: INT-001
80
81
  :Reference Numbers: 2412/2019
81
82
  :Purchase Date: 2019-11-02
82
83
  :Due Date: 2019-02-26
84
+ :Payment Date: 2019-02-26
83
85
  :Total Net: 195.00
84
86
  :Total Amount: 204.75
85
87
  :Taxes:
@@ -123,13 +125,15 @@ Page Predictions
123
125
 
124
126
  Page 0
125
127
  ------
126
- :Locale: en; en; USD;
128
+ :Locale: en-US; en; US; USD;
127
129
  :Invoice Number: INT-001
130
+ :Purchase Order Number: 2412/2019
128
131
  :Receipt Number:
129
132
  :Document Number: INT-001
130
133
  :Reference Numbers: 2412/2019
131
134
  :Purchase Date: 2019-11-02
132
135
  :Due Date: 2019-02-26
136
+ :Payment Date: 2019-02-26
133
137
  :Total Net: 195.00
134
138
  :Total Amount: 204.75
135
139
  :Taxes:
@@ -1,13 +1,13 @@
1
1
  ---
2
- title: FR Carte Vitale OCR Ruby
2
+ title: FR Health Card OCR Ruby
3
3
  category: 622b805aaec68102ea7fcbc2
4
- slug: ruby-fr-carte-vitale-ocr
4
+ slug: ruby-fr-health-card-ocr
5
5
  parentDoc: 6294d97ee723f1008d2ab28e
6
6
  ---
7
- The Ruby OCR SDK supports the [Carte Vitale API](https://platform.mindee.com/mindee/carte_vitale).
7
+ The Ruby OCR SDK supports the [Health Card API](https://platform.mindee.com/mindee/french_healthcard).
8
8
 
9
- Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/carte_vitale/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
10
- ![Carte Vitale sample](https://github.com/mindee/client-lib-test-data/blob/main/products/carte_vitale/default_sample.jpg?raw=true)
9
+ Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/french_healthcard/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
10
+ ![Health Card sample](https://github.com/mindee/client-lib-test-data/blob/main/products/french_healthcard/default_sample.jpg?raw=true)
11
11
 
12
12
  # Quick-Start
13
13
  ```rb
@@ -20,9 +20,9 @@ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
20
20
  input_source = mindee_client.source_from_path('/path/to/the/file.ext')
21
21
 
22
22
  # Parse the file
23
- result = mindee_client.parse(
23
+ result = mindee_client.enqueue_and_parse(
24
24
  input_source,
25
- Mindee::Product::FR::CarteVitale::CarteVitaleV1
25
+ Mindee::Product::FR::HealthCard::HealthCardV1
26
26
  )
27
27
 
28
28
  # Print a full summary of the parsed data in RST format
@@ -38,29 +38,19 @@ puts result.document
38
38
  ########
39
39
  Document
40
40
  ########
41
- :Mindee ID: 8c25cc63-212b-4537-9c9b-3fbd3bd0ee20
41
+ :Mindee ID: 9ee2733d-933a-4dcd-a73a-a31395e3b288
42
42
  :Filename: default_sample.jpg
43
43
 
44
44
  Inference
45
45
  #########
46
- :Product: mindee/carte_vitale v1.0
46
+ :Product: mindee/french_healthcard v1.0
47
47
  :Rotation applied: Yes
48
48
 
49
49
  Prediction
50
50
  ==========
51
51
  :Given Name(s): NATHALIE
52
52
  :Surname: DURAND
53
- :Social Security Number: 269054958815780
54
- :Issuance Date: 2007-01-01
55
-
56
- Page Predictions
57
- ================
58
-
59
- Page 0
60
- ------
61
- :Given Name(s): NATHALIE
62
- :Surname: DURAND
63
- :Social Security Number: 269054958815780
53
+ :Social Security Number: 2 69 05 49 588 157 80
64
54
  :Issuance Date: 2007-01-01
65
55
  ```
66
56
 
@@ -91,10 +81,10 @@ Aside from the basic `Field` attributes, the date field `DateField` also impleme
91
81
  The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
92
82
 
93
83
  # Attributes
94
- The following fields are extracted for Carte Vitale V1:
84
+ The following fields are extracted for Health Card V1:
95
85
 
96
86
  ## Given Name(s)
97
- **given_names** (Array<[StringField](#string-field)>): The given name(s) of the card holder.
87
+ **given_names** (Array<[StringField](#string-field)>): The given names of the card holder.
98
88
 
99
89
  ```rb
100
90
  for given_names_elem in result.document.inference.prediction.given_names do
@@ -103,14 +93,14 @@ end
103
93
  ```
104
94
 
105
95
  ## Issuance Date
106
- **issuance_date** ([DateField](#date-field)): The date the card was issued.
96
+ **issuance_date** ([DateField](#date-field)): The date when the carte vitale document was issued.
107
97
 
108
98
  ```rb
109
99
  puts result.document.inference.prediction.issuance_date.value
110
100
  ```
111
101
 
112
102
  ## Social Security Number
113
- **social_security** ([StringField](#string-field)): The Social Security Number (Numéro de Sécurité Sociale) of the card holder
103
+ **social_security** ([StringField](#string-field)): The social security number of the card holder.
114
104
 
115
105
  ```rb
116
106
  puts result.document.inference.prediction.social_security.value
@@ -0,0 +1,281 @@
1
+ ---
2
+ title: IND Passport - India OCR Ruby
3
+ category: 622b805aaec68102ea7fcbc2
4
+ slug: ruby-ind-passport---india-ocr
5
+ parentDoc: 6294d97ee723f1008d2ab28e
6
+ ---
7
+ The Ruby OCR SDK supports the [Passport - India API](https://platform.mindee.com/mindee/ind_passport).
8
+
9
+ Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/ind_passport/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
10
+ ![Passport - India sample](https://github.com/mindee/client-lib-test-data/blob/main/products/ind_passport/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::IND::IndianPassport::IndianPassportV1
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: cf88fd43-eaa1-497a-ba29-a9569a4edaa7
42
+ :Filename: default_sample.jpg
43
+
44
+ Inference
45
+ #########
46
+ :Product: mindee/ind_passport v1.0
47
+ :Rotation applied: Yes
48
+
49
+ Prediction
50
+ ==========
51
+ :Page Number: 1
52
+ :Country: IND
53
+ :ID Number: J8369854
54
+ :Given Names: JOCELYN MICHELLE
55
+ :Surname: DOE
56
+ :Birth Date: 1959-09-23
57
+ :Birth Place: GUNDUGOLANU
58
+ :Issuance Place: HYDERABAD
59
+ :Gender: F
60
+ :Issuance Date: 2011-10-11
61
+ :Expiry Date: 2021-10-10
62
+ :MRZ Line 1: P<DOE<<JOCELYNMICHELLE<<<<<<<<<<<<<<<<<<<<<
63
+ :MRZ Line 2: J8369854<4IND5909234F2110101<<<<<<<<<<<<<<<8
64
+ :Legal Guardian:
65
+ :Name of Spouse:
66
+ :Name of Mother:
67
+ :Old Passport Date of Issue:
68
+ :Old Passport Number:
69
+ :Address Line 1:
70
+ :Address Line 2:
71
+ :Address Line 3:
72
+ :Old Passport Place of Issue:
73
+ :File Number:
74
+ ```
75
+
76
+ # Field Types
77
+ ## Standard Fields
78
+ These fields are generic and used in several products.
79
+
80
+ ### Basic Field
81
+ Each prediction object contains a set of fields that inherit from the generic `Field` class.
82
+ A typical `Field` object will have the following attributes:
83
+
84
+ * **value** (`String`, `Float`, `Integer`, `Boolean`): corresponds to the field value. Can be `nil` if no value was extracted.
85
+ * **confidence** (Float, nil): the confidence score of the field prediction.
86
+ * **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
87
+ * **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
88
+ * **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
89
+ * **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
90
+
91
+
92
+ 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.
93
+
94
+
95
+ ### Classification Field
96
+ The classification field `ClassificationField` does not implement all the basic `Field` attributes. It only implements **value**, **confidence** and **page_id**.
97
+
98
+ > Note: a classification field's `value is always a `String`.
99
+
100
+ ### Date Field
101
+ Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
102
+
103
+ * **date_object** (`Date`): an accessible representation of the value as a JavaScript object.
104
+
105
+ ### String Field
106
+ The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
107
+
108
+ # Attributes
109
+ The following fields are extracted for Passport - India V1:
110
+
111
+ ## Address Line 1
112
+ **address1** ([StringField](#string-field)): The first line of the address of the passport holder.
113
+
114
+ ```rb
115
+ puts result.document.inference.prediction.address1.value
116
+ ```
117
+
118
+ ## Address Line 2
119
+ **address2** ([StringField](#string-field)): The second line of the address of the passport holder.
120
+
121
+ ```rb
122
+ puts result.document.inference.prediction.address2.value
123
+ ```
124
+
125
+ ## Address Line 3
126
+ **address3** ([StringField](#string-field)): The third line of the address of the passport holder.
127
+
128
+ ```rb
129
+ puts result.document.inference.prediction.address3.value
130
+ ```
131
+
132
+ ## Birth Date
133
+ **birth_date** ([DateField](#date-field)): The birth date of the passport holder, ISO format: YYYY-MM-DD.
134
+
135
+ ```rb
136
+ puts result.document.inference.prediction.birth_date.value
137
+ ```
138
+
139
+ ## Birth Place
140
+ **birth_place** ([StringField](#string-field)): The birth place of the passport holder.
141
+
142
+ ```rb
143
+ puts result.document.inference.prediction.birth_place.value
144
+ ```
145
+
146
+ ## Country
147
+ **country** ([StringField](#string-field)): ISO 3166-1 alpha-3 country code (3 letters format).
148
+
149
+ ```rb
150
+ puts result.document.inference.prediction.country.value
151
+ ```
152
+
153
+ ## Expiry Date
154
+ **expiry_date** ([DateField](#date-field)): The date when the passport will expire, ISO format: YYYY-MM-DD.
155
+
156
+ ```rb
157
+ puts result.document.inference.prediction.expiry_date.value
158
+ ```
159
+
160
+ ## File Number
161
+ **file_number** ([StringField](#string-field)): The file number of the passport document.
162
+
163
+ ```rb
164
+ puts result.document.inference.prediction.file_number.value
165
+ ```
166
+
167
+ ## Gender
168
+ **gender** ([ClassificationField](#classification-field)): The gender of the passport holder.
169
+
170
+ #### Possible values include:
171
+ - M
172
+ - F
173
+
174
+ ```rb
175
+ puts result.document.inference.prediction.gender.value
176
+ ```
177
+
178
+ ## Given Names
179
+ **given_names** ([StringField](#string-field)): The given names of the passport holder.
180
+
181
+ ```rb
182
+ puts result.document.inference.prediction.given_names.value
183
+ ```
184
+
185
+ ## ID Number
186
+ **id_number** ([StringField](#string-field)): The identification number of the passport document.
187
+
188
+ ```rb
189
+ puts result.document.inference.prediction.id_number.value
190
+ ```
191
+
192
+ ## Issuance Date
193
+ **issuance_date** ([DateField](#date-field)): The date when the passport was issued, ISO format: YYYY-MM-DD.
194
+
195
+ ```rb
196
+ puts result.document.inference.prediction.issuance_date.value
197
+ ```
198
+
199
+ ## Issuance Place
200
+ **issuance_place** ([StringField](#string-field)): The place where the passport was issued.
201
+
202
+ ```rb
203
+ puts result.document.inference.prediction.issuance_place.value
204
+ ```
205
+
206
+ ## Legal Guardian
207
+ **legal_guardian** ([StringField](#string-field)): The name of the legal guardian of the passport holder (if applicable).
208
+
209
+ ```rb
210
+ puts result.document.inference.prediction.legal_guardian.value
211
+ ```
212
+
213
+ ## MRZ Line 1
214
+ **mrz1** ([StringField](#string-field)): The first line of the machine-readable zone (MRZ) of the passport document.
215
+
216
+ ```rb
217
+ puts result.document.inference.prediction.mrz1.value
218
+ ```
219
+
220
+ ## MRZ Line 2
221
+ **mrz2** ([StringField](#string-field)): The second line of the machine-readable zone (MRZ) of the passport document.
222
+
223
+ ```rb
224
+ puts result.document.inference.prediction.mrz2.value
225
+ ```
226
+
227
+ ## Name of Mother
228
+ **name_of_mother** ([StringField](#string-field)): The name of the mother of the passport holder.
229
+
230
+ ```rb
231
+ puts result.document.inference.prediction.name_of_mother.value
232
+ ```
233
+
234
+ ## Name of Spouse
235
+ **name_of_spouse** ([StringField](#string-field)): The name of the spouse of the passport holder (if applicable).
236
+
237
+ ```rb
238
+ puts result.document.inference.prediction.name_of_spouse.value
239
+ ```
240
+
241
+ ## Old Passport Date of Issue
242
+ **old_passport_date_of_issue** ([DateField](#date-field)): The date of issue of the old passport (if applicable), ISO format: YYYY-MM-DD.
243
+
244
+ ```rb
245
+ puts result.document.inference.prediction.old_passport_date_of_issue.value
246
+ ```
247
+
248
+ ## Old Passport Number
249
+ **old_passport_number** ([StringField](#string-field)): The number of the old passport (if applicable).
250
+
251
+ ```rb
252
+ puts result.document.inference.prediction.old_passport_number.value
253
+ ```
254
+
255
+ ## Old Passport Place of Issue
256
+ **old_passport_place_of_issue** ([StringField](#string-field)): The place of issue of the old passport (if applicable).
257
+
258
+ ```rb
259
+ puts result.document.inference.prediction.old_passport_place_of_issue.value
260
+ ```
261
+
262
+ ## Page Number
263
+ **page_number** ([ClassificationField](#classification-field)): The page number of the passport document.
264
+
265
+ #### Possible values include:
266
+ - 1
267
+ - 2
268
+
269
+ ```rb
270
+ puts result.document.inference.prediction.page_number.value
271
+ ```
272
+
273
+ ## Surname
274
+ **surname** ([StringField](#string-field)): The surname of the passport holder.
275
+
276
+ ```rb
277
+ puts result.document.inference.prediction.surname.value
278
+ ```
279
+
280
+ # Questions?
281
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
data/docs/invoices_v4.md CHANGED
@@ -63,21 +63,23 @@ puts result.document
63
63
  ########
64
64
  Document
65
65
  ########
66
- :Mindee ID: 372d9d08-59d8-4e1c-9622-06648c1c238b
66
+ :Mindee ID: a67b70ea-4b1e-4eac-ae75-dda47a7064ae
67
67
  :Filename: default_sample.jpg
68
68
 
69
69
  Inference
70
70
  #########
71
- :Product: mindee/invoices v4.7
71
+ :Product: mindee/invoices v4.9
72
72
  :Rotation applied: Yes
73
73
 
74
74
  Prediction
75
75
  ==========
76
- :Locale: en; en; CAD;
76
+ :Locale: en-CA; en; CA; CAD;
77
77
  :Invoice Number: 14
78
+ :Purchase Order Number: AD29094
78
79
  :Reference Numbers: AD29094
79
80
  :Purchase Date: 2018-09-25
80
- :Due Date:
81
+ :Due Date: 2011-12-01
82
+ :Payment Date: 2011-12-01
81
83
  :Total Net: 2145.00
82
84
  :Total Amount: 2608.20
83
85
  :Total Tax: 193.20
@@ -93,7 +95,7 @@ Prediction
93
95
  :Supplier Address: 156 University Ave, Toronto ON, Canada, M5H 2H7
94
96
  :Supplier Phone Number: 4165551212
95
97
  :Supplier Website:
96
- :Supplier Email: ldoi@example.com
98
+ :Supplier Email: j_coi@example.com
97
99
  :Customer Name: JIRO DOI
98
100
  :Customer Company Registrations:
99
101
  :Customer Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
@@ -117,11 +119,13 @@ Page Predictions
117
119
 
118
120
  Page 0
119
121
  ------
120
- :Locale: en; en; CAD;
122
+ :Locale: en-CA; en; CA; CAD;
121
123
  :Invoice Number: 14
124
+ :Purchase Order Number: AD29094
122
125
  :Reference Numbers: AD29094
123
126
  :Purchase Date: 2018-09-25
124
- :Due Date:
127
+ :Due Date: 2011-12-01
128
+ :Payment Date: 2011-12-01
125
129
  :Total Net: 2145.00
126
130
  :Total Amount: 2608.20
127
131
  :Total Tax: 193.20
@@ -137,7 +141,7 @@ Page 0
137
141
  :Supplier Address: 156 University Ave, Toronto ON, Canada, M5H 2H7
138
142
  :Supplier Phone Number: 4165551212
139
143
  :Supplier Website:
140
- :Supplier Email: ldoi@example.com
144
+ :Supplier Email: j_coi@example.com
141
145
  :Customer Name: JIRO DOI
142
146
  :Customer Company Registrations:
143
147
  :Customer Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada