mindee 4.0.0 → 4.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/bin/cli_products.rb +172 -0
- data/bin/mindee.rb +6 -121
- data/docs/advanced_file_operations.md +7 -9
- data/docs/code_samples/invoice_splitter_v1_async.txt +2 -1
- data/docs/code_samples/{license_plates_v1.txt → us_mail_v2_async.txt} +1 -1
- data/docs/code_samples/workflow_execution.txt +28 -0
- data/docs/getting_started.md +1 -1
- data/docs/global_products/barcode_reader_v1.md +1 -1
- data/docs/global_products/bill_of_lading_v1.md +1 -1
- data/docs/global_products/business_card_v1.md +1 -1
- data/docs/global_products/cropper_v1.md +1 -1
- data/docs/global_products/delivery_notes_v1.md +2 -2
- data/docs/global_products/driver_license_v1.md +1 -1
- data/docs/global_products/expense_receipts_v5.md +26 -25
- data/docs/global_products/financial_document_v1.md +34 -33
- data/docs/global_products/international_id_v2.md +7 -7
- data/docs/global_products/invoice_splitter_v1.md +53 -33
- data/docs/global_products/invoices_v4.md +19 -19
- data/docs/global_products/multi_receipts_detector_v1.md +1 -1
- data/docs/global_products/nutrition_facts_v1.md +1 -1
- data/docs/global_products/passport_v1.md +1 -1
- data/docs/global_products/resume_v1.md +4 -4
- data/docs/global_products/universal.md +1 -1
- data/docs/global_products.md +1 -1
- data/docs/loading_a_document.md +87 -73
- data/docs/localized_products/bank_account_details_v2.md +1 -1
- data/docs/localized_products/bank_check_v1.md +1 -1
- data/docs/localized_products/bank_statement_fr_v2.md +1 -1
- data/docs/localized_products/carte_grise_v1.md +1 -1
- data/docs/localized_products/energy_bill_fra_v1.md +11 -3
- data/docs/localized_products/french_healthcard_v1.md +1 -1
- data/docs/localized_products/idcard_fr_v2.md +6 -6
- data/docs/localized_products/ind_passport_v1.md +5 -5
- data/docs/localized_products/payslip_fra_v3.md +1 -1
- data/docs/localized_products/us_healthcare_cards_v1.md +2 -2
- data/docs/localized_products/us_mail_v3.md +1 -1
- data/docs/localized_products/us_w9_v1.md +1 -1
- data/docs/localized_products.md +1 -1
- data/lib/mindee/client.rb +6 -8
- data/lib/mindee/geometry/polygon.rb +1 -1
- data/lib/mindee/http/workflow_endpoint.rb +23 -23
- data/lib/mindee/pdf/pdf_extractor.rb +3 -3
- data/lib/mindee/product/delivery_note/delivery_note_v1_document.rb +1 -1
- data/lib/mindee/product/delivery_note/delivery_note_v1_page.rb +1 -1
- data/lib/mindee/product/financial_document/financial_document_v1_document.rb +15 -14
- data/lib/mindee/product/financial_document/financial_document_v1_line_item.rb +1 -1
- data/lib/mindee/product/financial_document/financial_document_v1_line_items.rb +1 -1
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_document.rb +5 -1
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_usage.rb +18 -0
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_usages.rb +4 -0
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rb +2 -2
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_page.rb +1 -1
- data/lib/mindee/product/invoice/invoice_v4_document.rb +14 -14
- data/lib/mindee/product/invoice/invoice_v4_line_item.rb +2 -2
- data/lib/mindee/product/invoice/invoice_v4_line_items.rb +1 -1
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1.rb +2 -2
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_document.rb +38 -42
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb +55 -0
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_groups.rb +48 -0
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_page.rb +9 -5
- data/lib/mindee/product/receipt/receipt_v5_document.rb +8 -8
- data/lib/mindee/product/receipt/receipt_v5_line_item.rb +1 -1
- data/lib/mindee/product/receipt/receipt_v5_line_items.rb +1 -1
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb +1 -1
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_page.rb +1 -1
- data/lib/mindee/product/{eu/license_plate/license_plate_v1.rb → us/us_mail/us_mail_v2.rb} +13 -13
- data/lib/mindee/product/us/us_mail/us_mail_v2_document.rb +105 -0
- data/lib/mindee/product/{eu/license_plate/license_plate_v1_page.rb → us/us_mail/us_mail_v2_page.rb} +8 -8
- data/lib/mindee/product/us/us_mail/us_mail_v2_recipient_address.rb +105 -0
- data/lib/mindee/product/us/us_mail/us_mail_v2_recipient_addresses.rb +63 -0
- data/lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb +66 -0
- data/lib/mindee/product.rb +5 -5
- data/lib/mindee/version.rb +1 -1
- data/mindee.gemspec +11 -11
- data/sig/custom/net_http.rbs +5 -0
- data/sig/mindee/client.rbs +1 -0
- data/sig/mindee/http/workflow_endpoint.rbs +8 -2
- data/sig/mindee/pdf/pdf_extractor.rbs +1 -1
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_items.rbs +1 -1
- data/sig/mindee/product/financial_document/financial_document_v1_line_items.rbs +1 -1
- data/sig/mindee/product/fr/bank_statement/bank_statement_v2_transactions.rbs +1 -1
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_usage.rbs +2 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_usages.rbs +1 -1
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_subscriptions.rbs +1 -1
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rbs +1 -1
- data/sig/mindee/product/fr/payslip/payslip_v2_salary_details.rbs +1 -1
- data/sig/mindee/product/fr/payslip/payslip_v3_paid_time_offs.rbs +1 -1
- data/sig/mindee/product/fr/payslip/payslip_v3_salary_details.rbs +1 -1
- data/sig/mindee/product/invoice/invoice_v4_line_items.rbs +1 -1
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1.rbs +1 -4
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_document.rbs +5 -9
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rbs +14 -0
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_groups.rbs +13 -0
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_page.rbs +2 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rbs +1 -1
- data/sig/mindee/product/receipt/receipt_v5_line_items.rbs +1 -1
- data/sig/mindee/product/resume/resume_v1_certificates.rbs +1 -1
- data/sig/mindee/product/resume/resume_v1_educations.rbs +1 -1
- data/sig/mindee/product/resume/resume_v1_languages.rbs +1 -1
- data/sig/mindee/product/resume/resume_v1_professional_experiences.rbs +1 -1
- data/sig/mindee/product/resume/resume_v1_social_networks_urls.rbs +1 -1
- data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rbs +1 -1
- data/sig/mindee/product/us/us_mail/us_mail_v2.rbs +13 -0
- data/sig/mindee/product/us/us_mail/us_mail_v2_document.rbs +20 -0
- data/sig/mindee/product/{eu/license_plate/license_plate_v1_page.rbs → us/us_mail/us_mail_v2_page.rbs} +5 -5
- data/sig/mindee/product/us/us_mail/us_mail_v2_recipient_address.rbs +22 -0
- data/sig/mindee/product/us/us_mail/us_mail_v2_recipient_addresses.rbs +15 -0
- data/sig/mindee/product/us/us_mail/us_mail_v2_sender_address.rbs +18 -0
- data/sig/mindee/product/us/us_mail/us_mail_v3_recipient_addresses.rbs +1 -1
- metadata +39 -28
- data/docs/localized_products/license_plates_v1.md +0 -112
- data/lib/mindee/product/eu/license_plate/license_plate_v1_document.rb +0 -37
- data/sig/mindee/product/eu/license_plate/license_plate_v1.rbs +0 -13
- data/sig/mindee/product/eu/license_plate/license_plate_v1_document.rbs +0 -15
@@ -1,5 +1,5 @@
|
|
1
1
|
---
|
2
|
-
title:
|
2
|
+
title: Financial Document
|
3
3
|
category: 622b805aaec68102ea7fcbc2
|
4
4
|
slug: ruby-financial-document-ocr
|
5
5
|
parentDoc: 67b49df15b843f3fa9cd622b
|
@@ -284,7 +284,7 @@ objects, it has access to a custom `to_s` method that can render a `TaxField` ob
|
|
284
284
|
Fields which are specific to this product; they are not used in any other product.
|
285
285
|
|
286
286
|
### Line Items Field
|
287
|
-
List of line item
|
287
|
+
List of line item present on the document.
|
288
288
|
|
289
289
|
A `FinancialDocumentV1LineItem` implements the following attributes:
|
290
290
|
|
@@ -308,17 +308,17 @@ puts result.document.inference.prediction.billing_address.value
|
|
308
308
|
```
|
309
309
|
|
310
310
|
## Purchase Category
|
311
|
-
**category** ([ClassificationField](#classification-field)): The purchase category
|
311
|
+
**category** ([ClassificationField](#classification-field)): The purchase category, only for receipts.
|
312
312
|
|
313
313
|
#### Possible values include:
|
314
|
-
- toll
|
315
|
-
- food
|
316
|
-
- parking
|
317
|
-
- transport
|
318
|
-
- accommodation
|
319
|
-
- gasoline
|
320
|
-
- telecom
|
321
|
-
- miscellaneous
|
314
|
+
- 'toll'
|
315
|
+
- 'food'
|
316
|
+
- 'parking'
|
317
|
+
- 'transport'
|
318
|
+
- 'accommodation'
|
319
|
+
- 'gasoline'
|
320
|
+
- 'telecom'
|
321
|
+
- 'miscellaneous'
|
322
322
|
|
323
323
|
```rb
|
324
324
|
puts result.document.inference.prediction.category.value
|
@@ -332,7 +332,7 @@ puts result.document.inference.prediction.customer_address.value
|
|
332
332
|
```
|
333
333
|
|
334
334
|
## Customer Company Registrations
|
335
|
-
**customer_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company
|
335
|
+
**customer_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company registration numbers associated to the customer.
|
336
336
|
|
337
337
|
```rb
|
338
338
|
result.document.inference.prediction.customer_company_registrations do |customer_company_registrations_elem|
|
@@ -362,20 +362,20 @@ puts result.document.inference.prediction.date.value
|
|
362
362
|
```
|
363
363
|
|
364
364
|
## Document Number
|
365
|
-
**document_number** ([StringField](#string-field)): The document number or identifier.
|
365
|
+
**document_number** ([StringField](#string-field)): The document number or identifier (invoice number or receipt number).
|
366
366
|
|
367
367
|
```rb
|
368
368
|
puts result.document.inference.prediction.document_number.value
|
369
369
|
```
|
370
370
|
|
371
371
|
## Document Type
|
372
|
-
**document_type** ([ClassificationField](#classification-field)):
|
372
|
+
**document_type** ([ClassificationField](#classification-field)): The type of the document: INVOICE or CREDIT NOTE if it is an invoice, CREDIT CARD RECEIPT or EXPENSE RECEIPT if it is a receipt.
|
373
373
|
|
374
374
|
#### Possible values include:
|
375
|
-
- INVOICE
|
376
|
-
- CREDIT NOTE
|
377
|
-
- CREDIT CARD RECEIPT
|
378
|
-
- EXPENSE RECEIPT
|
375
|
+
- 'INVOICE'
|
376
|
+
- 'CREDIT NOTE'
|
377
|
+
- 'CREDIT CARD RECEIPT'
|
378
|
+
- 'EXPENSE RECEIPT'
|
379
379
|
|
380
380
|
```rb
|
381
381
|
puts result.document.inference.prediction.document_type.value
|
@@ -396,7 +396,7 @@ puts result.document.inference.prediction.invoice_number.value
|
|
396
396
|
```
|
397
397
|
|
398
398
|
## Line Items
|
399
|
-
**line_items** (Array<[FinancialDocumentV1LineItem](#line-items-field)>): List of line item
|
399
|
+
**line_items** (Array<[FinancialDocumentV1LineItem](#line-items-field)>): List of line item present on the document.
|
400
400
|
|
401
401
|
```rb
|
402
402
|
result.document.inference.prediction.line_items do |line_items_elem|
|
@@ -405,7 +405,7 @@ end
|
|
405
405
|
```
|
406
406
|
|
407
407
|
## Locale
|
408
|
-
**locale** ([LocaleField](#locale-field)): The locale
|
408
|
+
**locale** ([LocaleField](#locale-field)): The locale of the document.
|
409
409
|
|
410
410
|
```rb
|
411
411
|
puts result.document.inference.prediction.locale.value
|
@@ -419,7 +419,7 @@ puts result.document.inference.prediction.payment_date.value
|
|
419
419
|
```
|
420
420
|
|
421
421
|
## Purchase Order Number
|
422
|
-
**po_number** ([StringField](#string-field)): The purchase order number.
|
422
|
+
**po_number** ([StringField](#string-field)): The purchase order number, only if the document is an invoice.
|
423
423
|
|
424
424
|
```rb
|
425
425
|
puts result.document.inference.prediction.po_number.value
|
@@ -433,7 +433,7 @@ puts result.document.inference.prediction.receipt_number.value
|
|
433
433
|
```
|
434
434
|
|
435
435
|
## Reference Numbers
|
436
|
-
**reference_numbers** (Array<[StringField](#string-field)>): List of Reference numbers, including PO number.
|
436
|
+
**reference_numbers** (Array<[StringField](#string-field)>): List of Reference numbers, including PO number, only if the document is an invoice.
|
437
437
|
|
438
438
|
```rb
|
439
439
|
result.document.inference.prediction.reference_numbers do |reference_numbers_elem|
|
@@ -449,14 +449,15 @@ puts result.document.inference.prediction.shipping_address.value
|
|
449
449
|
```
|
450
450
|
|
451
451
|
## Purchase Subcategory
|
452
|
-
**subcategory** ([ClassificationField](#classification-field)): The purchase subcategory
|
452
|
+
**subcategory** ([ClassificationField](#classification-field)): The purchase subcategory for transport and food, only for receipts.
|
453
453
|
|
454
454
|
#### Possible values include:
|
455
|
-
- plane
|
456
|
-
- taxi
|
457
|
-
- train
|
458
|
-
- restaurant
|
459
|
-
- shopping
|
455
|
+
- 'plane'
|
456
|
+
- 'taxi'
|
457
|
+
- 'train'
|
458
|
+
- 'restaurant'
|
459
|
+
- 'shopping'
|
460
|
+
- nil
|
460
461
|
|
461
462
|
```rb
|
462
463
|
puts result.document.inference.prediction.subcategory.value
|
@@ -470,7 +471,7 @@ puts result.document.inference.prediction.supplier_address.value
|
|
470
471
|
```
|
471
472
|
|
472
473
|
## Supplier Company Registrations
|
473
|
-
**supplier_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company
|
474
|
+
**supplier_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company registration numbers associated to the supplier.
|
474
475
|
|
475
476
|
```rb
|
476
477
|
result.document.inference.prediction.supplier_company_registrations do |supplier_company_registrations_elem|
|
@@ -493,7 +494,7 @@ puts result.document.inference.prediction.supplier_name.value
|
|
493
494
|
```
|
494
495
|
|
495
496
|
## Supplier Payment Details
|
496
|
-
**supplier_payment_details** (Array<[PaymentDetailsField](#payment-details-field)>): List of payment details associated to the supplier.
|
497
|
+
**supplier_payment_details** (Array<[PaymentDetailsField](#payment-details-field)>): List of payment details associated to the supplier (only for invoices).
|
497
498
|
|
498
499
|
```rb
|
499
500
|
result.document.inference.prediction.supplier_payment_details do |supplier_payment_details_elem|
|
@@ -519,7 +520,7 @@ puts result.document.inference.prediction.supplier_website.value
|
|
519
520
|
```
|
520
521
|
|
521
522
|
## Taxes
|
522
|
-
**taxes** (Array<[TaxField](#taxes-field)>): List of
|
523
|
+
**taxes** (Array<[TaxField](#taxes-field)>): List of all taxes on the document.
|
523
524
|
|
524
525
|
```rb
|
525
526
|
result.document.inference.prediction.taxes do |taxes_elem|
|
@@ -528,7 +529,7 @@ end
|
|
528
529
|
```
|
529
530
|
|
530
531
|
## Purchase Time
|
531
|
-
**time** ([StringField](#string-field)): The time the purchase was made.
|
532
|
+
**time** ([StringField](#string-field)): The time the purchase was made (only for receipts).
|
532
533
|
|
533
534
|
```rb
|
534
535
|
puts result.document.inference.prediction.time.value
|
@@ -556,7 +557,7 @@ puts result.document.inference.prediction.total_net.value
|
|
556
557
|
```
|
557
558
|
|
558
559
|
## Total Tax
|
559
|
-
**total_tax** ([AmountField](#amount-field)): The
|
560
|
+
**total_tax** ([AmountField](#amount-field)): The sum of all taxes present on the document.
|
560
561
|
|
561
562
|
```rb
|
562
563
|
puts result.document.inference.prediction.total_tax.value
|
@@ -1,5 +1,5 @@
|
|
1
1
|
---
|
2
|
-
title:
|
2
|
+
title: International ID
|
3
3
|
category: 622b805aaec68102ea7fcbc2
|
4
4
|
slug: ruby-international-id-ocr
|
5
5
|
parentDoc: 67b49df15b843f3fa9cd622b
|
@@ -168,12 +168,12 @@ puts result.document.inference.prediction.document_number.value
|
|
168
168
|
**document_type** ([ClassificationField](#classification-field)): The type of personal identification document.
|
169
169
|
|
170
170
|
#### Possible values include:
|
171
|
-
- IDENTIFICATION_CARD
|
172
|
-
- PASSPORT
|
173
|
-
- DRIVER_LICENSE
|
174
|
-
- VISA
|
175
|
-
- RESIDENCY_CARD
|
176
|
-
- VOTER_REGISTRATION
|
171
|
+
- 'IDENTIFICATION_CARD'
|
172
|
+
- 'PASSPORT'
|
173
|
+
- 'DRIVER_LICENSE'
|
174
|
+
- 'VISA'
|
175
|
+
- 'RESIDENCY_CARD'
|
176
|
+
- 'VOTER_REGISTRATION'
|
177
177
|
|
178
178
|
```rb
|
179
179
|
puts result.document.inference.prediction.document_type.value
|
@@ -1,35 +1,42 @@
|
|
1
1
|
---
|
2
|
-
title: Invoice Splitter
|
2
|
+
title: Invoice Splitter
|
3
3
|
category: 622b805aaec68102ea7fcbc2
|
4
4
|
slug: ruby-invoice-splitter-ocr
|
5
5
|
parentDoc: 67b49df15b843f3fa9cd622b
|
6
6
|
---
|
7
7
|
The Ruby Client Library supports the [Invoice Splitter API](https://platform.mindee.com/mindee/invoice_splitter).
|
8
8
|
|
9
|
+
|
9
10
|
> 📝 Product Specs
|
10
11
|
>
|
11
|
-
> | Specification | Details
|
12
|
-
> | ------------------------------
|
13
|
-
> | Endpoint Name | `invoice_splitter`
|
14
|
-
> | Recommended Version | `v1.2`
|
15
|
-
> | Supports Polling/Webhooks | ✔️ Yes
|
16
|
-
> | Support Synchronous HTTP Calls | ❌ No
|
17
|
-
> | Geography | 🌐 Global
|
12
|
+
> | Specification | Details |
|
13
|
+
> | ------------------------------ | -------------------------------------------------- |
|
14
|
+
> | Endpoint Name | `invoice_splitter` |
|
15
|
+
> | Recommended Version | `v1.2` |
|
16
|
+
> | Supports Polling/Webhooks | ✔️ Yes |
|
17
|
+
> | Support Synchronous HTTP Calls | ❌ No |
|
18
|
+
> | Geography | 🌐 Global |
|
18
19
|
|
19
20
|
> 🔐 Polling Limitations
|
20
21
|
>
|
21
22
|
> | Setting | Parameter name | Default Value |
|
22
|
-
> | ------------------------------- | -----------------------
|
23
|
+
> | ------------------------------- | ----------------------- | ------------- |
|
23
24
|
> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds |
|
24
25
|
> | Default Delay Between Calls | `delay_sec` | 1.5 seconds |
|
25
26
|
> | Polling Attempts Before Timeout | `max_retries` | 80 retries |
|
26
27
|
|
27
|
-
Using [this sample](https://github.com/mindee/client-lib-test-data/blob/main/products/invoice_splitter/default_sample.pdf), we are going to illustrate detect the pages of multiple invoices within the same document using the
|
28
|
-
Ruby Client Library.
|
29
28
|
|
30
|
-
|
29
|
+
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/invoice_splitter/default_sample.pdf),
|
30
|
+
we are going to illustrate how to extract the data that we want using the Ruby Client Library.
|
31
|
+

|
31
32
|
|
33
|
+
# Quick-Start
|
32
34
|
```rb
|
35
|
+
#
|
36
|
+
# Install the Ruby client library by running:
|
37
|
+
# gem install mindee
|
38
|
+
#
|
39
|
+
|
33
40
|
require 'mindee'
|
34
41
|
|
35
42
|
# Init a new client
|
@@ -38,6 +45,7 @@ mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
|
38
45
|
# Load a file from disk
|
39
46
|
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
40
47
|
|
48
|
+
# Parse the file
|
41
49
|
result = mindee_client.parse(
|
42
50
|
input_source,
|
43
51
|
Mindee::Product::InvoiceSplitter::InvoiceSplitterV1
|
@@ -60,46 +68,58 @@ Document
|
|
60
68
|
|
61
69
|
Inference
|
62
70
|
#########
|
63
|
-
:Product: mindee/invoice_splitter v1.
|
71
|
+
:Product: mindee/invoice_splitter v1.2
|
64
72
|
:Rotation applied: No
|
65
73
|
|
66
74
|
Prediction
|
67
75
|
==========
|
68
76
|
:Invoice Page Groups:
|
69
|
-
|
70
|
-
|
77
|
+
+--------------------------------------------------------------------------+
|
78
|
+
| Page Indexes |
|
79
|
+
+==========================================================================+
|
80
|
+
| 0 |
|
81
|
+
+--------------------------------------------------------------------------+
|
82
|
+
| 1 |
|
83
|
+
+--------------------------------------------------------------------------+
|
84
|
+
```
|
71
85
|
|
72
|
-
|
73
|
-
|
86
|
+
# Field Types
|
87
|
+
## Standard Fields
|
88
|
+
These fields are generic and used in several products.
|
74
89
|
|
75
|
-
|
76
|
-
|
77
|
-
|
90
|
+
### Basic Field
|
91
|
+
Each prediction object contains a set of fields that inherit from the generic `Field` class.
|
92
|
+
A typical `Field` object will have the following attributes:
|
78
93
|
|
79
|
-
|
80
|
-
|
81
|
-
:
|
82
|
-
|
94
|
+
* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted.
|
95
|
+
* **confidence** (Float, nil): the confidence score of the field prediction.
|
96
|
+
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
97
|
+
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
98
|
+
* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
|
99
|
+
* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
100
|
+
|
101
|
+
|
102
|
+
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.
|
83
103
|
|
84
|
-
# Field Types
|
85
104
|
## Specific Fields
|
86
|
-
|
87
|
-
|
105
|
+
Fields which are specific to this product; they are not used in any other product.
|
106
|
+
|
107
|
+
### Invoice Page Groups Field
|
108
|
+
List of page groups. Each group represents a single invoice within a multi-invoice document.
|
88
109
|
|
89
|
-
|
110
|
+
A `InvoiceSplitterV1InvoicePageGroup` implements the following attributes:
|
90
111
|
|
91
|
-
*
|
92
|
-
* **confidence** (`Float`): The confidence of the prediction.
|
112
|
+
* `page_indexes` (Array<Integer>): List of page indexes that belong to the same invoice (group).
|
93
113
|
|
94
114
|
# Attributes
|
95
115
|
The following fields are extracted for Invoice Splitter V1:
|
96
116
|
|
97
117
|
## Invoice Page Groups
|
98
|
-
**invoice_page_groups** (Array<[
|
118
|
+
**invoice_page_groups** (Array<[InvoiceSplitterV1InvoicePageGroup](#invoice-page-groups-field)>): List of page groups. Each group represents a single invoice within a multi-invoice document.
|
99
119
|
|
100
120
|
```rb
|
101
|
-
result.document.inference.prediction.invoice_page_groups
|
102
|
-
puts invoice_page_groups_elem.
|
121
|
+
result.document.inference.prediction.invoice_page_groups do |invoice_page_groups_elem|
|
122
|
+
puts invoice_page_groups_elem.value
|
103
123
|
end
|
104
124
|
```
|
105
125
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
---
|
2
|
-
title:
|
2
|
+
title: Invoice
|
3
3
|
category: 622b805aaec68102ea7fcbc2
|
4
4
|
slug: ruby-invoice-ocr
|
5
5
|
parentDoc: 67b49df15b843f3fa9cd622b
|
@@ -272,12 +272,12 @@ objects, it has access to a custom `to_s` method that can render a `TaxField` ob
|
|
272
272
|
Fields which are specific to this product; they are not used in any other product.
|
273
273
|
|
274
274
|
### Line Items Field
|
275
|
-
List of line
|
275
|
+
List of all the line items present on the invoice.
|
276
276
|
|
277
277
|
A `InvoiceV4LineItem` implements the following attributes:
|
278
278
|
|
279
279
|
* `description` (String): The item description.
|
280
|
-
* `product_code` (String): The product code
|
280
|
+
* `product_code` (String): The product code of the item.
|
281
281
|
* `quantity` (Float): The item quantity
|
282
282
|
* `tax_amount` (Float): The item tax amount.
|
283
283
|
* `tax_rate` (Float): The item tax rate in percentage.
|
@@ -289,7 +289,7 @@ A `InvoiceV4LineItem` implements the following attributes:
|
|
289
289
|
The following fields are extracted for Invoice V4:
|
290
290
|
|
291
291
|
## Billing Address
|
292
|
-
**billing_address** ([StringField](#string-field)): The customer
|
292
|
+
**billing_address** ([StringField](#string-field)): The customer billing address.
|
293
293
|
|
294
294
|
```rb
|
295
295
|
puts result.document.inference.prediction.billing_address.value
|
@@ -303,7 +303,7 @@ puts result.document.inference.prediction.customer_address.value
|
|
303
303
|
```
|
304
304
|
|
305
305
|
## Customer Company Registrations
|
306
|
-
**customer_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company
|
306
|
+
**customer_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company registration numbers associated to the customer.
|
307
307
|
|
308
308
|
```rb
|
309
309
|
result.document.inference.prediction.customer_company_registrations do |customer_company_registrations_elem|
|
@@ -333,11 +333,11 @@ puts result.document.inference.prediction.date.value
|
|
333
333
|
```
|
334
334
|
|
335
335
|
## Document Type
|
336
|
-
**document_type** ([ClassificationField](#classification-field)):
|
336
|
+
**document_type** ([ClassificationField](#classification-field)): Document type: INVOICE or CREDIT NOTE.
|
337
337
|
|
338
338
|
#### Possible values include:
|
339
|
-
- INVOICE
|
340
|
-
- CREDIT NOTE
|
339
|
+
- 'INVOICE'
|
340
|
+
- 'CREDIT NOTE'
|
341
341
|
|
342
342
|
```rb
|
343
343
|
puts result.document.inference.prediction.document_type.value
|
@@ -358,7 +358,7 @@ puts result.document.inference.prediction.invoice_number.value
|
|
358
358
|
```
|
359
359
|
|
360
360
|
## Line Items
|
361
|
-
**line_items** (Array<[InvoiceV4LineItem](#line-items-field)>): List of line
|
361
|
+
**line_items** (Array<[InvoiceV4LineItem](#line-items-field)>): List of all the line items present on the invoice.
|
362
362
|
|
363
363
|
```rb
|
364
364
|
result.document.inference.prediction.line_items do |line_items_elem|
|
@@ -367,14 +367,14 @@ end
|
|
367
367
|
```
|
368
368
|
|
369
369
|
## Locale
|
370
|
-
**locale** ([LocaleField](#locale-field)): The locale
|
370
|
+
**locale** ([LocaleField](#locale-field)): The locale of the document.
|
371
371
|
|
372
372
|
```rb
|
373
373
|
puts result.document.inference.prediction.locale.value
|
374
374
|
```
|
375
375
|
|
376
376
|
## Payment Date
|
377
|
-
**payment_date** ([DateField](#date-field)): The date on which the payment is due/ was full-filled.
|
377
|
+
**payment_date** ([DateField](#date-field)): The date on which the payment is due / was full-filled.
|
378
378
|
|
379
379
|
```rb
|
380
380
|
puts result.document.inference.prediction.payment_date.value
|
@@ -388,7 +388,7 @@ puts result.document.inference.prediction.po_number.value
|
|
388
388
|
```
|
389
389
|
|
390
390
|
## Reference Numbers
|
391
|
-
**reference_numbers** (Array<[StringField](#string-field)>): List of
|
391
|
+
**reference_numbers** (Array<[StringField](#string-field)>): List of all reference numbers on the invoice, including the purchase order number.
|
392
392
|
|
393
393
|
```rb
|
394
394
|
result.document.inference.prediction.reference_numbers do |reference_numbers_elem|
|
@@ -411,7 +411,7 @@ puts result.document.inference.prediction.supplier_address.value
|
|
411
411
|
```
|
412
412
|
|
413
413
|
## Supplier Company Registrations
|
414
|
-
**supplier_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company
|
414
|
+
**supplier_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company registration numbers associated to the supplier.
|
415
415
|
|
416
416
|
```rb
|
417
417
|
result.document.inference.prediction.supplier_company_registrations do |supplier_company_registrations_elem|
|
@@ -420,7 +420,7 @@ end
|
|
420
420
|
```
|
421
421
|
|
422
422
|
## Supplier Email
|
423
|
-
**supplier_email** ([StringField](#string-field)): The email of the supplier or merchant.
|
423
|
+
**supplier_email** ([StringField](#string-field)): The email address of the supplier or merchant.
|
424
424
|
|
425
425
|
```rb
|
426
426
|
puts result.document.inference.prediction.supplier_email.value
|
@@ -434,7 +434,7 @@ puts result.document.inference.prediction.supplier_name.value
|
|
434
434
|
```
|
435
435
|
|
436
436
|
## Supplier Payment Details
|
437
|
-
**supplier_payment_details** (Array<[PaymentDetailsField](#payment-details-field)>): List of payment details associated to the supplier.
|
437
|
+
**supplier_payment_details** (Array<[PaymentDetailsField](#payment-details-field)>): List of payment details associated to the supplier of the invoice.
|
438
438
|
|
439
439
|
```rb
|
440
440
|
result.document.inference.prediction.supplier_payment_details do |supplier_payment_details_elem|
|
@@ -460,7 +460,7 @@ puts result.document.inference.prediction.supplier_website.value
|
|
460
460
|
```
|
461
461
|
|
462
462
|
## Taxes
|
463
|
-
**taxes** (Array<[TaxField](#taxes-field)>): List of
|
463
|
+
**taxes** (Array<[TaxField](#taxes-field)>): List of taxes. Each item contains the detail of the tax.
|
464
464
|
|
465
465
|
```rb
|
466
466
|
result.document.inference.prediction.taxes do |taxes_elem|
|
@@ -469,21 +469,21 @@ end
|
|
469
469
|
```
|
470
470
|
|
471
471
|
## Total Amount
|
472
|
-
**total_amount** ([AmountField](#amount-field)): The total amount
|
472
|
+
**total_amount** ([AmountField](#amount-field)): The total amount of the invoice: includes taxes, tips, fees, and other charges.
|
473
473
|
|
474
474
|
```rb
|
475
475
|
puts result.document.inference.prediction.total_amount.value
|
476
476
|
```
|
477
477
|
|
478
478
|
## Total Net
|
479
|
-
**total_net** ([AmountField](#amount-field)): The net amount
|
479
|
+
**total_net** ([AmountField](#amount-field)): The net amount of the invoice: does not include taxes, fees, and discounts.
|
480
480
|
|
481
481
|
```rb
|
482
482
|
puts result.document.inference.prediction.total_net.value
|
483
483
|
```
|
484
484
|
|
485
485
|
## Total Tax
|
486
|
-
**total_tax** ([AmountField](#amount-field)): The total tax:
|
486
|
+
**total_tax** ([AmountField](#amount-field)): The total tax: the sum of all the taxes for this invoice.
|
487
487
|
|
488
488
|
```rb
|
489
489
|
puts result.document.inference.prediction.total_tax.value
|
@@ -1,5 +1,5 @@
|
|
1
1
|
---
|
2
|
-
title:
|
2
|
+
title: Resume
|
3
3
|
category: 622b805aaec68102ea7fcbc2
|
4
4
|
slug: ruby-resume-ocr
|
5
5
|
parentDoc: 67b49df15b843f3fa9cd622b
|
@@ -265,9 +265,9 @@ puts result.document.inference.prediction.document_language.value
|
|
265
265
|
**document_type** ([ClassificationField](#classification-field)): The type of the document sent.
|
266
266
|
|
267
267
|
#### Possible values include:
|
268
|
-
- RESUME
|
269
|
-
- MOTIVATION_LETTER
|
270
|
-
- RECOMMENDATION_LETTER
|
268
|
+
- 'RESUME'
|
269
|
+
- 'MOTIVATION_LETTER'
|
270
|
+
- 'RECOMMENDATION_LETTER'
|
271
271
|
|
272
272
|
```rb
|
273
273
|
puts result.document.inference.prediction.document_type.value
|
data/docs/global_products.md
CHANGED