mindee 3.2.0 → 3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -0
- data/CHANGELOG.md +17 -0
- data/bin/mindee.rb +1 -1
- data/docs/bank_account_details_v2.md +1 -1
- data/docs/bank_check_v1.md +5 -2
- data/docs/barcode_reader_v1.md +3 -3
- data/docs/carte_grise_v1.md +454 -0
- data/docs/carte_vitale_v1.md +1 -1
- data/docs/code_samples/carte_grise_v1.txt +19 -0
- data/docs/cropper_v1.md +6 -3
- data/docs/custom_v1.md +9 -1
- data/docs/expense_receipts_v5.md +3 -3
- data/docs/financial_document_v1.md +11 -8
- data/docs/idcard_fr_v2.md +1 -1
- data/docs/invoices_v4.md +73 -101
- data/docs/license_plates_v1.md +1 -1
- data/docs/multi_receipts_detector_v1.md +6 -3
- data/docs/passport_v1.md +1 -1
- data/docs/proof_of_address_v1.md +1 -1
- data/docs/us_driver_license_v1.md +1 -1
- data/docs/us_w9_v1.md +4 -4
- data/lib/mindee/client.rb +15 -10
- data/lib/mindee/http/endpoint.rb +5 -1
- data/lib/mindee/http/error.rb +1 -1
- data/lib/mindee/parsing/common/api_response.rb +3 -2
- data/lib/mindee/parsing/common/document.rb +4 -1
- data/lib/mindee/parsing/custom/list_field.rb +7 -5
- data/lib/mindee/parsing/standard/base_field.rb +1 -1
- data/lib/mindee/product/financial_document/financial_document_v1_document.rb +2 -2
- data/lib/mindee/product/fr/carte_grise/carte_grise_v1.rb +39 -0
- data/lib/mindee/product/fr/carte_grise/carte_grise_v1_document.rb +235 -0
- data/lib/mindee/product/fr/carte_grise/carte_grise_v1_page.rb +34 -0
- data/lib/mindee/product/invoice/invoice_v4.rb +1 -2
- data/lib/mindee/product/invoice/invoice_v4_document.rb +105 -145
- data/lib/mindee/product/invoice/invoice_v4_line_item.rb +54 -30
- data/lib/mindee/product/us/w9/w9_v1.rb +2 -2
- data/lib/mindee/product/us/w9/w9_v1_document.rb +1 -1
- data/lib/mindee/product/us/w9/w9_v1_page.rb +2 -2
- data/lib/mindee/product.rb +1 -0
- data/lib/mindee/version.rb +1 -1
- data/lib/mindee.rb +0 -3
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c6039978a362b6a5faab3b92fb4ef24fd9cbf85060f66614b007b371d851843
|
4
|
+
data.tar.gz: 4aa9ef461ee5fcc19f483dde6f584c583390e53ebba1889d5283b1864a26169c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 226aa7601ad8b1a80dc6fb1071ad655a9aae647d70118184d0ada431b314503eb3f6157abdc59eb0205e157c3d7d8cc501ceb26258690ed9ad038b4d41336f93
|
7
|
+
data.tar.gz: a1d215cb0834ded50c9bcb913d2cf074d7e711ec73aaa67380705c71d51e29b6c15a162fa7afcadcab027954831155fdf065563cee1ce2aa0a7b300359cd7421
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
# Mindee Ruby API Library Changelog
|
2
2
|
|
3
|
+
## v3.3.1 - 2023-12-15
|
4
|
+
### Changes
|
5
|
+
* :recycle: tweak async delays & retry
|
6
|
+
* :recycle: tweak default async sample delays & retry
|
7
|
+
* :memo: update md doc & fix typos
|
8
|
+
|
9
|
+
|
10
|
+
## v3.3.0 - 2023-11-17
|
11
|
+
### Changes
|
12
|
+
* :sparkles: add support for Carte Grise V1
|
13
|
+
* :sparkles: add page number attributes to doc
|
14
|
+
* :arrow_up: update tests, docs & display format for some products
|
15
|
+
|
16
|
+
### Fixes
|
17
|
+
* :bug: fix page id not working on newer custom models
|
18
|
+
|
19
|
+
|
3
20
|
## v3.2.0 - 2023-09-15
|
4
21
|
### Changes
|
5
22
|
* :sparkles: add support for Multi Receipts Detector V1
|
data/bin/mindee.rb
CHANGED
@@ -81,7 +81,7 @@ A typical `Field` object will have the following attributes:
|
|
81
81
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
82
82
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
83
83
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
84
|
-
* **reconstructed** (`Boolean`): indicates whether
|
84
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
85
85
|
|
86
86
|
|
87
87
|
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.
|
data/docs/bank_check_v1.md
CHANGED
@@ -81,7 +81,7 @@ A typical `Field` object will have the following attributes:
|
|
81
81
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
82
82
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
83
83
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
84
|
-
* **reconstructed** (`Boolean`): indicates whether
|
84
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
85
85
|
|
86
86
|
|
87
87
|
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.
|
@@ -170,7 +170,10 @@ puts result.document.inference.prediction.routing_number.value
|
|
170
170
|
```rb
|
171
171
|
for page in result.document.inference.pages do
|
172
172
|
for signatures_positions_elem in page.prediction.signatures_positions do
|
173
|
-
puts signatures_positions_elem.polygon
|
173
|
+
puts signatures_positions_elem.polygon.to_s
|
174
|
+
puts signatures_positions_elem.quadrangle.to_s
|
175
|
+
puts signatures_positions_elem.rectangle.to_s
|
176
|
+
puts signatures_positions_elem.boundingBox.to_s
|
174
177
|
end
|
175
178
|
end
|
176
179
|
```
|
data/docs/barcode_reader_v1.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
---
|
2
|
-
title: Barcode Reader
|
2
|
+
title: Barcode Reader OCR Ruby
|
3
3
|
---
|
4
4
|
The Ruby OCR SDK supports the [Barcode Reader API](https://platform.mindee.com/mindee/barcode_reader).
|
5
5
|
|
@@ -34,7 +34,7 @@ puts result.document
|
|
34
34
|
########
|
35
35
|
Document
|
36
36
|
########
|
37
|
-
:Mindee ID:
|
37
|
+
:Mindee ID: f9c48da1-a306-4805-8da8-f7231fda2d88
|
38
38
|
:Filename: default_sample.jpg
|
39
39
|
|
40
40
|
Inference
|
@@ -71,7 +71,7 @@ A typical `Field` object will have the following attributes:
|
|
71
71
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
72
72
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
73
73
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
74
|
-
* **reconstructed** (`Boolean`): indicates whether
|
74
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
75
75
|
|
76
76
|
|
77
77
|
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.
|
@@ -0,0 +1,454 @@
|
|
1
|
+
---
|
2
|
+
title: FR Carte Grise OCR Ruby
|
3
|
+
---
|
4
|
+
The Ruby OCR SDK supports the [Carte Grise API](https://platform.mindee.com/mindee/carte_grise).
|
5
|
+
|
6
|
+
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/carte_grise/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK.
|
7
|
+
![Carte Grise sample](https://github.com/mindee/client-lib-test-data/blob/main/products/carte_grise/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.parse(
|
21
|
+
input_source,
|
22
|
+
Mindee::Product::FR::CarteGrise::CarteGriseV1
|
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: f0e0f7a9-0f44-4a3d-92c7-5be262133d33
|
38
|
+
:Filename: default_sample.jpg
|
39
|
+
|
40
|
+
Inference
|
41
|
+
#########
|
42
|
+
:Product: mindee/carte_grise v1.0
|
43
|
+
:Rotation applied: Yes
|
44
|
+
|
45
|
+
Prediction
|
46
|
+
==========
|
47
|
+
:a: AB-123-CD
|
48
|
+
:b: 1998-01-05
|
49
|
+
:c1: DUPONT YVES
|
50
|
+
:c3: 27 RUE DES ROITELETS 59169 FERIN LES BAINS FRANCE
|
51
|
+
:c41: 2 DELAROCHE
|
52
|
+
:c4a: EST LE PROPRIETAIRE DU VEHICULE
|
53
|
+
:d1:
|
54
|
+
:d3: MODELE
|
55
|
+
:e: VFS1V2009AS1V2009
|
56
|
+
:f1: 1915
|
57
|
+
:f2: 1915
|
58
|
+
:f3: 1915
|
59
|
+
:g: 3030
|
60
|
+
:g1: 1307
|
61
|
+
:i: 2009-12-04
|
62
|
+
:j: N1
|
63
|
+
:j1: VP
|
64
|
+
:j2: AA
|
65
|
+
:j3: CI
|
66
|
+
:p1: 1900
|
67
|
+
:p2: 90
|
68
|
+
:p3: GO
|
69
|
+
:p6: 6
|
70
|
+
:q:
|
71
|
+
:s1: 5
|
72
|
+
:s2:
|
73
|
+
:u1: 77
|
74
|
+
:u2: 3000
|
75
|
+
:v7: 155
|
76
|
+
:x1: 2011-07-06
|
77
|
+
:y1:
|
78
|
+
:y2:
|
79
|
+
:y3: 0
|
80
|
+
:y4: 4
|
81
|
+
:y5: 2.5
|
82
|
+
:y6: 178.35
|
83
|
+
:Formula Number: 2009AS05284
|
84
|
+
:Owner's First Name: YVES
|
85
|
+
:Owner's Surname: DUPONT
|
86
|
+
:MRZ Line 1:
|
87
|
+
:MRZ Line 2: CI<<MARQUES<<<<<<<MODELE<<<<<<<2009AS0528402
|
88
|
+
|
89
|
+
Page Predictions
|
90
|
+
================
|
91
|
+
|
92
|
+
Page 0
|
93
|
+
------
|
94
|
+
:a: AB-123-CD
|
95
|
+
:b: 1998-01-05
|
96
|
+
:c1: DUPONT YVES
|
97
|
+
:c3: 27 RUE DES ROITELETS 59169 FERIN LES BAINS FRANCE
|
98
|
+
:c41: 2 DELAROCHE
|
99
|
+
:c4a: EST LE PROPRIETAIRE DU VEHICULE
|
100
|
+
:d1:
|
101
|
+
:d3: MODELE
|
102
|
+
:e: VFS1V2009AS1V2009
|
103
|
+
:f1: 1915
|
104
|
+
:f2: 1915
|
105
|
+
:f3: 1915
|
106
|
+
:g: 3030
|
107
|
+
:g1: 1307
|
108
|
+
:i: 2009-12-04
|
109
|
+
:j: N1
|
110
|
+
:j1: VP
|
111
|
+
:j2: AA
|
112
|
+
:j3: CI
|
113
|
+
:p1: 1900
|
114
|
+
:p2: 90
|
115
|
+
:p3: GO
|
116
|
+
:p6: 6
|
117
|
+
:q: 006
|
118
|
+
:s1: 5
|
119
|
+
:s2:
|
120
|
+
:u1: 77
|
121
|
+
:u2: 3000
|
122
|
+
:v7: 155
|
123
|
+
:x1: 2011-07-06
|
124
|
+
:y1: 17835
|
125
|
+
:y2:
|
126
|
+
:y3: 0
|
127
|
+
:y4: 4
|
128
|
+
:y5: 2.5
|
129
|
+
:y6: 178.35
|
130
|
+
:Formula Number: 2009AS05284
|
131
|
+
:Owner's First Name: YVES
|
132
|
+
:Owner's Surname: DUPONT
|
133
|
+
:MRZ Line 1:
|
134
|
+
:MRZ Line 2: CI<<MARQUES<<<<<<<MODELE<<<<<<<2009AS0528402
|
135
|
+
```
|
136
|
+
|
137
|
+
# Field Types
|
138
|
+
## Standard Fields
|
139
|
+
These fields are generic and used in several products.
|
140
|
+
|
141
|
+
### Basic Field
|
142
|
+
Each prediction object contains a set of fields that inherit from the generic `Field` class.
|
143
|
+
A typical `Field` object will have the following attributes:
|
144
|
+
|
145
|
+
* **value** (`String`, `Float`, `Integer`, `Boolean`): corresponds to the field value. Can be `nil` if no value was extracted.
|
146
|
+
* **confidence** (Float, nil): the confidence score of the field prediction.
|
147
|
+
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
148
|
+
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
149
|
+
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
150
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
151
|
+
|
152
|
+
|
153
|
+
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.
|
154
|
+
|
155
|
+
### Date Field
|
156
|
+
Aside from the basic `Field` attributes, the date field `DateField` also implements the following:
|
157
|
+
|
158
|
+
* **date_object** (`Date`): an accessible representation of the value as a JavaScript object.
|
159
|
+
|
160
|
+
### String Field
|
161
|
+
The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
|
162
|
+
|
163
|
+
# Attributes
|
164
|
+
The following fields are extracted for Carte Grise V1:
|
165
|
+
|
166
|
+
## a
|
167
|
+
**a** ([StringField](#string-field)): The vehicle's license plate number.
|
168
|
+
|
169
|
+
```rb
|
170
|
+
puts result.document.inference.prediction.a.value
|
171
|
+
```
|
172
|
+
|
173
|
+
## b
|
174
|
+
**b** ([DateField](#date-field)): The vehicle's first release date.
|
175
|
+
|
176
|
+
```rb
|
177
|
+
puts result.document.inference.prediction.b.value
|
178
|
+
```
|
179
|
+
|
180
|
+
## c1
|
181
|
+
**c1** ([StringField](#string-field)): The vehicle owner's full name including maiden name.
|
182
|
+
|
183
|
+
```rb
|
184
|
+
puts result.document.inference.prediction.c1.value
|
185
|
+
```
|
186
|
+
|
187
|
+
## c3
|
188
|
+
**c3** ([StringField](#string-field)): The vehicle owner's address.
|
189
|
+
|
190
|
+
```rb
|
191
|
+
puts result.document.inference.prediction.c3.value
|
192
|
+
```
|
193
|
+
|
194
|
+
## c41
|
195
|
+
**c41** ([StringField](#string-field)): Number of owners of the license certificate.
|
196
|
+
|
197
|
+
```rb
|
198
|
+
puts result.document.inference.prediction.c41.value
|
199
|
+
```
|
200
|
+
|
201
|
+
## c4a
|
202
|
+
**c4a** ([StringField](#string-field)): Mentions about the ownership of the vehicle.
|
203
|
+
|
204
|
+
```rb
|
205
|
+
puts result.document.inference.prediction.c4a.value
|
206
|
+
```
|
207
|
+
|
208
|
+
## d1
|
209
|
+
**d1** ([StringField](#string-field)): The vehicle's brand.
|
210
|
+
|
211
|
+
```rb
|
212
|
+
puts result.document.inference.prediction.d1.value
|
213
|
+
```
|
214
|
+
|
215
|
+
## d3
|
216
|
+
**d3** ([StringField](#string-field)): The vehicle's commercial name.
|
217
|
+
|
218
|
+
```rb
|
219
|
+
puts result.document.inference.prediction.d3.value
|
220
|
+
```
|
221
|
+
|
222
|
+
## e
|
223
|
+
**e** ([StringField](#string-field)): The Vehicle Identification Number (VIN).
|
224
|
+
|
225
|
+
```rb
|
226
|
+
puts result.document.inference.prediction.e.value
|
227
|
+
```
|
228
|
+
|
229
|
+
## f1
|
230
|
+
**f1** ([StringField](#string-field)): The vehicle's maximum admissible weight.
|
231
|
+
|
232
|
+
```rb
|
233
|
+
puts result.document.inference.prediction.f1.value
|
234
|
+
```
|
235
|
+
|
236
|
+
## f2
|
237
|
+
**f2** ([StringField](#string-field)): The vehicle's maximum admissible weight within the license's state.
|
238
|
+
|
239
|
+
```rb
|
240
|
+
puts result.document.inference.prediction.f2.value
|
241
|
+
```
|
242
|
+
|
243
|
+
## f3
|
244
|
+
**f3** ([StringField](#string-field)): The vehicle's maximum authorized weight with coupling.
|
245
|
+
|
246
|
+
```rb
|
247
|
+
puts result.document.inference.prediction.f3.value
|
248
|
+
```
|
249
|
+
|
250
|
+
## Formula Number
|
251
|
+
**formula_number** ([StringField](#string-field)): The document's formula number.
|
252
|
+
|
253
|
+
```rb
|
254
|
+
puts result.document.inference.prediction.formula_number.value
|
255
|
+
```
|
256
|
+
|
257
|
+
## g
|
258
|
+
**g** ([StringField](#string-field)): The vehicle's weight with coupling if tractor different than category M1.
|
259
|
+
|
260
|
+
```rb
|
261
|
+
puts result.document.inference.prediction.g.value
|
262
|
+
```
|
263
|
+
|
264
|
+
## g1
|
265
|
+
**g1** ([StringField](#string-field)): The vehicle's national empty weight.
|
266
|
+
|
267
|
+
```rb
|
268
|
+
puts result.document.inference.prediction.g1.value
|
269
|
+
```
|
270
|
+
|
271
|
+
## i
|
272
|
+
**i** ([DateField](#date-field)): The car registration date of the given certificate.
|
273
|
+
|
274
|
+
```rb
|
275
|
+
puts result.document.inference.prediction.i.value
|
276
|
+
```
|
277
|
+
|
278
|
+
## j
|
279
|
+
**j** ([StringField](#string-field)): The vehicle's category.
|
280
|
+
|
281
|
+
```rb
|
282
|
+
puts result.document.inference.prediction.j.value
|
283
|
+
```
|
284
|
+
|
285
|
+
## j1
|
286
|
+
**j1** ([StringField](#string-field)): The vehicle's national type.
|
287
|
+
|
288
|
+
```rb
|
289
|
+
puts result.document.inference.prediction.j1.value
|
290
|
+
```
|
291
|
+
|
292
|
+
## j2
|
293
|
+
**j2** ([StringField](#string-field)): The vehicle's body type (CE).
|
294
|
+
|
295
|
+
```rb
|
296
|
+
puts result.document.inference.prediction.j2.value
|
297
|
+
```
|
298
|
+
|
299
|
+
## j3
|
300
|
+
**j3** ([StringField](#string-field)): The vehicle's body type (National designation).
|
301
|
+
|
302
|
+
```rb
|
303
|
+
puts result.document.inference.prediction.j3.value
|
304
|
+
```
|
305
|
+
|
306
|
+
## MRZ Line 1
|
307
|
+
**mrz1** ([StringField](#string-field)): Machine Readable Zone, first line.
|
308
|
+
|
309
|
+
```rb
|
310
|
+
puts result.document.inference.prediction.mrz1.value
|
311
|
+
```
|
312
|
+
|
313
|
+
## MRZ Line 2
|
314
|
+
**mrz2** ([StringField](#string-field)): Machine Readable Zone, second line.
|
315
|
+
|
316
|
+
```rb
|
317
|
+
puts result.document.inference.prediction.mrz2.value
|
318
|
+
```
|
319
|
+
|
320
|
+
## Owner's First Name
|
321
|
+
**owner_first_name** ([StringField](#string-field)): The vehicle's owner first name.
|
322
|
+
|
323
|
+
```rb
|
324
|
+
puts result.document.inference.prediction.owner_first_name.value
|
325
|
+
```
|
326
|
+
|
327
|
+
## Owner's Surname
|
328
|
+
**owner_surname** ([StringField](#string-field)): The vehicle's owner surname.
|
329
|
+
|
330
|
+
```rb
|
331
|
+
puts result.document.inference.prediction.owner_surname.value
|
332
|
+
```
|
333
|
+
|
334
|
+
## p1
|
335
|
+
**p1** ([StringField](#string-field)): The vehicle engine's displacement (cm3).
|
336
|
+
|
337
|
+
```rb
|
338
|
+
puts result.document.inference.prediction.p1.value
|
339
|
+
```
|
340
|
+
|
341
|
+
## p2
|
342
|
+
**p2** ([StringField](#string-field)): The vehicle's maximum net power (kW).
|
343
|
+
|
344
|
+
```rb
|
345
|
+
puts result.document.inference.prediction.p2.value
|
346
|
+
```
|
347
|
+
|
348
|
+
## p3
|
349
|
+
**p3** ([StringField](#string-field)): The vehicle's fuel type or energy source.
|
350
|
+
|
351
|
+
```rb
|
352
|
+
puts result.document.inference.prediction.p3.value
|
353
|
+
```
|
354
|
+
|
355
|
+
## p6
|
356
|
+
**p6** ([StringField](#string-field)): The vehicle's administrative power (fiscal horsepower).
|
357
|
+
|
358
|
+
```rb
|
359
|
+
puts result.document.inference.prediction.p6.value
|
360
|
+
```
|
361
|
+
|
362
|
+
## q
|
363
|
+
**q** ([StringField](#string-field)): The vehicle's power to weight ratio.
|
364
|
+
|
365
|
+
```rb
|
366
|
+
puts result.document.inference.prediction.q.value
|
367
|
+
```
|
368
|
+
|
369
|
+
## s1
|
370
|
+
**s1** ([StringField](#string-field)): The vehicle's number of seats.
|
371
|
+
|
372
|
+
```rb
|
373
|
+
puts result.document.inference.prediction.s1.value
|
374
|
+
```
|
375
|
+
|
376
|
+
## s2
|
377
|
+
**s2** ([StringField](#string-field)): The vehicle's number of standing rooms (person).
|
378
|
+
|
379
|
+
```rb
|
380
|
+
puts result.document.inference.prediction.s2.value
|
381
|
+
```
|
382
|
+
|
383
|
+
## u1
|
384
|
+
**u1** ([StringField](#string-field)): The vehicle's sound level (dB).
|
385
|
+
|
386
|
+
```rb
|
387
|
+
puts result.document.inference.prediction.u1.value
|
388
|
+
```
|
389
|
+
|
390
|
+
## u2
|
391
|
+
**u2** ([StringField](#string-field)): The vehicle engine's rotation speed (RPM).
|
392
|
+
|
393
|
+
```rb
|
394
|
+
puts result.document.inference.prediction.u2.value
|
395
|
+
```
|
396
|
+
|
397
|
+
## v7
|
398
|
+
**v7** ([StringField](#string-field)): The vehicle's CO2 emission (g/km).
|
399
|
+
|
400
|
+
```rb
|
401
|
+
puts result.document.inference.prediction.v7.value
|
402
|
+
```
|
403
|
+
|
404
|
+
## x1
|
405
|
+
**x1** ([StringField](#string-field)): Next technical control date.
|
406
|
+
|
407
|
+
```rb
|
408
|
+
puts result.document.inference.prediction.x1.value
|
409
|
+
```
|
410
|
+
|
411
|
+
## y1
|
412
|
+
**y1** ([StringField](#string-field)): Amount of the regional proportional tax of the registration (in euros).
|
413
|
+
|
414
|
+
```rb
|
415
|
+
puts result.document.inference.prediction.y1.value
|
416
|
+
```
|
417
|
+
|
418
|
+
## y2
|
419
|
+
**y2** ([StringField](#string-field)): Amount of the additional parafiscal tax of the registration (in euros).
|
420
|
+
|
421
|
+
```rb
|
422
|
+
puts result.document.inference.prediction.y2.value
|
423
|
+
```
|
424
|
+
|
425
|
+
## y3
|
426
|
+
**y3** ([StringField](#string-field)): Amount of the additional CO2 tax of the registration (in euros).
|
427
|
+
|
428
|
+
```rb
|
429
|
+
puts result.document.inference.prediction.y3.value
|
430
|
+
```
|
431
|
+
|
432
|
+
## y4
|
433
|
+
**y4** ([StringField](#string-field)): Amount of the fee for managing the registration (in euros).
|
434
|
+
|
435
|
+
```rb
|
436
|
+
puts result.document.inference.prediction.y4.value
|
437
|
+
```
|
438
|
+
|
439
|
+
## y5
|
440
|
+
**y5** ([StringField](#string-field)): Amount of the fee for delivery of the registration certificate in euros.
|
441
|
+
|
442
|
+
```rb
|
443
|
+
puts result.document.inference.prediction.y5.value
|
444
|
+
```
|
445
|
+
|
446
|
+
## y6
|
447
|
+
**y6** ([StringField](#string-field)): Total amount of registration fee to be paid in euros.
|
448
|
+
|
449
|
+
```rb
|
450
|
+
puts result.document.inference.prediction.y6.value
|
451
|
+
```
|
452
|
+
|
453
|
+
# Questions?
|
454
|
+
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-1jv6nawjq-FDgFcF2T5CmMmRpl9LLptw)
|
data/docs/carte_vitale_v1.md
CHANGED
@@ -73,7 +73,7 @@ A typical `Field` object will have the following attributes:
|
|
73
73
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
74
74
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
75
75
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
76
|
-
* **reconstructed** (`Boolean`): indicates whether
|
76
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
77
77
|
|
78
78
|
|
79
79
|
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.
|
@@ -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.parse(
|
11
|
+
input_source,
|
12
|
+
Mindee::Product::FR::CarteGrise::CarteGriseV1
|
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
@@ -1,5 +1,5 @@
|
|
1
1
|
---
|
2
|
-
title: Cropper
|
2
|
+
title: Cropper OCR Ruby
|
3
3
|
---
|
4
4
|
The Ruby OCR SDK supports the [Cropper API](https://platform.mindee.com/mindee/cropper).
|
5
5
|
|
@@ -64,7 +64,7 @@ A typical `Field` object will have the following attributes:
|
|
64
64
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
65
65
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
66
66
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
67
|
-
* **reconstructed** (`Boolean`): indicates whether
|
67
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
68
68
|
|
69
69
|
|
70
70
|
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.
|
@@ -88,7 +88,10 @@ The following fields are extracted for Cropper V1:
|
|
88
88
|
```rb
|
89
89
|
for page in result.document.inference.pages do
|
90
90
|
for cropping_elem in page.prediction.cropping do
|
91
|
-
puts cropping_elem.polygon
|
91
|
+
puts cropping_elem.polygon.to_s
|
92
|
+
puts cropping_elem.quadrangle.to_s
|
93
|
+
puts cropping_elem.rectangle.to_s
|
94
|
+
puts cropping_elem.boundingBox.to_s
|
92
95
|
end
|
93
96
|
end
|
94
97
|
```
|
data/docs/custom_v1.md
CHANGED
@@ -59,14 +59,22 @@ If it is not set, it will default to "1".
|
|
59
59
|
A `ListField` is a special type of custom list that implements the following:
|
60
60
|
|
61
61
|
* **confidence** (`Float`): the confidence score of the field prediction.
|
62
|
-
* **pageId** (`Integer`): the ID of the page, is `nil` when at document-level.
|
63
62
|
* **reconstructed** (`Boolean`): indicates whether or not an object was reconstructed (not extracted as the API gave it).
|
63
|
+
* **values** (`Array<`[ListFieldItem](#list-field-item)`>`): list of value fields
|
64
64
|
|
65
65
|
Since the inner contents can vary, the value isn't accessed through a property, but rather through the following functions:
|
66
66
|
* **contents_list()** (`[Array, Hash, String, nil]`): returns a list of values for each element.
|
67
67
|
* **contents_str(separator:' ')** (`String`): returns a list of concatenated values, with an optional **separator** `String` between them.
|
68
68
|
* **to_s()**: returns a string representation of all values, with an empty space between each of them.
|
69
69
|
|
70
|
+
#### List Field Item
|
71
|
+
|
72
|
+
Values of `ListField`s are stored in a `ListFieldItem` structure, which is implemented as follows:
|
73
|
+
* **content** (`String`): extracted content of the prediction
|
74
|
+
* **confidence** (`Float`): the confidence score of the prediction
|
75
|
+
* **bounding_box** (`Quadrilateral`): 4 relative vertices corrdinates of a rectangle containing the word in the document.
|
76
|
+
* **polygon** (`Polygon`): vertices of a polygon containing the word.
|
77
|
+
* **page_id** (`Integer`): the ID of the page, is `nil` when at document-level.
|
70
78
|
|
71
79
|
### Classification Field
|
72
80
|
|
data/docs/expense_receipts_v5.md
CHANGED
@@ -119,7 +119,7 @@ A typical `Field` object will have the following attributes:
|
|
119
119
|
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
120
120
|
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
121
121
|
* **page_id** (`Integer`, `nil`): the ID of the page, is `nil` when at document-level.
|
122
|
-
* **reconstructed** (`Boolean`): indicates whether
|
122
|
+
* **reconstructed** (`Boolean`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
123
123
|
|
124
124
|
|
125
125
|
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.
|
@@ -159,7 +159,7 @@ The text field `StringField` only has one constraint: it's **value** is a `Strin
|
|
159
159
|
#### Tax
|
160
160
|
Aside from the basic `Field` attributes, the tax field `TaxField` also implements the following:
|
161
161
|
|
162
|
-
* **rate** (`Float`): the tax rate applied to an item can be
|
162
|
+
* **rate** (`Float`): the tax rate applied to an item can be expressed as a percentage. Can be `nil`.
|
163
163
|
* **code** (`String`): tax code (or equivalent, depending on the origin of the document). Can be `nil`.
|
164
164
|
* **base** (`Float`): base amount used for the tax. Can be `nil`.
|
165
165
|
|
@@ -263,7 +263,7 @@ puts result.document.inference.prediction.supplier_phone_number.value
|
|
263
263
|
|
264
264
|
```rb
|
265
265
|
for taxes_elem in result.document.inference.prediction.taxes do
|
266
|
-
puts taxes_elem.
|
266
|
+
puts taxes_elem.value
|
267
267
|
end
|
268
268
|
```
|
269
269
|
|