mindee 3.5.0 → 3.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/README.md +39 -4
  4. data/bin/mindee.rb +6 -0
  5. data/docs/bank_account_details_v2.md +1 -1
  6. data/docs/bank_check_v1.md +1 -1
  7. data/docs/bank_statement_fr_v1.md +1 -1
  8. data/docs/barcode_reader_v1.md +1 -1
  9. data/docs/carte_grise_v1.md +1 -1
  10. data/docs/carte_vitale_v1.md +1 -1
  11. data/docs/code_samples/resume_v1_async.txt +19 -0
  12. data/docs/cropper_v1.md +1 -1
  13. data/docs/custom_v1.md +1 -1
  14. data/docs/eu_driver_license_v1.md +5 -5
  15. data/docs/expense_receipts_v5.md +1 -1
  16. data/docs/financial_document_v1.md +1 -1
  17. data/docs/generated_v1.md +1 -1
  18. data/docs/getting_started.md +1 -1
  19. data/docs/idcard_fr_v2.md +1 -1
  20. data/docs/international_id_v2.md +226 -0
  21. data/docs/invoice_splitter_v1.md +1 -1
  22. data/docs/invoices_v4.md +1 -1
  23. data/docs/license_plates_v1.md +1 -1
  24. data/docs/multi_receipts_detector_v1.md +1 -1
  25. data/docs/passport_v1.md +1 -1
  26. data/docs/proof_of_address_v1.md +1 -1
  27. data/docs/resume_v1.md +334 -0
  28. data/docs/us_driver_license_v1.md +1 -1
  29. data/docs/us_w9_v1.md +1 -1
  30. data/lib/mindee/http/endpoint.rb +24 -17
  31. data/lib/mindee/http/error.rb +11 -4
  32. data/lib/mindee/http/response_validation.rb +56 -0
  33. data/lib/mindee/parsing/common/api_response.rb +6 -1
  34. data/lib/mindee/parsing/standard/base_field.rb +1 -1
  35. data/lib/mindee/product/.rubocop.yml +7 -2
  36. data/lib/mindee/product/eu/driver_license/driver_license_v1.rb +2 -2
  37. data/lib/mindee/product/eu/driver_license/driver_license_v1_document.rb +1 -1
  38. data/lib/mindee/product/eu/driver_license/driver_license_v1_page.rb +2 -2
  39. data/lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb +0 -2
  40. data/lib/mindee/product/resume/resume_v1.rb +39 -0
  41. data/lib/mindee/product/resume/resume_v1_certificate.rb +69 -0
  42. data/lib/mindee/product/resume/resume_v1_document.rb +322 -0
  43. data/lib/mindee/product/resume/resume_v1_education.rb +90 -0
  44. data/lib/mindee/product/resume/resume_v1_language.rb +55 -0
  45. data/lib/mindee/product/resume/resume_v1_page.rb +32 -0
  46. data/lib/mindee/product/resume/resume_v1_professional_experience.rb +97 -0
  47. data/lib/mindee/product/resume/resume_v1_social_networks_url.rb +55 -0
  48. data/lib/mindee/product.rb +1 -0
  49. data/lib/mindee/version.rb +1 -1
  50. metadata +14 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3711d1d33d9aeb118b9c891443d0e2ecf4973db242797f15d7628f3a157c0f8
4
- data.tar.gz: b63e5dfd3a85fb3b234b0ae6d0afd8b1b2386eba3a2977788298e2cbf7ce79c9
3
+ metadata.gz: d18b48dabb484d078d9fe9ccbe4266d80fde752fb261c13ec6143e69c0ebe0c8
4
+ data.tar.gz: 9340689c20fa1d161461252a379f0754fe7482dbac8fb89407845fc501ac4ae1
5
5
  SHA512:
6
- metadata.gz: 3ec2c83d25ca5e1cd72cc1045a5a6ed8f299dbdf3de2729344eac833a37351dd16a71d14b73679b441b7263e2992a577c618b3143484c8bfac262fd41697fbe5
7
- data.tar.gz: 2de29dd3f708a25ef53e2c61aa86f40684d8ae2aac6cd875e931cd1e0cc0ed8e972439e75c8731e570b7fd7aa1a3884f5c341afe2a29fef40a37bc542ae60c15
6
+ metadata.gz: c74414360e4f02582286e8e49e1fbff59dbc654c75876717268f6f3805c7dfbfbd14729828dde8a86d53b8fcbe3eaca0bf0c988dd66919d54c9cfbc719e6b49f
7
+ data.tar.gz: d14ac158a9d719cdfe2f5ecc5ba0b6a16eb6bae3ce83474a285be980cb00791acfe0e71aa9bb6dbd17945264168ce19f7e5ca75746083994d8a8d0927d76b43f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Mindee Ruby API Library Changelog
2
2
 
3
+ ## v3.6.1 - 2024-03-07
4
+ ### Changes
5
+ * :recycle: update error handling to account for future evolutions
6
+ * :memo: update miscellaneous product documentations
7
+ * :memo: add used environment variables to readme
8
+
9
+
10
+ ## v3.6.0 - 2024-02-21
11
+ ### Changes
12
+ * :sparkles: add support for resume V1
13
+
14
+
3
15
  ## v3.5.0 - 2024-02-16
4
16
  ### Changes
5
17
  * :sparkles: add support for Generated V1 API
data/README.md CHANGED
@@ -1,12 +1,15 @@
1
1
  [![License: MIT](https://img.shields.io/github/license/mindee/mindee-api-ruby)](https://opensource.org/licenses/MIT) [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/mindee/mindee-api-ruby/test.yml)](https://github.com/mindee/mindee-api-ruby) [![Gem Version](https://img.shields.io/gem/v/mindee)](https://rubygems.org/gems/mindee) [![Downloads](https://img.shields.io/gem/dt/mindee.svg)](https://rubygems.org/gems/mindee)
2
2
 
3
3
  # Mindee API Helper Library for Ruby
4
+
4
5
  Quickly and easily connect to Mindee's API services using Ruby.
5
6
 
6
7
  ## Requirements
8
+
7
9
  The following Ruby versions are tested and supported: 2.6, 2.7, 3.0, 3.1, 3.2
8
10
 
9
11
  ## Quick Start
12
+
10
13
  Here's the TL;DR of getting started.
11
14
 
12
15
  First, get an [API Key](https://developers.mindee.com/docs/create-api-key)
@@ -18,15 +21,38 @@ gem 'mindee'
18
21
  ```
19
22
 
20
23
  And then execute:
24
+
21
25
  ```sh
22
26
  bundle install
23
27
  ```
24
28
 
25
29
  Finally, Ruby away!
26
30
 
31
+ ### Environment Variables
32
+
33
+ This library offers customizable features through environment variables. While there may be instances where you need to
34
+ rely on them, it's crucial to exercise caution when modifying them to avoid unintended consequences.
35
+
36
+ If you're unsure whether you need to adjust these variables, it's advisable to refrain from doing so unless you have a
37
+ specific reason. Accidentally overwriting them can lead to unexpected behavior.
38
+
39
+ Before making any changes, we recommend reviewing the following information to understand the purpose and potential
40
+ impact of each environment variable:
41
+
42
+ * `MINDEE_API_KEY`:
43
+ * **Description**: Your personal Mindee API Key as shown on the platform. Be careful not to show this publicly!
44
+ * **Default Value**: `nil`
45
+ * `MINDEE_BASE_URL`:
46
+ * **Description**: The default base URL of the API endpoint. Use this variable to specify the root URL for API requests. Modify as needed for proxy configurations or changes in API endpoint location.
47
+ * **Default Value**: `https://api.mindee.net/v1`
48
+ * `MINDEE_REQUEST_TIMEOUT`:
49
+ * **Description**: The default timeout for HTTP requests (in seconds).
50
+ * **Default Value**: `120`
51
+
27
52
  ### Loading a File and Parsing It
28
53
 
29
54
  #### Global Documents
55
+
30
56
  ```ruby
31
57
  require 'mindee'
32
58
 
@@ -47,26 +73,31 @@ puts result.document
47
73
  **Note:** Files can also be loaded from:
48
74
 
49
75
  A URL (`https`):
76
+
50
77
  ```rb
51
78
  input_source = mindee_client.source_from_url("https://my-url")
52
79
  ```
53
80
 
54
81
  A bytes input stream:
82
+
55
83
  ```rb
56
84
  input_source = mindee_client.source_from_bytes('/path/to/the/file.ext', "name-of-my-file.ext")
57
85
  ```
58
86
 
59
87
  A base64 encoded string:
88
+
60
89
  ```rb
61
90
  input_source = mindee_client.source_from_b64string('/path/to/the/file.ext', "name-of-my-file.ext")
62
91
  ```
63
92
 
64
93
  A ruby `file` object:
94
+
65
95
  ```rb
66
96
  input_source = mindee_client.source_from_file(input_file, "name-of-my-file.ext")
67
97
  ```
68
98
 
69
99
  #### Region-Specific Documents
100
+
70
101
  ```ruby
71
102
  require 'mindee'
72
103
 
@@ -86,6 +117,7 @@ puts result.document
86
117
  ```
87
118
 
88
119
  ### Custom Document (API Builder)
120
+
89
121
  ```ruby
90
122
  require 'mindee'
91
123
 
@@ -119,17 +151,19 @@ end
119
151
  ## CLI Tool
120
152
 
121
153
  A command-line interface tool is available to quickly test documents:
154
+
122
155
  ```sh
123
156
  ruby ./bin/mindee.rb invoice path/to/your/file.ext
124
157
  ```
125
158
 
126
-
127
159
  Using the ruby bundler:
160
+
128
161
  ```sh
129
162
  bundle exec ruby ./bin/mindee.rb invoice path/to/your/file.ext
130
163
  ```
131
164
 
132
165
  ## Further Reading
166
+
133
167
  There's more to it than that for those that need more features, or want to
134
168
  customize the experience.
135
169
 
@@ -142,6 +176,7 @@ customize the experience.
142
176
  * [Passport OCR Ruby](https://developers.mindee.com/docs/passport-ocr-ruby)
143
177
  * [Proof of Address OCR Ruby](https://developers.mindee.com/docs/proof-of-address-ocr-ruby)
144
178
  * [Receipt OCR Ruby](https://developers.mindee.com/docs/receipt-ocr-ruby)
179
+ * [Resume OCR Ruby](https://developers.mindee.com/docs/resume-ocr-ruby)
145
180
  * [EU License Plate OCR Ruby](https://developers.mindee.com/docs/eu-license-plate-ocr-ruby)
146
181
  * [EU Driver License OCR Ruby](https://developers.mindee.com/docs/eu-driver-license-ocr-ruby)
147
182
  * [FR Bank Account Details OCR Ruby](https://developers.mindee.com/docs/fr-bank-account-details-ocr-ruby)
@@ -156,15 +191,15 @@ customize the experience.
156
191
  * [Invoice Splitter API Ruby](https://developers.mindee.com/docs/invoice-splitter-api-ruby)
157
192
  * [Multi Receipts Detector API Ruby](https://developers.mindee.com/docs/multi-receipts-detector-api-ruby)
158
193
 
159
-
160
194
  You can also take a look at the
161
195
  [Reference Documentation](https://mindee.github.io/mindee-api-ruby/).
162
196
 
163
-
164
197
  ## License
198
+
165
199
  Copyright © Mindee, SA
166
200
 
167
201
  Available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
168
202
 
169
203
  ## Questions?
170
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
204
+
205
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
data/bin/mindee.rb CHANGED
@@ -55,6 +55,12 @@ DOCUMENTS = {
55
55
  sync: true,
56
56
  async: false,
57
57
  },
58
+ "resume" => {
59
+ description: "Resume",
60
+ doc_class: Mindee::Product::Resume::ResumeV1,
61
+ sync: false,
62
+ async: true,
63
+ },
58
64
  "passport" => {
59
65
  description: "Passport",
60
66
  doc_class: Mindee::Product::Passport::PassportV1,
@@ -134,4 +134,4 @@ puts result.document.inference.prediction.swift_code.value
134
134
  ```
135
135
 
136
136
  # Questions?
137
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
137
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -179,4 +179,4 @@ end
179
179
  ```
180
180
 
181
181
  # Questions?
182
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
182
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -172,4 +172,4 @@ end
172
172
  ```
173
173
 
174
174
  # Questions?
175
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
175
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -101,4 +101,4 @@ end
101
101
  ```
102
102
 
103
103
  # Questions?
104
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
104
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -451,4 +451,4 @@ puts result.document.inference.prediction.y6.value
451
451
  ```
452
452
 
453
453
  # Questions?
454
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
454
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -120,4 +120,4 @@ puts result.document.inference.prediction.surname.value
120
120
  ```
121
121
 
122
122
  # Questions?
123
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
123
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -0,0 +1,19 @@
1
+ require 'mindee'
2
+
3
+ # Init a new client
4
+ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
5
+
6
+ # Load a file from disk
7
+ input_source = mindee_client.source_from_path('/path/to/the/file.ext')
8
+
9
+ # Parse the file
10
+ result = mindee_client.enqueue_and_parse(
11
+ input_source,
12
+ Mindee::Product::Resume::ResumeV1
13
+ )
14
+
15
+ # Print a full summary of the parsed data in RST format
16
+ puts result.document
17
+
18
+ # Print the document-level parsed data
19
+ # puts result.document.inference.prediction
data/docs/cropper_v1.md CHANGED
@@ -97,4 +97,4 @@ end
97
97
  ```
98
98
 
99
99
  # Questions?
100
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
100
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
data/docs/custom_v1.md CHANGED
@@ -106,4 +106,4 @@ console.log(result.document.inference.prediction.classifications["my-classificat
106
106
 
107
107
  # Questions?
108
108
 
109
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
109
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -1,10 +1,10 @@
1
1
  ---
2
- title: EU EU Driver License OCR Ruby
2
+ title: EU Driver License OCR Ruby
3
3
  ---
4
- The Ruby OCR SDK supports the [EU Driver License API](https://platform.mindee.com/mindee/eu_driver_license).
4
+ The Ruby OCR SDK supports the [Driver License API](https://platform.mindee.com/mindee/eu_driver_license).
5
5
 
6
6
  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.
7
- ![EU Driver License sample](https://github.com/mindee/client-lib-test-data/blob/main/products/eu_driver_license/default_sample.jpg?raw=true)
7
+ ![Driver License sample](https://github.com/mindee/client-lib-test-data/blob/main/products/eu_driver_license/default_sample.jpg?raw=true)
8
8
 
9
9
  # Quick-Start
10
10
  ```rb
@@ -115,7 +115,7 @@ The text field `StringField` only has one constraint: it's **value** is a `Strin
115
115
  Some fields are constrained to the page level, and so will not be retrievable to through the document.
116
116
 
117
117
  # Attributes
118
- The following fields are extracted for EU Driver License V1:
118
+ The following fields are extracted for Driver License V1:
119
119
 
120
120
  ## Address
121
121
  **address** ([StringField](#string-field)): EU driver license holders address
@@ -220,4 +220,4 @@ end
220
220
  ```
221
221
 
222
222
  # Questions?
223
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
223
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -303,4 +303,4 @@ puts result.document.inference.prediction.total_tax.value
303
303
  ```
304
304
 
305
305
  # Questions?
306
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
306
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -392,4 +392,4 @@ puts result.document.inference.prediction.total_tax.value
392
392
  ```
393
393
 
394
394
  # Questions?
395
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
395
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
data/docs/generated_v1.md CHANGED
@@ -87,4 +87,4 @@ puts result.document.inference.prediction.fields["my-field"].to_s
87
87
 
88
88
  # Questions?
89
89
 
90
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
90
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -319,4 +319,4 @@ input_source = mindee_client.source_from_file(input_file, "name-of-my-file.ext",
319
319
  Note: This only works for local files, files sent by URL will not be processed.
320
320
 
321
321
  ## Questions?
322
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
322
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
data/docs/idcard_fr_v2.md CHANGED
@@ -250,4 +250,4 @@ puts result.document.inference.prediction.surname.value
250
250
  ```
251
251
 
252
252
  # Questions?
253
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
253
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -0,0 +1,226 @@
1
+ ---
2
+ title: International ID OCR Ruby
3
+ ---
4
+ The Ruby OCR SDK supports the [International ID API](https://platform.mindee.com/mindee/international_id).
5
+
6
+ Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/international_id/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
7
+ ![International ID sample](https://github.com/mindee/client-lib-test-data/blob/main/products/international_id/default_sample.jpg?raw=true)
8
+
9
+ # Quick-Start
10
+ ```rb
11
+ require 'mindee'
12
+
13
+ # Init a new client
14
+ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
15
+
16
+ # Load a file from disk
17
+ input_source = mindee_client.source_from_path('/path/to/the/file.ext')
18
+
19
+ # Parse the file
20
+ result = mindee_client.enqueue_and_parse(
21
+ input_source,
22
+ Mindee::Product::InternationalId::InternationalIdV2
23
+ )
24
+
25
+ # Print a full summary of the parsed data in RST format
26
+ puts result.document
27
+
28
+ # Print the document-level parsed data
29
+ # puts result.document.inference.prediction
30
+ ```
31
+
32
+ **Output (RST):**
33
+ ```rst
34
+ ########
35
+ Document
36
+ ########
37
+ :Mindee ID: cfa20a58-20cf-43b6-8cec-9505fa69d1c2
38
+ :Filename: default_sample.jpg
39
+
40
+ Inference
41
+ #########
42
+ :Product: mindee/international_id v2.0
43
+ :Rotation applied: No
44
+
45
+ Prediction
46
+ ==========
47
+ :Document Type: IDENTIFICATION_CARD
48
+ :Document Number: 12345678A
49
+ :Surnames: MUESTRA
50
+ MUESTRA
51
+ :Given Names: CARMEN
52
+ :Sex: F
53
+ :Birth Date: 1980-01-01
54
+ :Birth Place: CAMPO DE CRIPTANA CIUDAD REAL ESPANA
55
+ :Nationality: ESP
56
+ :Personal Number: BAB1834284<44282767Q0
57
+ :Country of Issue: ESP
58
+ :State of Issue: MADRID
59
+ :Issue Date:
60
+ :Expiration Date: 2030-01-01
61
+ :Address: C/REAL N13, 1 DCHA COLLADO VILLALBA MADRID MADRID MADRID
62
+ :MRZ Line 1: IDESPBAB1834284<44282767Q0<<<<
63
+ :MRZ Line 2: 8001010F1301017ESP<<<<<<<<<<<3
64
+ :MRZ Line 3: MUESTRA<MUESTRA<<CARMEN<<<<<<<
65
+ ```
66
+
67
+ # Field Types
68
+ ## Standard Fields
69
+ These fields are generic and used in several products.
70
+
71
+ ### Basic Field
72
+ Each prediction object contains a set of fields that inherit from the generic `Field` class.
73
+ A typical `Field` object will have the following attributes:
74
+
75
+ * **value** (`String`, `Float`, `Integer`, `Boolean`): corresponds to the field value. Can be `nil` if no value was extracted.
76
+ * **confidence** (Float, nil): the confidence score of the field prediction.
77
+ * **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
78
+ * **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
79
+ * **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
80
+ * **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
81
+
82
+
83
+ 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.
84
+
85
+
86
+ ### Classification Field
87
+ The classification field `ClassificationField` does not implement all the basic `Field` attributes. It only implements **value**, **confidence** and **page_id**.
88
+
89
+ > Note: a classification field's `value is always a `String`.
90
+
91
+ ### Date Field
92
+ Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
93
+
94
+ * **date_object** (`Date`): an accessible representation of the value as a JavaScript object.
95
+
96
+ ### String Field
97
+ The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
98
+
99
+ # Attributes
100
+ The following fields are extracted for International ID V2:
101
+
102
+ ## Address
103
+ **address** ([StringField](#string-field)): The physical address of the document holder.
104
+
105
+ ```rb
106
+ puts result.document.inference.prediction.address.value
107
+ ```
108
+
109
+ ## Birth Date
110
+ **birth_date** ([DateField](#date-field)): The date of birth of the document holder.
111
+
112
+ ```rb
113
+ puts result.document.inference.prediction.birth_date.value
114
+ ```
115
+
116
+ ## Birth Place
117
+ **birth_place** ([StringField](#string-field)): The place of birth of the document holder.
118
+
119
+ ```rb
120
+ puts result.document.inference.prediction.birth_place.value
121
+ ```
122
+
123
+ ## Country of Issue
124
+ **country_of_issue** ([StringField](#string-field)): The country where the document was issued.
125
+
126
+ ```rb
127
+ puts result.document.inference.prediction.country_of_issue.value
128
+ ```
129
+
130
+ ## Document Number
131
+ **document_number** ([StringField](#string-field)): The unique identifier assigned to the document.
132
+
133
+ ```rb
134
+ puts result.document.inference.prediction.document_number.value
135
+ ```
136
+
137
+ ## Document Type
138
+ **document_type** ([ClassificationField](#classification-field)): The type of personal identification document.
139
+
140
+ ```rb
141
+ puts result.document.inference.prediction.document_type.value
142
+ ```
143
+
144
+ ## Expiration Date
145
+ **expiry_date** ([DateField](#date-field)): The date when the document becomes invalid.
146
+
147
+ ```rb
148
+ puts result.document.inference.prediction.expiry_date.value
149
+ ```
150
+
151
+ ## Given Names
152
+ **given_names** (Array<[StringField](#string-field)>): The list of the document holder's given names.
153
+
154
+ ```rb
155
+ for given_names_elem in result.document.inference.prediction.given_names do
156
+ puts given_names_elem.value
157
+ end
158
+ ```
159
+
160
+ ## Issue Date
161
+ **issue_date** ([DateField](#date-field)): The date when the document was issued.
162
+
163
+ ```rb
164
+ puts result.document.inference.prediction.issue_date.value
165
+ ```
166
+
167
+ ## MRZ Line 1
168
+ **mrz_line1** ([StringField](#string-field)): The Machine Readable Zone, first line.
169
+
170
+ ```rb
171
+ puts result.document.inference.prediction.mrz_line1.value
172
+ ```
173
+
174
+ ## MRZ Line 2
175
+ **mrz_line2** ([StringField](#string-field)): The Machine Readable Zone, second line.
176
+
177
+ ```rb
178
+ puts result.document.inference.prediction.mrz_line2.value
179
+ ```
180
+
181
+ ## MRZ Line 3
182
+ **mrz_line3** ([StringField](#string-field)): The Machine Readable Zone, third line.
183
+
184
+ ```rb
185
+ puts result.document.inference.prediction.mrz_line3.value
186
+ ```
187
+
188
+ ## Nationality
189
+ **nationality** ([StringField](#string-field)): The country of citizenship of the document holder.
190
+
191
+ ```rb
192
+ puts result.document.inference.prediction.nationality.value
193
+ ```
194
+
195
+ ## Personal Number
196
+ **personal_number** ([StringField](#string-field)): The unique identifier assigned to the document holder.
197
+
198
+ ```rb
199
+ puts result.document.inference.prediction.personal_number.value
200
+ ```
201
+
202
+ ## Sex
203
+ **sex** ([StringField](#string-field)): The biological sex of the document holder.
204
+
205
+ ```rb
206
+ puts result.document.inference.prediction.sex.value
207
+ ```
208
+
209
+ ## State of Issue
210
+ **state_of_issue** ([StringField](#string-field)): The state or territory where the document was issued.
211
+
212
+ ```rb
213
+ puts result.document.inference.prediction.state_of_issue.value
214
+ ```
215
+
216
+ ## Surnames
217
+ **surnames** (Array<[StringField](#string-field)>): The list of the document holder's family names.
218
+
219
+ ```rb
220
+ for surnames_elem in result.document.inference.prediction.surnames do
221
+ puts surnames_elem.value
222
+ end
223
+ ```
224
+
225
+ # Questions?
226
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -82,4 +82,4 @@ end
82
82
  ```
83
83
 
84
84
  # Questions?
85
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
85
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
data/docs/invoices_v4.md CHANGED
@@ -347,4 +347,4 @@ puts result.document.inference.prediction.total_tax.value
347
347
  ```
348
348
 
349
349
  # Questions?
350
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
350
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -88,4 +88,4 @@ end
88
88
  ```
89
89
 
90
90
  # Questions?
91
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
91
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -105,4 +105,4 @@ end
105
105
  ```
106
106
 
107
107
  # Questions?
108
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
108
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
data/docs/passport_v1.md CHANGED
@@ -183,4 +183,4 @@ puts result.document.inference.prediction.surname.value
183
183
  ```
184
184
 
185
185
  # Questions?
186
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
186
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
@@ -204,4 +204,4 @@ puts result.document.inference.prediction.recipient_name.value
204
204
  ```
205
205
 
206
206
  # Questions?
207
- [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
207
+ [Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)