From 5f19b2fa1553ecb57e559e2df06fbcd35cde2a41 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Tue, 18 Nov 2025 09:29:13 +0100 Subject: [PATCH] :bookmark: Version 4.8.0 --- CHANGELOG.md | 8 + docs/advanced_file_operations.md | 109 ---- docs/getting_started.md | 257 -------- docs/global_products.md | 6 - docs/global_products/barcode_reader_v1.md | 125 ---- docs/global_products/bill_of_lading_v1.md | 276 -------- docs/global_products/business_card_v1.md | 194 ------ docs/global_products/cropper_v1.md | 123 ---- docs/global_products/delivery_notes_v1.md | 168 ----- docs/global_products/driver_license_v1.md | 212 ------ docs/global_products/expense_receipts_v5.md | 415 ------------ docs/global_products/financial_document_v1.md | 615 ------------------ docs/global_products/international_id_v2.md | 264 -------- docs/global_products/invoice_splitter_v1.md | 127 ---- docs/global_products/invoices_v4.md | 576 ---------------- .../multi_receipts_detector_v1.md | 131 ---- docs/global_products/nutrition_facts_v1.md | 399 ------------ docs/global_products/passport_v1.md | 207 ------ docs/global_products/resume_v1.md | 384 ----------- docs/global_products/universal.md | 113 ---- docs/loading_a_document.md | 330 ---------- docs/localized_products.md | 6 - .../bank_account_details_v2.md | 158 ----- docs/localized_products/bank_check_v1.md | 205 ------ .../bank_statement_fr_v2.md | 269 -------- docs/localized_products/carte_grise_v1.md | 475 -------------- docs/localized_products/energy_bill_fra_v1.md | 342 ---------- .../french_healthcard_v1.md | 142 ---- docs/localized_products/idcard_fr_v2.md | 284 -------- docs/localized_products/ind_passport_v1.md | 307 --------- docs/localized_products/payslip_fra_v3.md | 344 ---------- .../us_healthcare_cards_v1.md | 258 -------- docs/localized_products/us_mail_v3.md | 152 ----- lib/mindee/version.rb | 2 +- 34 files changed, 9 insertions(+), 7974 deletions(-) delete mode 100644 docs/advanced_file_operations.md delete mode 100644 docs/getting_started.md delete mode 100644 docs/global_products.md delete mode 100644 docs/global_products/barcode_reader_v1.md delete mode 100644 docs/global_products/bill_of_lading_v1.md delete mode 100644 docs/global_products/business_card_v1.md delete mode 100644 docs/global_products/cropper_v1.md delete mode 100644 docs/global_products/delivery_notes_v1.md delete mode 100644 docs/global_products/driver_license_v1.md delete mode 100644 docs/global_products/expense_receipts_v5.md delete mode 100644 docs/global_products/financial_document_v1.md delete mode 100644 docs/global_products/international_id_v2.md delete mode 100644 docs/global_products/invoice_splitter_v1.md delete mode 100644 docs/global_products/invoices_v4.md delete mode 100644 docs/global_products/multi_receipts_detector_v1.md delete mode 100644 docs/global_products/nutrition_facts_v1.md delete mode 100644 docs/global_products/passport_v1.md delete mode 100644 docs/global_products/resume_v1.md delete mode 100644 docs/global_products/universal.md delete mode 100644 docs/loading_a_document.md delete mode 100644 docs/localized_products.md delete mode 100644 docs/localized_products/bank_account_details_v2.md delete mode 100644 docs/localized_products/bank_check_v1.md delete mode 100644 docs/localized_products/bank_statement_fr_v2.md delete mode 100644 docs/localized_products/carte_grise_v1.md delete mode 100644 docs/localized_products/energy_bill_fra_v1.md delete mode 100644 docs/localized_products/french_healthcard_v1.md delete mode 100644 docs/localized_products/idcard_fr_v2.md delete mode 100644 docs/localized_products/ind_passport_v1.md delete mode 100644 docs/localized_products/payslip_fra_v3.md delete mode 100644 docs/localized_products/us_healthcare_cards_v1.md delete mode 100644 docs/localized_products/us_mail_v3.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 61cf48fb0..487dae7de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Mindee Ruby API Library Changelog +## v4.8.0 - 2025-11-18 +### Changes +* :sparkles: add support for better errors +* :sparkles: add support for RAG metadata +### Fixes +* :recycle: harmonize test structure with other libraries + + ## v4.7.2 - 2025-10-13 ### Changes * :recycle: harmonize getting page count from a local input source diff --git a/docs/advanced_file_operations.md b/docs/advanced_file_operations.md deleted file mode 100644 index 175863df5..000000000 --- a/docs/advanced_file_operations.md +++ /dev/null @@ -1,109 +0,0 @@ ---- -title: Advanced File Operations -category: 622b805aaec68102ea7fcbc2 -slug: ruby-advanced-file-operations -parentDoc: 6294d97ee723f1008d2ab28e ---- - -> โ—๏ธ Disclaimer: the file operations listed below do not directly manipulate the files you will pass to the library, -> They will instead create a copy before applying any operations, which means that the file you send may not be an exact copy of the file the server will receive. -> To avoid any unexpected or unwanted result, you can save a copy of the created file locally to inspect it visually before sending it. - -## Image compression - -The compression functionality for image files (JPEG, PNG, etc.) via the `compress!` method available on a -LocalInputSource. This method allows you to reduce file size by specifying quality and dimension constraints. - -Example: - -```rb -# Compress an image with custom parameters. -input_source.compress!(quality: 85, max_width: 1024, max_height: 768) -``` -> โš ๏ธ Warning: Compression alters the original image data. -> We strongly advise you inspect a compressed file before sending it: -> ```rb -> # Compress using a quality of 50%: -> input_source.compress!(quality: 50) -> input_source.write_to_file('path/to/my/compressed/file_50.jpg') -> ``` - -For reference, here's what the following levels of compression on this image will look like: - -**Original:** -![Invoice sample](https://github.com/mindee/client-lib-test-data/blob/main/products/invoices/default_sample.jpg?raw=true) - -**85% compressed:** -![85% sample](https://github.com/mindee/client-lib-test-data/blob/main/file_operations/compression/compressed_ruby_85.jpg?raw=true) - -**50% compressed:** -![50% sample](https://github.com/mindee/client-lib-test-data/blob/main/file_operations/compression/compressed_ruby_50.jpg?raw=true) - -**10% compressed:** -![10% sample](https://github.com/mindee/client-lib-test-data/blob/main/file_operations/compression/compressed_ruby_10.jpg?raw=true) - - -## PDF operations - -PDF operations include both compression and fixing features. -These are specifically designed to handle challenges associated with PDF files, such as large file sizes and formatting -issues. - -### PDF compression - -> ๐Ÿงช PDF compression is an **experimental** feature that rasterizes each page of the PDF (similar to how images are -> compressed) to reduce its overall size. -> -> Because the process involves re-rendering the PDFโ€™s contents, some source text may be lost or rendered differently. -> Use this feature with caution. - - -```rb -# Load a local input source. -input_file_path = "path/to/your/file.pdf" -output_file_path = "path/to/the/compressed/file.pdf" -pdf_input = Mindee::Input::Source::PathInputSource.new(input_file_path) - -# We advise you test the quality value yourself, as results may vary greatly depending on the input file -pdf_input.compress!(quality: 50) - -# Write the output file locally for visual checking: -File.write(output_file_path, pdf_input.io_stream.read) -``` - -> ๐Ÿšง Be warned that the source text (the text embedded in the PDF itself) might not render properly, -> and so source PDFs will be ignored by default. -> -> You can bypass this using: - -```rb -pdf_input.compress!(quality: 50, force_source_text: true) -``` - -Or alternatively, you can try to approximate the re-rendering of the source-text using: - -```rb -pdf_input.compress!(quality: 50, force_source_text: true, disable_source_text: false) -``` - -### PDF Repair - -The PDF repair feature attempts to rescue PDFs with invalid or broken header information. -This can sometimes help when files get rejected by the server. - -Example: -```rb -# Load a PDF file with the repair_pdf flag enabled. -input_source = mindee_client.source_from_file(file, "document.pdf", repair_pdf: true) -``` - -> โš ๏ธ Warning: PDF fixing alters the input file by re-writing header information. -> Use this feature only when required, as it might affect the integrity of the document file. - ---- - -Feel free to expand these examples and adjust the parameters as needed for your projects. For further details on -authentication and usage, you can refer to the [Getting Started Guide](getting_started.md). - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/getting_started.md b/docs/getting_started.md deleted file mode 100644 index c953bb3e8..000000000 --- a/docs/getting_started.md +++ /dev/null @@ -1,257 +0,0 @@ ---- -title: Getting Started -category: 622b805aaec68102ea7fcbc2 -slug: ruby-getting-started -parentDoc: 6294d97ee723f1008d2ab28e ---- -> ๐Ÿ“˜ This guide will help you get the most out of the Mindee Ruby client library to easily extract data from your documents. - -## Installation - -### Requirements -The following Ruby versions are tested and supported: 3.0, 3.1, 3.2, 3.3 - -### Standard Installation -To quickly get started with the Ruby Client Library, Install by adding this line to your application's Gemfile: - -```shell -gem 'mindee' -``` -And then execute: - -```shell -bundle install -``` -Or you can install it like this: - -```shell -gem install mindee -``` -Finally, Ruby away! - -### Development Installation -If you'll be modifying the source code, you'll need to install the required libraries to get started. - -We recommend using [Bundler](https://bundler.io/). - -1. First clone the repo. - -```shell -git clone git@github.com:mindee/mindee-api-ruby.git -``` - -2. Navigate to the cloned directory and install all required libraries. - -```shell -cd mindee-api-ruby -bundle install -``` - -### Updating the Library -It is important to always check the version of the Mindee OCR SDK you are using, as new and updated -features wonโ€™t work on older versions. - -To get the latest version of your OCR SDK: - -```shell -gem install mindee -``` - -To install a specific version of Mindee: - -```shell -gem install mindee@ -``` - -## Usage - -Using Mindee's APIs can be broken down into the following steps: - -1. [Initialize a Client](#initializing-the-client) -2. [Load a File](#loading-a-document-file) -3. [Send the File](#sending-a-file) to Mindee's API -4. [Process the Result](#process-the-result) in some way - -Let's take a deep dive into how this works. - -## Initializing the Client -The `Client` automatically connects to the default endpoints for each product (or creates one with given parameters for -Universal APIs). - -The `Client` requires your [API key](https://developers.mindee.com/docs/make-your-first-request#create-an-api-key). - -You can either pass these directly to the constructor or through environment variables. - - -### Pass the API key directly -```rb -# Init a new client and passing the key directly -mindee_client = Mindee::Client.new(api_key: 'my-api-key') -``` - -### Set the API key in the environment -API keys should be set as environment variables, especially for any production deployment. - -The following environment variable will set the global API key: -```shell -MINDEE_API_KEY=my-api-key -``` - -Then in your code: -```rb -# Init a new client without an API key -mindee_client = Mindee::Client.new -``` - -### Setting the Request Timeout -The request timeout can be set using an environment variable: -```shell -MINDEE_REQUEST_TIMEOUT=200 -``` - - -## Loading a Document File -Before being able to send a document to the API, it must first be loaded. - -You don't need to worry about different MIME types, the library will take care of handling -all supported types automatically. - -Once a document is loaded, interacting with it is done in exactly the same way, regardless -of how it was loaded. - -There are a few different ways of loading a document file, depending on your use case, you can use a: - -* [File path](https://developers.mindee.com/docs/ruby-document-loading#loading-from-a-local-path): using the Mindee Client's `source_from_path()` method. -* [File Object](https://developers.mindee.com/docs/ruby-document-loading#loading-from-a-file-object): using the Mindee Client's `source_from_file()` method. -* [Base64 String](https://developers.mindee.com/docs/ruby-document-loading#loading-from-a-base64-encoded-string): using the Mindee Client's `source_from_b64string()` method. -* [Raw Byte sequence](https://developers.mindee.com/docs/ruby-document-loading#loading-from-raw-bytes): using the Mindee Client's `source_from_bytes()` method. -* [URL](https://developers.mindee.com/docs/ruby-document-loading#loading-by-url): using the Mindee Client's `source_from_url()` method. - -More details about file loading on the [dedicated page](https://developers.mindee.com/docs/ruby-document-loading). - -## Sending a File -To send a file to the API, we need to specify how to process the document. -This will determine which API endpoint is used and how the API return will be handled internally by the library. - -More specifically, we need to set a `Mindee::Product` class as the first parameter of the `create_endpoint` method. - -This is because the `Endpoint`'s urls will be set according to it - -Each document type available in the library has its corresponding class, which inherit from the base -`Mindee::Parsing::Common::Predict` class. - -This is detailed in each document-specific guide. - -### Off-the-Shelf Documents -Simply setting the correct class is enough: - -```rb - -result = mindee_client.parse( - input_source, - Mindee::Product::Invoice::InvoiceV4 -) -``` - -#### Specific call method -Some products, such as InvoiceV4, ReceiptV5 & FinancialDocumentV1 support both asynchronous polling and synchronous -HTTP calls. -We recommend letting the client library decide which is better by default, but you can override the behavior by setting -the `enqueue` parameter to `true` or `false`. - -```rb - -result = mindee_client.parse( - input_source, - Mindee::Product::Invoice::InvoiceV4, - enqueue: false -) -``` - -> ๐Ÿšง WARNING: this feature is not available for all products, and may result in errors if used inappropriately. -> Only use it if you are certain of what you are doing. -### Universal Documents (docTI) -For custom documents, the endpoint to use must also be set, and it must take in an `endpoint_name`: - -```rb -endpoint = mindee_client.create_endpoint(endpoint_name: 'wnine', account_name: 'my-account') - -result = mindee_client.parse( - input_source, - Mindee::Product::Universal::Universal, - endpoint: endpoint -) -``` - -This is because the `Universal` class is enough to handle the return processing, but the actual endpoint needs to be -specified. - -## Process the Result -The response object is common to all documents, including custom documents (using the Universal product). The main -properties are: - -* `id` โ€” Mindee ID of the document -* `name` โ€” Filename sent to the API -* `inference` โ€” [Inference](#inference) - -### Inference -Regroups the predictions at the page level, as well as predictions for the entire document. - -* `prediction` โ€” [Document level prediction](#document-level-prediction) -* `pages` โ€” [Page level prediction](#page-level-prediction) - -#### Document level prediction -The `prediction` attribute is a `Prediction` object specific to the type of document being processed. -It contains the data extracted from the entire document, all pages combined. - -It's possible to have the same field in various pages, but at the document level, -only the highest confidence field data will be shown (this is all done automatically at the API level). - -```rb -# as an object, complete -pp result.document.inference.prediction - -# as a string, summary in RST format -puts result.document.inference.prediction -``` - -#### Page level prediction -The `pages` attribute is a list of `Prediction` objects. - -Each page element contains the data extracted for a particular page of the document. -The order of the elements in the array matches the order of the pages in the document. - -All response objects have this property, regardless of the number of pages. -Single page documents will have a single entry. - -Iteration is done like any Ruby array: -```rb -response.document.inference.pages.each do |page| - # as an object, complete - pp page.prediction - - # as a string, summary in RST format - puts page.prediction -end -``` - -#### Page Orientation -The orientation field is only available at the page level as it describes whether the page image should be rotated to -be upright. - -If the page requires rotation for correct display, the orientation field gives a prediction among these 3 possible -outputs: - -* 0 degrees: the page is already upright -* 90 degrees: the page must be rotated clockwise to be upright -* 270 degrees: the page must be rotated counterclockwise to be upright - -```rb -response.document.inference.pages.each do |page| - puts page.orientation.value -end -``` - - -## Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/global_products.md b/docs/global_products.md deleted file mode 100644 index d050b6a07..000000000 --- a/docs/global_products.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Global Products -category: 622b805aaec68102ea7fcbc2 -slug: ruby-global-products -parentDoc: 6294d97ee723f1008d2ab28e ---- \ No newline at end of file diff --git a/docs/global_products/barcode_reader_v1.md b/docs/global_products/barcode_reader_v1.md deleted file mode 100644 index bb7b8d8b6..000000000 --- a/docs/global_products/barcode_reader_v1.md +++ /dev/null @@ -1,125 +0,0 @@ ---- -title: Barcode Reader -category: 622b805aaec68102ea7fcbc2 -slug: ruby-barcode-reader-ocr -parentDoc: 67b49df15b843f3fa9cd622b ---- -The Ruby Client Library supports the [Barcode Reader API](https://platform.mindee.com/mindee/barcode_reader). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `barcode_reader` | -> | Recommended Version | `v1.0` | -> | Supports Polling/Webhooks | โŒ No | -> | Support Synchronous HTTP Calls | โœ”๏ธ Yes | -> | Geography | ๐ŸŒ Global | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/barcode_reader/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Barcode Reader sample](https://github.com/mindee/client-lib-test-data/blob/main/products/barcode_reader/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::BarcodeReader::BarcodeReaderV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: f9c48da1-a306-4805-8da8-f7231fda2d88 -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/barcode_reader v1.0 -:Rotation applied: Yes - -Prediction -========== -:Barcodes 1D: Mindee -:Barcodes 2D: https://developers.mindee.com/docs/barcode-reader-ocr - I love paperwork! - Said no one ever - -Page Predictions -================ - -Page 0 ------- -:Barcodes 1D: Mindee -:Barcodes 2D: https://developers.mindee.com/docs/barcode-reader-ocr - I love paperwork! - Said no one ever -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -# Attributes -The following fields are extracted for Barcode Reader V1: - -## Barcodes 1D -**codes_1d** (Array<[StringField](#string-field)>): List of decoded 1D barcodes. - -```rb -result.document.inference.prediction.codes_1d do |codes_1d_elem| - puts codes_1d_elem.value -end -``` - -## Barcodes 2D -**codes_2d** (Array<[StringField](#string-field)>): List of decoded 2D barcodes. - -```rb -result.document.inference.prediction.codes_2d do |codes_2d_elem| - puts codes_2d_elem.value -end -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/global_products/bill_of_lading_v1.md b/docs/global_products/bill_of_lading_v1.md deleted file mode 100644 index 5fc24188d..000000000 --- a/docs/global_products/bill_of_lading_v1.md +++ /dev/null @@ -1,276 +0,0 @@ ---- -title: Bill of Lading -category: 622b805aaec68102ea7fcbc2 -slug: ruby-bill-of-lading-ocr -parentDoc: 67b49df15b843f3fa9cd622b ---- -The Ruby Client Library supports the [Bill of Lading API](https://platform.mindee.com/mindee/bill_of_lading). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `bill_of_lading` | -> | Recommended Version | `v1.1` | -> | Supports Polling/Webhooks | โœ”๏ธ Yes | -> | Support Synchronous HTTP Calls | โŒ No | -> | Geography | ๐ŸŒ Global | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- | ------------- | -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/bill_of_lading/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Bill of Lading sample](https://github.com/mindee/client-lib-test-data/blob/main/products/bill_of_lading/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::BillOfLading::BillOfLadingV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: 3b5250a1-b52c-4e0b-bc3e-2f0146b04e29 -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/bill_of_lading v1.1 -:Rotation applied: No - -Prediction -========== -:Bill of Lading Number: XYZ123456 -:Shipper: - :Address: 123 OCEAN DRIVE, SHANGHAI, CHINA - :Email: - :Name: GLOBAL FREIGHT SOLUTIONS INC. - :Phone: 86-21-12345678 -:Consignee: - :Address: 789 TRADE STREET, SINGAPORE 567890, SINGAPORE - :Email: - :Name: PACIFIC TRADING CO. - :Phone: 65-65432100 -:Notify Party: - :Address: 789 TRADE STREET, SINGAPORE 567890, SINGAPORE - :Email: - :Name: PACIFIC TRADING CO. - :Phone: 65-65432100 -:Carrier: - :Name: GLOBAL SHIPPING CO.,LTD. - :Professional Number: - :SCAC: -:Items: - +--------------------------------------+--------------+-------------+------------------+----------+-------------+ - | Description | Gross Weight | Measurement | Measurement Unit | Quantity | Weight Unit | - +======================================+==============+=============+==================+==========+=============+ - | ELECTRONIC COMPONENTS\nP/N: 12345... | 500.00 | 1.50 | cbm | 1.00 | kgs | - +--------------------------------------+--------------+-------------+------------------+----------+-------------+ -:Port of Loading: SHANGHAI, CHINA -:Port of Discharge: LOS ANGELES, USA -:Place of Delivery: LOS ANGELES, USA -:Date of issue: 2022-09-30 -:Departure Date: -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - -### Date Field -Aside from the basic `Field` attributes, the date field `DateField` also implements the following: - -* **date_object** (`Date`): an accessible representation of the value as a JavaScript object. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -## Specific Fields -Fields which are specific to this product; they are not used in any other product. - -### Shipper Field -The party responsible for shipping the goods. - -A `BillOfLadingV1Shipper` implements the following attributes: - -* `address` (String): The address of the shipper. -* `email` (String): The email of the shipper. -* `name` (String): The name of the shipper. -* `phone` (String): The phone number of the shipper. -Fields which are specific to this product; they are not used in any other product. - -### Consignee Field -The party to whom the goods are being shipped. - -A `BillOfLadingV1Consignee` implements the following attributes: - -* `address` (String): The address of the consignee. -* `email` (String): The email of the shipper. -* `name` (String): The name of the consignee. -* `phone` (String): The phone number of the consignee. -Fields which are specific to this product; they are not used in any other product. - -### Notify Party Field -The party to be notified of the arrival of the goods. - -A `BillOfLadingV1NotifyParty` implements the following attributes: - -* `address` (String): The address of the notify party. -* `email` (String): The email of the shipper. -* `name` (String): The name of the notify party. -* `phone` (String): The phone number of the notify party. -Fields which are specific to this product; they are not used in any other product. - -### Carrier Field -The shipping company responsible for transporting the goods. - -A `BillOfLadingV1Carrier` implements the following attributes: - -* `name` (String): The name of the carrier. -* `professional_number` (String): The professional number of the carrier. -* `scac` (String): The Standard Carrier Alpha Code (SCAC) of the carrier. -Fields which are specific to this product; they are not used in any other product. - -### Items Field -The goods being shipped. - -A `BillOfLadingV1CarrierItem` implements the following attributes: - -* `description` (String): A description of the item. -* `gross_weight` (Float): The gross weight of the item. -* `measurement` (Float): The measurement of the item. -* `measurement_unit` (String): The unit of measurement for the measurement. -* `quantity` (Float): The quantity of the item being shipped. -* `weight_unit` (String): The unit of measurement for weights. - -# Attributes -The following fields are extracted for Bill of Lading V1: - -## Bill of Lading Number -**bill_of_lading_number** ([StringField](#string-field)): A unique identifier assigned to a Bill of Lading document. - -```rb -puts result.document.inference.prediction.bill_of_lading_number.value -``` - -## Carrier -**carrier** ([BillOfLadingV1Carrier](#carrier-field)): The shipping company responsible for transporting the goods. - -```rb -puts result.document.inference.prediction.carrier.value -``` - -## Items -**carrier_items** (Array<[BillOfLadingV1CarrierItem](#items-field)>): The goods being shipped. - -```rb -result.document.inference.prediction.carrier_items do |carrier_items_elem| - puts carrier_items_elem.value -end -``` - -## Consignee -**consignee** ([BillOfLadingV1Consignee](#consignee-field)): The party to whom the goods are being shipped. - -```rb -puts result.document.inference.prediction.consignee.value -``` - -## Date of issue -**date_of_issue** ([DateField](#date-field)): The date when the bill of lading is issued. - -```rb -puts result.document.inference.prediction.date_of_issue.value -``` - -## Departure Date -**departure_date** ([DateField](#date-field)): The date when the vessel departs from the port of loading. - -```rb -puts result.document.inference.prediction.departure_date.value -``` - -## Notify Party -**notify_party** ([BillOfLadingV1NotifyParty](#notify-party-field)): The party to be notified of the arrival of the goods. - -```rb -puts result.document.inference.prediction.notify_party.value -``` - -## Place of Delivery -**place_of_delivery** ([StringField](#string-field)): The place where the goods are to be delivered. - -```rb -puts result.document.inference.prediction.place_of_delivery.value -``` - -## Port of Discharge -**port_of_discharge** ([StringField](#string-field)): The port where the goods are unloaded from the vessel. - -```rb -puts result.document.inference.prediction.port_of_discharge.value -``` - -## Port of Loading -**port_of_loading** ([StringField](#string-field)): The port where the goods are loaded onto the vessel. - -```rb -puts result.document.inference.prediction.port_of_loading.value -``` - -## Shipper -**shipper** ([BillOfLadingV1Shipper](#shipper-field)): The party responsible for shipping the goods. - -```rb -puts result.document.inference.prediction.shipper.value -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/global_products/business_card_v1.md b/docs/global_products/business_card_v1.md deleted file mode 100644 index 14a462c95..000000000 --- a/docs/global_products/business_card_v1.md +++ /dev/null @@ -1,194 +0,0 @@ ---- -title: Business Card -category: 622b805aaec68102ea7fcbc2 -slug: ruby-business-card-ocr -parentDoc: 67b49df15b843f3fa9cd622b ---- -The Ruby Client Library supports the [Business Card API](https://platform.mindee.com/mindee/business_card). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `business_card` | -> | Recommended Version | `v1.0` | -> | Supports Polling/Webhooks | โœ”๏ธ Yes | -> | Support Synchronous HTTP Calls | โŒ No | -> | Geography | ๐ŸŒ Global | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- | ------------- | -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/business_card/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Business Card sample](https://github.com/mindee/client-lib-test-data/blob/main/products/business_card/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::BusinessCard::BusinessCardV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: 6f9a261f-7609-4687-9af0-46a45156566e -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/business_card v1.0 -:Rotation applied: Yes - -Prediction -========== -:Firstname: Andrew -:Lastname: Morin -:Job Title: Founder & CEO -:Company: RemoteGlobal -:Email: amorin@remoteglobalconsulting.com -:Phone Number: +14015555555 -:Mobile Number: +13015555555 -:Fax Number: +14015555556 -:Address: 178 Main Avenue, Providence, RI 02111 -:Website: www.remoteglobalconsulting.com -:Social Media: https://www.linkedin.com/in/johndoe - https://twitter.com/johndoe -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -# Attributes -The following fields are extracted for Business Card V1: - -## Address -**address** ([StringField](#string-field)): The address of the person. - -```rb -puts result.document.inference.prediction.address.value -``` - -## Company -**company** ([StringField](#string-field)): The company the person works for. - -```rb -puts result.document.inference.prediction.company.value -``` - -## Email -**email** ([StringField](#string-field)): The email address of the person. - -```rb -puts result.document.inference.prediction.email.value -``` - -## Fax Number -**fax_number** ([StringField](#string-field)): The Fax number of the person. - -```rb -puts result.document.inference.prediction.fax_number.value -``` - -## Firstname -**firstname** ([StringField](#string-field)): The given name of the person. - -```rb -puts result.document.inference.prediction.firstname.value -``` - -## Job Title -**job_title** ([StringField](#string-field)): The job title of the person. - -```rb -puts result.document.inference.prediction.job_title.value -``` - -## Lastname -**lastname** ([StringField](#string-field)): The lastname of the person. - -```rb -puts result.document.inference.prediction.lastname.value -``` - -## Mobile Number -**mobile_number** ([StringField](#string-field)): The mobile number of the person. - -```rb -puts result.document.inference.prediction.mobile_number.value -``` - -## Phone Number -**phone_number** ([StringField](#string-field)): The phone number of the person. - -```rb -puts result.document.inference.prediction.phone_number.value -``` - -## Social Media -**social_media** (Array<[StringField](#string-field)>): The social media profiles of the person or company. - -```rb -result.document.inference.prediction.social_media do |social_media_elem| - puts social_media_elem.value -end -``` - -## Website -**website** ([StringField](#string-field)): The website of the person or company. - -```rb -puts result.document.inference.prediction.website.value -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/global_products/cropper_v1.md b/docs/global_products/cropper_v1.md deleted file mode 100644 index b67818087..000000000 --- a/docs/global_products/cropper_v1.md +++ /dev/null @@ -1,123 +0,0 @@ ---- -title: Cropper -category: 622b805aaec68102ea7fcbc2 -slug: ruby-cropper-ocr -parentDoc: 67b49df15b843f3fa9cd622b ---- -The Ruby Client Library supports the [Cropper API](https://platform.mindee.com/mindee/cropper). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `cropper` | -> | Recommended Version | `v1.1` | -> | Supports Polling/Webhooks | โŒ No | -> | Support Synchronous HTTP Calls | โœ”๏ธ Yes | -> | Geography | ๐ŸŒ Global | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/cropper/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Cropper sample](https://github.com/mindee/client-lib-test-data/blob/main/products/cropper/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::Cropper::CropperV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: 149ce775-8302-4798-8649-7eda9fb84a1a -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/cropper v1.0 -:Rotation applied: No - -Prediction -========== - -Page Predictions -================ - -Page 0 ------- -:Document Cropper: Polygon with 26 points. - Polygon with 25 points. -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - - -### Position Field -The position field `PositionField` does not implement all the basic `Field` attributes, only **bounding_box**, -**polygon** and **page_id**. On top of these, it has access to: - -* **rectangle** (`Mindee::Geometry::Quadrilateral`): a Polygon with four points that may be oriented (even beyond -canvas). -* **quadrangle** (`Mindee::Geometry::Quadrilateral`): a free polygon made up of four points. - -## Page-Level Fields -Some fields are constrained to the page level, and so will not be retrievable at document level. - -# Attributes -The following fields are extracted for Cropper V1: - -## Document Cropper -[๐Ÿ“„](#page-level-fields "This field is only present on individual pages.")**cropping** (Array<[PositionField](#position-field)>): List of documents found in the image. - -```rb - result.document.inference.pages do |page| - page.prediction.cropping do |cropping_elem| - puts cropping_elem.polygon.to_s - puts cropping_elem.quadrangle.to_s - puts cropping_elem.rectangle.to_s - puts cropping_elem.boundingBox.to_s - end - end -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/global_products/delivery_notes_v1.md b/docs/global_products/delivery_notes_v1.md deleted file mode 100644 index edb7645b6..000000000 --- a/docs/global_products/delivery_notes_v1.md +++ /dev/null @@ -1,168 +0,0 @@ ---- -title: Delivery note -category: 622b805aaec68102ea7fcbc2 -slug: ruby-delivery-note-ocr -parentDoc: 67b49df15b843f3fa9cd622b ---- -The Ruby Client Library supports the [Delivery note API](https://platform.mindee.com/mindee/delivery_notes). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `delivery_notes` | -> | Recommended Version | `v1.2` | -> | Supports Polling/Webhooks | โœ”๏ธ Yes | -> | Support Synchronous HTTP Calls | โŒ No | -> | Geography | ๐ŸŒ Global | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- | ------------- | -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/delivery_notes/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Delivery note sample](https://github.com/mindee/client-lib-test-data/blob/main/products/delivery_notes/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::DeliveryNote::DeliveryNoteV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: d5ead821-edec-4d31-a69a-cf3998d9a506 -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/delivery_notes v1.0 -:Rotation applied: Yes - -Prediction -========== -:Delivery Date: 2019-10-02 -:Delivery Number: INT-001 -:Supplier Name: John Smith -:Supplier Address: 4490 Oak Drive, Albany, NY 12210 -:Customer Name: Jessie M Horne -:Customer Address: 4312 Wood Road, New York, NY 10031 -:Total Amount: 204.75 -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - - -### Amount Field -The amount field `AmountField` only has one constraint: its **value** is a `Float` (or `nil`). - -### Date Field -Aside from the basic `Field` attributes, the date field `DateField` also implements the following: - -* **date_object** (`Date`): an accessible representation of the value as a JavaScript object. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -# Attributes -The following fields are extracted for Delivery note V1: - -## Customer Address -**customer_address** ([StringField](#string-field)): The address of the customer receiving the goods. - -```rb -puts result.document.inference.prediction.customer_address.value -``` - -## Customer Name -**customer_name** ([StringField](#string-field)): The name of the customer receiving the goods. - -```rb -puts result.document.inference.prediction.customer_name.value -``` - -## Delivery Date -**delivery_date** ([DateField](#date-field)): The date on which the delivery is scheduled to arrive. - -```rb -puts result.document.inference.prediction.delivery_date.value -``` - -## Delivery Number -**delivery_number** ([StringField](#string-field)): A unique identifier for the delivery note. - -```rb -puts result.document.inference.prediction.delivery_number.value -``` - -## Supplier Address -**supplier_address** ([StringField](#string-field)): The address of the supplier providing the goods. - -```rb -puts result.document.inference.prediction.supplier_address.value -``` - -## Supplier Name -**supplier_name** ([StringField](#string-field)): The name of the supplier providing the goods. - -```rb -puts result.document.inference.prediction.supplier_name.value -``` - -## Total Amount -**total_amount** ([AmountField](#amount-field)): The total monetary value of the goods being delivered. - -```rb -puts result.document.inference.prediction.total_amount.value -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/global_products/driver_license_v1.md b/docs/global_products/driver_license_v1.md deleted file mode 100644 index 812cc6220..000000000 --- a/docs/global_products/driver_license_v1.md +++ /dev/null @@ -1,212 +0,0 @@ ---- -title: Driver License -category: 622b805aaec68102ea7fcbc2 -slug: ruby-driver-license-ocr -parentDoc: 67b49df15b843f3fa9cd622b ---- -The Ruby Client Library supports the [Driver License API](https://platform.mindee.com/mindee/driver_license). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `driver_license` | -> | Recommended Version | `v1.0` | -> | Supports Polling/Webhooks | โœ”๏ธ Yes | -> | Support Synchronous HTTP Calls | โŒ No | -> | Geography | ๐ŸŒ Global | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- | ------------- | -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/driver_license/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Driver License sample](https://github.com/mindee/client-lib-test-data/blob/main/products/driver_license/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::DriverLicense::DriverLicenseV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: fbdeae38-ada3-43ac-aa58-e01a3d47e474 -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/driver_license v1.0 -:Rotation applied: Yes - -Prediction -========== -:Country Code: USA -:State: AZ -:ID: D12345678 -:Category: D -:Last Name: Sample -:First Name: Jelani -:Date of Birth: 1957-02-01 -:Place of Birth: -:Expiry Date: 2018-02-01 -:Issued Date: 2013-01-10 -:Issuing Authority: -:MRZ: -:DD Number: DD1234567890123456 -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - -### Date Field -Aside from the basic `Field` attributes, the date field `DateField` also implements the following: - -* **date_object** (`Date`): an accessible representation of the value as a JavaScript object. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -# Attributes -The following fields are extracted for Driver License V1: - -## Category -**category** ([StringField](#string-field)): The category or class of the driver license. - -```rb -puts result.document.inference.prediction.category.value -``` - -## Country Code -**country_code** ([StringField](#string-field)): The alpha-3 ISO 3166 code of the country where the driver license was issued. - -```rb -puts result.document.inference.prediction.country_code.value -``` - -## Date of Birth -**date_of_birth** ([DateField](#date-field)): The date of birth of the driver license holder. - -```rb -puts result.document.inference.prediction.date_of_birth.value -``` - -## DD Number -**dd_number** ([StringField](#string-field)): The DD number of the driver license. - -```rb -puts result.document.inference.prediction.dd_number.value -``` - -## Expiry Date -**expiry_date** ([DateField](#date-field)): The expiry date of the driver license. - -```rb -puts result.document.inference.prediction.expiry_date.value -``` - -## First Name -**first_name** ([StringField](#string-field)): The first name of the driver license holder. - -```rb -puts result.document.inference.prediction.first_name.value -``` - -## ID -**id** ([StringField](#string-field)): The unique identifier of the driver license. - -```rb -puts result.document.inference.prediction.id.value -``` - -## Issued Date -**issued_date** ([DateField](#date-field)): The date when the driver license was issued. - -```rb -puts result.document.inference.prediction.issued_date.value -``` - -## Issuing Authority -**issuing_authority** ([StringField](#string-field)): The authority that issued the driver license. - -```rb -puts result.document.inference.prediction.issuing_authority.value -``` - -## Last Name -**last_name** ([StringField](#string-field)): The last name of the driver license holder. - -```rb -puts result.document.inference.prediction.last_name.value -``` - -## MRZ -**mrz** ([StringField](#string-field)): The Machine Readable Zone (MRZ) of the driver license. - -```rb -puts result.document.inference.prediction.mrz.value -``` - -## Place of Birth -**place_of_birth** ([StringField](#string-field)): The place of birth of the driver license holder. - -```rb -puts result.document.inference.prediction.place_of_birth.value -``` - -## State -**state** ([StringField](#string-field)): Second part of the ISO 3166-2 code, consisting of two letters indicating the US State. - -```rb -puts result.document.inference.prediction.state.value -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/global_products/expense_receipts_v5.md b/docs/global_products/expense_receipts_v5.md deleted file mode 100644 index 71865a505..000000000 --- a/docs/global_products/expense_receipts_v5.md +++ /dev/null @@ -1,415 +0,0 @@ ---- -title: Receipt -category: 622b805aaec68102ea7fcbc2 -slug: ruby-receipt-ocr -parentDoc: 67b49df15b843f3fa9cd622b ---- -The Ruby Client Library supports the [Receipt API](https://platform.mindee.com/mindee/expense_receipts). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `expense_receipts` | -> | Recommended Version | `v5.4` | -> | Supports Polling/Webhooks | โœ”๏ธ Yes | -> | Support Synchronous HTTP Calls | โœ”๏ธ Yes | -> | Geography | ๐ŸŒ Global | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- | ------------- | -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/expense_receipts/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Receipt sample](https://github.com/mindee/client-lib-test-data/blob/main/products/expense_receipts/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::Receipt::ReceiptV5, - enqueue: false -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -You can also call this product asynchronously: - -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::Receipt::ReceiptV5 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: d96fb043-8fb8-4adc-820c-387aae83376d -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/expense_receipts v5.3 -:Rotation applied: Yes - -Prediction -========== -:Expense Locale: en-GB; en; GB; GBP; -:Purchase Category: food -:Purchase Subcategory: restaurant -:Document Type: EXPENSE RECEIPT -:Purchase Date: 2016-02-26 -:Purchase Time: 15:20 -:Total Amount: 10.20 -:Total Net: 8.50 -:Total Tax: 1.70 -:Tip and Gratuity: -:Taxes: - +---------------+--------+----------+---------------+ - | Base | Code | Rate (%) | Amount | - +===============+========+==========+===============+ - | 8.50 | VAT | 20.00 | 1.70 | - +---------------+--------+----------+---------------+ -:Supplier Name: Clachan -:Supplier Company Registrations: Type: VAT NUMBER, Value: 232153895 - Type: VAT NUMBER, Value: 232153895 -:Supplier Address: 34 Kingley Street W1B 50H -:Supplier Phone Number: 02074940834 -:Receipt Number: 54/7500 -:Line Items: - +--------------------------------------+----------+--------------+------------+ - | Description | Quantity | Total Amount | Unit Price | - +======================================+==========+==============+============+ - | Meantime Pale | 2.00 | 10.20 | | - +--------------------------------------+----------+--------------+------------+ - -Page Predictions -================ - -Page 0 ------- -:Expense Locale: en-GB; en; GB; GBP; -:Purchase Category: food -:Purchase Subcategory: restaurant -:Document Type: EXPENSE RECEIPT -:Purchase Date: 2016-02-26 -:Purchase Time: 15:20 -:Total Amount: 10.20 -:Total Net: 8.50 -:Total Tax: 1.70 -:Tip and Gratuity: -:Taxes: - +---------------+--------+----------+---------------+ - | Base | Code | Rate (%) | Amount | - +===============+========+==========+===============+ - | 8.50 | VAT | 20.00 | 1.70 | - +---------------+--------+----------+---------------+ -:Supplier Name: Clachan -:Supplier Company Registrations: Type: VAT NUMBER, Value: 232153895 - Type: VAT NUMBER, Value: 232153895 -:Supplier Address: 34 Kingley Street W1B 50H -:Supplier Phone Number: 02074940834 -:Receipt Number: 54/7500 -:Line Items: - +--------------------------------------+----------+--------------+------------+ - | Description | Quantity | Total Amount | Unit Price | - +======================================+==========+==============+============+ - | Meantime Pale | 2.00 | 10.20 | | - +--------------------------------------+----------+--------------+------------+ -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - - -### Amount Field -The amount field `AmountField` only has one constraint: its **value** is a `Float` (or `nil`). - - -### Classification Field -The classification field `ClassificationField` does not implement all the basic `Field` attributes. It only implements -**value**, **confidence** and **page_id**. - -> Note: a classification field's `value is always a `String`. - - -### Company Registration Field -Aside from the basic `Field` attributes, the company registration field `CompanyRegistrationField` also implements the -following: - -* **type** (`String`): the type of company. - -### Date Field -Aside from the basic `Field` attributes, the date field `DateField` also implements the following: - -* **date_object** (`Date`): an accessible representation of the value as a JavaScript object. - -### Locale Field -The locale field `LocaleField` only implements the **value**, **confidence** and **page_id** base `Field` attributes, -but it comes with its own: - -* **language** (`String`): ISO 639-1 language code (e.g.: `en` for English). Can be `nil`. -* **country** (`String`): ISO 3166-1 alpha-2 or ISO 3166-1 alpha-3 code for countries (e.g.: `GRB` or `GB` for "Great -Britain"). Can be `nil`. -* **currency** (`String`): ISO 4217 code for currencies (e.g.: `USD` for "US Dollars"). Can be `nil`. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -### Taxes Field -#### Tax -Aside from the basic `Field` attributes, the tax field `TaxField` also implements the following: - -* **rate** (`Float`): the tax rate applied to an item can be expressed as a percentage. Can be `nil`. -* **code** (`String`): tax code (or equivalent, depending on the origin of the document). Can be `nil`. -* **base** (`Float`): base amount used for the tax. Can be `nil`. -* **value** (`Float`): the value of the tax. Can be `nil`. - -> Note: currently `TaxField` is not used on its own, and is accessed through a parent `Taxes` object, an array-like -structure. - -#### Taxes (Array) -The `Taxes` field represents an array-like collection of `TaxField` objects. As it is the representation of several -objects, it has access to a custom `to_s` method that can render a `TaxField` object as a table line. - -## Specific Fields -Fields which are specific to this product; they are not used in any other product. - -### Line Items Field -List of all line items on the receipt. - -A `ReceiptV5LineItem` implements the following attributes: - -* `description` (String): The item description. -* `quantity` (Float): The item quantity. -* `total_amount` (Float): The item total amount. -* `unit_price` (Float): The item unit price. - -# Attributes -The following fields are extracted for Receipt V5: - -## Purchase Category -**category** ([ClassificationField](#classification-field)): The purchase category of the receipt. - -#### Possible values include: - - 'toll' - - 'food' - - 'parking' - - 'transport' - - 'accommodation' - - 'gasoline' - - 'telecom' - - 'miscellaneous' - - 'software' - - 'shopping' - - 'energy' - -```rb -puts result.document.inference.prediction.category.value -``` - -## Purchase Date -**date** ([DateField](#date-field)): The date the purchase was made. - -```rb -puts result.document.inference.prediction.date.value -``` - -## Document Type -**document_type** ([ClassificationField](#classification-field)): The type of receipt: EXPENSE RECEIPT or CREDIT CARD RECEIPT. - -#### Possible values include: - - 'EXPENSE RECEIPT' - - 'CREDIT CARD RECEIPT' - -```rb -puts result.document.inference.prediction.document_type.value -``` - -## Line Items -**line_items** (Array<[ReceiptV5LineItem](#line-items-field)>): List of all line items on the receipt. - -```rb -result.document.inference.prediction.line_items do |line_items_elem| - puts line_items_elem.value -end -``` - -## Expense Locale -**locale** ([LocaleField](#locale-field)): The locale of the document. - -```rb -puts result.document.inference.prediction.locale.value -``` - -## Receipt Number -**receipt_number** ([StringField](#string-field)): The receipt number or identifier. - -```rb -puts result.document.inference.prediction.receipt_number.value -``` - -## Purchase Subcategory -**subcategory** ([ClassificationField](#classification-field)): The purchase subcategory of the receipt for transport and food. - -#### Possible values include: - - 'plane' - - 'taxi' - - 'train' - - 'restaurant' - - 'shopping' - - 'other' - - 'groceries' - - 'cultural' - - 'electronics' - - 'office_supplies' - - 'micromobility' - - 'car_rental' - - 'public' - - 'delivery' - - nil - -```rb -puts result.document.inference.prediction.subcategory.value -``` - -## Supplier Address -**supplier_address** ([StringField](#string-field)): The address of the supplier or merchant. - -```rb -puts result.document.inference.prediction.supplier_address.value -``` - -## Supplier Company Registrations -**supplier_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company registration numbers associated to the supplier. - -```rb -result.document.inference.prediction.supplier_company_registrations do |supplier_company_registrations_elem| - puts supplier_company_registrations_elem.value -end -``` - -## Supplier Name -**supplier_name** ([StringField](#string-field)): The name of the supplier or merchant. - -```rb -puts result.document.inference.prediction.supplier_name.value -``` - -## Supplier Phone Number -**supplier_phone_number** ([StringField](#string-field)): The phone number of the supplier or merchant. - -```rb -puts result.document.inference.prediction.supplier_phone_number.value -``` - -## Taxes -**taxes** (Array<[TaxField](#taxes-field)>): The list of taxes present on the receipt. - -```rb -result.document.inference.prediction.taxes do |taxes_elem| - puts taxes_elem.value -end -``` - -## Purchase Time -**time** ([StringField](#string-field)): The time the purchase was made. - -```rb -puts result.document.inference.prediction.time.value -``` - -## Tip and Gratuity -**tip** ([AmountField](#amount-field)): The total amount of tip and gratuity. - -```rb -puts result.document.inference.prediction.tip.value -``` - -## Total Amount -**total_amount** ([AmountField](#amount-field)): The total amount paid: includes taxes, discounts, fees, tips, and gratuity. - -```rb -puts result.document.inference.prediction.total_amount.value -``` - -## Total Net -**total_net** ([AmountField](#amount-field)): The net amount paid: does not include taxes, fees, and discounts. - -```rb -puts result.document.inference.prediction.total_net.value -``` - -## Total Tax -**total_tax** ([AmountField](#amount-field)): The sum of all taxes. - -```rb -puts result.document.inference.prediction.total_tax.value -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/global_products/financial_document_v1.md b/docs/global_products/financial_document_v1.md deleted file mode 100644 index 843c4f93f..000000000 --- a/docs/global_products/financial_document_v1.md +++ /dev/null @@ -1,615 +0,0 @@ ---- -title: Financial Document -category: 622b805aaec68102ea7fcbc2 -slug: ruby-financial-document-ocr -parentDoc: 67b49df15b843f3fa9cd622b ---- -The Ruby Client Library supports the [Financial Document API](https://platform.mindee.com/mindee/financial_document). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `financial_document` | -> | Recommended Version | `v1.14` | -> | Supports Polling/Webhooks | โœ”๏ธ Yes | -> | Support Synchronous HTTP Calls | โœ”๏ธ Yes | -> | Geography | ๐ŸŒ Global | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- | ------------- | -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/financial_document/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Financial Document sample](https://github.com/mindee/client-lib-test-data/blob/main/products/financial_document/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::FinancialDocument::FinancialDocumentV1, - enqueue: false -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -You can also call this product asynchronously: - -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::FinancialDocument::FinancialDocumentV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: 6dd26385-719b-4527-bf6f-87d9da619de5 -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/financial_document v1.14 -:Rotation applied: Yes - -Prediction -========== -:Locale: en-US; en; US; USD; -:Invoice Number: INT-001 -:Purchase Order Number: 2412/2019 -:Receipt Number: -:Document Number: INT-001 -:Reference Numbers: 2412/2019 -:Purchase Date: 2019-11-02 -:Due Date: 2019-11-17 -:Payment Date: 2019-11-17 -:Total Net: 195.00 -:Total Amount: 204.75 -:Taxes: - +---------------+--------+----------+---------------+ - | Base | Code | Rate (%) | Amount | - +===============+========+==========+===============+ - | 195.00 | | 5.00 | 9.75 | - +---------------+--------+----------+---------------+ -:Supplier Payment Details: -:Supplier Name: JOHN SMITH -:Supplier Company Registrations: -:Supplier Address: 4490 Oak Drive Albany, NY 12210 -:Supplier Phone Number: -:Customer Name: JESSIE M HORNE -:Supplier Website: -:Supplier Email: -:Customer Company Registrations: -:Customer Address: 2019 Redbud Drive New York, NY 10011 -:Customer ID: 1234567890 -:Shipping Address: 2019 Redbud Drive New York, NY 10011 -:Billing Address: 4312 Wood Road New York, NY 10031 -:Document Type: INVOICE -:Document Type Extended: INVOICE -:Purchase Subcategory: -:Purchase Category: miscellaneous -:Total Tax: 9.75 -:Tip and Gratuity: -:Purchase Time: -:Line Items: - +--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+ - | Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit of measure | Unit Price | - +======================================+==============+==========+============+==============+==============+=================+============+ - | Front and rear brake cables | | 1.00 | | | 100.00 | | 100.00 | - +--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+ - | New set of pedal arms | | 2.00 | | | 50.00 | | 25.00 | - +--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+ - | Labor 3hrs | | 3.00 | | | 45.00 | | 15.00 | - +--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+ - -Page Predictions -================ - -Page 0 ------- -:Locale: en-US; en; US; USD; -:Invoice Number: INT-001 -:Purchase Order Number: 2412/2019 -:Receipt Number: -:Document Number: INT-001 -:Reference Numbers: 2412/2019 -:Purchase Date: 2019-11-02 -:Due Date: 2019-11-17 -:Payment Date: 2019-11-17 -:Total Net: 195.00 -:Total Amount: 204.75 -:Taxes: - +---------------+--------+----------+---------------+ - | Base | Code | Rate (%) | Amount | - +===============+========+==========+===============+ - | 195.00 | | 5.00 | 9.75 | - +---------------+--------+----------+---------------+ -:Supplier Payment Details: -:Supplier Name: JOHN SMITH -:Supplier Company Registrations: -:Supplier Address: 4490 Oak Drive Albany, NY 12210 -:Supplier Phone Number: -:Customer Name: JESSIE M HORNE -:Supplier Website: -:Supplier Email: -:Customer Company Registrations: -:Customer Address: 2019 Redbud Drive New York, NY 10011 -:Customer ID: 1234567890 -:Shipping Address: 2019 Redbud Drive New York, NY 10011 -:Billing Address: 4312 Wood Road New York, NY 10031 -:Document Type: INVOICE -:Document Type Extended: INVOICE -:Purchase Subcategory: -:Purchase Category: miscellaneous -:Total Tax: 9.75 -:Tip and Gratuity: -:Purchase Time: -:Line Items: - +--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+ - | Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit of measure | Unit Price | - +======================================+==============+==========+============+==============+==============+=================+============+ - | Front and rear brake cables | | 1.00 | | | 100.00 | | 100.00 | - +--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+ - | New set of pedal arms | | 2.00 | | | 50.00 | | 25.00 | - +--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+ - | Labor 3hrs | | 3.00 | | | 45.00 | | 15.00 | - +--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+ -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - - -### AddressField -Aside from the basic `BaseField` attributes, the address field `AddressField` also implements the following: - -* **street_number** (`String`): String representation of the street number. Can be `nil`. -* **street_name** (`String`): Name of the street. Can be `nil`. -* **po_box** (`String`): String representation of the PO Box number. Can be `nil`. -* **address_complement** (`String`): Address complement. Can be `nil`. -* **city** (`String`): City name. Can be `nil`. -* **postal_code** (`String`): String representation of the postal code. Can be `nil`. -* **state** (`String`): State name. Can be `nil`. -* **country** (`String`): Country name. Can be `nil`. - -Note: The `value` field of an AddressField should be a concatenation of the rest of the values. - - -### Amount Field -The amount field `AmountField` only has one constraint: its **value** is a `Float` (or `nil`). - - -### Classification Field -The classification field `ClassificationField` does not implement all the basic `Field` attributes. It only implements -**value**, **confidence** and **page_id**. - -> Note: a classification field's `value is always a `String`. - - -### Company Registration Field -Aside from the basic `Field` attributes, the company registration field `CompanyRegistrationField` also implements the -following: - -* **type** (`String`): the type of company. - -### Date Field -Aside from the basic `Field` attributes, the date field `DateField` also implements the following: - -* **date_object** (`Date`): an accessible representation of the value as a JavaScript object. - -### Locale Field -The locale field `LocaleField` only implements the **value**, **confidence** and **page_id** base `Field` attributes, -but it comes with its own: - -* **language** (`String`): ISO 639-1 language code (e.g.: `en` for English). Can be `nil`. -* **country** (`String`): ISO 3166-1 alpha-2 or ISO 3166-1 alpha-3 code for countries (e.g.: `GRB` or `GB` for "Great -Britain"). Can be `nil`. -* **currency** (`String`): ISO 4217 code for currencies (e.g.: `USD` for "US Dollars"). Can be `nil`. - -### Payment Details Field -Aside from the basic `Field` attributes, the payment details field `PaymentDetailsField` also implements the -following: - -* **account_number** (`String`): number of an account, expressed as a string. Can be `nil`. -* **iban** (`String`): International Bank Account Number. Can be `nil`. -* **routing_number** (`String`): routing number of an account. Can be `nil`. -* **swift** (`String`): the account holder's bank's SWIFT Business Identifier Code (BIC). Can be `nil`. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -### Taxes Field -#### Tax -Aside from the basic `Field` attributes, the tax field `TaxField` also implements the following: - -* **rate** (`Float`): the tax rate applied to an item can be expressed as a percentage. Can be `nil`. -* **code** (`String`): tax code (or equivalent, depending on the origin of the document). Can be `nil`. -* **base** (`Float`): base amount used for the tax. Can be `nil`. -* **value** (`Float`): the value of the tax. Can be `nil`. - -> Note: currently `TaxField` is not used on its own, and is accessed through a parent `Taxes` object, an array-like -structure. - -#### Taxes (Array) -The `Taxes` field represents an array-like collection of `TaxField` objects. As it is the representation of several -objects, it has access to a custom `to_s` method that can render a `TaxField` object as a table line. - -## Specific Fields -Fields which are specific to this product; they are not used in any other product. - -### Line Items Field -List of line item present on the document. - -A `FinancialDocumentV1LineItem` implements the following attributes: - -* `description` (String): The item description. -* `product_code` (String): The product code referring to the item. -* `quantity` (Float): The item quantity -* `tax_amount` (Float): The item tax amount. -* `tax_rate` (Float): The item tax rate in percentage. -* `total_amount` (Float): The item total amount. -* `unit_measure` (String): The item unit of measure. -* `unit_price` (Float): The item unit price. - -# Attributes -The following fields are extracted for Financial Document V1: - -## Billing Address -**billing_address** ([AddressField](#address-field)): The customer's address used for billing. - -```rb -puts result.document.inference.prediction.billing_address.value -``` - -## Purchase Category -**category** ([ClassificationField](#classification-field)): The purchase category. - -#### Possible values include: - - 'toll' - - 'food' - - 'parking' - - 'transport' - - 'accommodation' - - 'gasoline' - - 'telecom' - - 'miscellaneous' - - 'software' - - 'shopping' - - 'energy' - -```rb -puts result.document.inference.prediction.category.value -``` - -## Customer Address -**customer_address** ([AddressField](#address-field)): The address of the customer. - -```rb -puts result.document.inference.prediction.customer_address.value -``` - -## Customer Company Registrations -**customer_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company registration numbers associated to the customer. - -```rb -result.document.inference.prediction.customer_company_registrations do |customer_company_registrations_elem| - puts customer_company_registrations_elem.value -end -``` - -## Customer ID -**customer_id** ([StringField](#string-field)): The customer account number or identifier from the supplier. - -```rb -puts result.document.inference.prediction.customer_id.value -``` - -## Customer Name -**customer_name** ([StringField](#string-field)): The name of the customer. - -```rb -puts result.document.inference.prediction.customer_name.value -``` - -## Purchase Date -**date** ([DateField](#date-field)): The date the purchase was made. - -```rb -puts result.document.inference.prediction.date.value -``` - -## Document Number -**document_number** ([StringField](#string-field)): The document number or identifier (invoice number or receipt number). - -```rb -puts result.document.inference.prediction.document_number.value -``` - -## Document Type -**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. - -#### Possible values include: - - 'INVOICE' - - 'CREDIT NOTE' - - 'CREDIT CARD RECEIPT' - - 'EXPENSE RECEIPT' - -```rb -puts result.document.inference.prediction.document_type.value -``` - -## Document Type Extended -**document_type_extended** ([ClassificationField](#classification-field)): Document type extended. - -#### Possible values include: - - 'CREDIT NOTE' - - 'INVOICE' - - 'OTHER' - - 'OTHER_FINANCIAL' - - 'PAYSLIP' - - 'PURCHASE ORDER' - - 'QUOTE' - - 'RECEIPT' - - 'STATEMENT' - -```rb -puts result.document.inference.prediction.document_type_extended.value -``` - -## Due Date -**due_date** ([DateField](#date-field)): The date on which the payment is due. - -```rb -puts result.document.inference.prediction.due_date.value -``` - -## Invoice Number -**invoice_number** ([StringField](#string-field)): The invoice number or identifier only if document is an invoice. - -```rb -puts result.document.inference.prediction.invoice_number.value -``` - -## Line Items -**line_items** (Array<[FinancialDocumentV1LineItem](#line-items-field)>): List of line item present on the document. - -```rb -result.document.inference.prediction.line_items do |line_items_elem| - puts line_items_elem.value -end -``` - -## Locale -**locale** ([LocaleField](#locale-field)): The locale of the document. - -```rb -puts result.document.inference.prediction.locale.value -``` - -## Payment Date -**payment_date** ([DateField](#date-field)): The date on which the payment is due / fullfilled. - -```rb -puts result.document.inference.prediction.payment_date.value -``` - -## Purchase Order Number -**po_number** ([StringField](#string-field)): The purchase order number, only if the document is an invoice. - -```rb -puts result.document.inference.prediction.po_number.value -``` - -## Receipt Number -**receipt_number** ([StringField](#string-field)): The receipt number or identifier only if document is a receipt. - -```rb -puts result.document.inference.prediction.receipt_number.value -``` - -## Reference Numbers -**reference_numbers** (Array<[StringField](#string-field)>): List of Reference numbers, including PO number, only if the document is an invoice. - -```rb -result.document.inference.prediction.reference_numbers do |reference_numbers_elem| - puts reference_numbers_elem.value -end -``` - -## Shipping Address -**shipping_address** ([AddressField](#address-field)): The customer's address used for shipping. - -```rb -puts result.document.inference.prediction.shipping_address.value -``` - -## Purchase Subcategory -**subcategory** ([ClassificationField](#classification-field)): The purchase subcategory for transport, food and shooping. - -#### Possible values include: - - 'plane' - - 'taxi' - - 'train' - - 'restaurant' - - 'shopping' - - 'other' - - 'groceries' - - 'cultural' - - 'electronics' - - 'office_supplies' - - 'micromobility' - - 'car_rental' - - 'public' - - 'delivery' - - nil - -```rb -puts result.document.inference.prediction.subcategory.value -``` - -## Supplier Address -**supplier_address** ([AddressField](#address-field)): The address of the supplier or merchant. - -```rb -puts result.document.inference.prediction.supplier_address.value -``` - -## Supplier Company Registrations -**supplier_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company registration numbers associated to the supplier. - -```rb -result.document.inference.prediction.supplier_company_registrations do |supplier_company_registrations_elem| - puts supplier_company_registrations_elem.value -end -``` - -## Supplier Email -**supplier_email** ([StringField](#string-field)): The email of the supplier or merchant. - -```rb -puts result.document.inference.prediction.supplier_email.value -``` - -## Supplier Name -**supplier_name** ([StringField](#string-field)): The name of the supplier or merchant. - -```rb -puts result.document.inference.prediction.supplier_name.value -``` - -## Supplier Payment Details -**supplier_payment_details** (Array<[PaymentDetailsField](#payment-details-field)>): List of payment details associated to the supplier (only for invoices). - -```rb -result.document.inference.prediction.supplier_payment_details do |supplier_payment_details_elem| - puts supplier_payment_details_elem.value - puts supplier_payment_details_elem.rate - puts supplier_payment_details_elem.code - puts supplier_payment_details_elem.basis -end -``` - -## Supplier Phone Number -**supplier_phone_number** ([StringField](#string-field)): The phone number of the supplier or merchant. - -```rb -puts result.document.inference.prediction.supplier_phone_number.value -``` - -## Supplier Website -**supplier_website** ([StringField](#string-field)): The website URL of the supplier or merchant. - -```rb -puts result.document.inference.prediction.supplier_website.value -``` - -## Taxes -**taxes** (Array<[TaxField](#taxes-field)>): List of all taxes on the document. - -```rb -result.document.inference.prediction.taxes do |taxes_elem| - puts taxes_elem.value -end -``` - -## Purchase Time -**time** ([StringField](#string-field)): The time the purchase was made (only for receipts). - -```rb -puts result.document.inference.prediction.time.value -``` - -## Tip and Gratuity -**tip** ([AmountField](#amount-field)): The total amount of tip and gratuity - -```rb -puts result.document.inference.prediction.tip.value -``` - -## Total Amount -**total_amount** ([AmountField](#amount-field)): The total amount paid: includes taxes, tips, fees, and other charges. - -```rb -puts result.document.inference.prediction.total_amount.value -``` - -## Total Net -**total_net** ([AmountField](#amount-field)): The net amount paid: does not include taxes, fees, and discounts. - -```rb -puts result.document.inference.prediction.total_net.value -``` - -## Total Tax -**total_tax** ([AmountField](#amount-field)): The sum of all taxes present on the document. - -```rb -puts result.document.inference.prediction.total_tax.value -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/global_products/international_id_v2.md b/docs/global_products/international_id_v2.md deleted file mode 100644 index aaf58eaa1..000000000 --- a/docs/global_products/international_id_v2.md +++ /dev/null @@ -1,264 +0,0 @@ ---- -title: International ID -category: 622b805aaec68102ea7fcbc2 -slug: ruby-international-id-ocr -parentDoc: 67b49df15b843f3fa9cd622b ---- -The Ruby Client Library supports the [International ID API](https://platform.mindee.com/mindee/international_id). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `international_id` | -> | Recommended Version | `v2.2` | -> | Supports Polling/Webhooks | โœ”๏ธ Yes | -> | Support Synchronous HTTP Calls | โŒ No | -> | Geography | ๐ŸŒ Global | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- | ------------- | -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - - -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 Ruby Client Library. -![International ID sample](https://github.com/mindee/client-lib-test-data/blob/main/products/international_id/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::InternationalId::InternationalIdV2 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: cfa20a58-20cf-43b6-8cec-9505fa69d1c2 -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/international_id v2.0 -:Rotation applied: No - -Prediction -========== -:Document Type: IDENTIFICATION_CARD -:Document Number: 12345678A -:Surnames: MUESTRA - MUESTRA -:Given Names: CARMEN -:Sex: F -:Birth Date: 1980-01-01 -:Birth Place: CAMPO DE CRIPTANA CIUDAD REAL ESPANA -:Nationality: ESP -:Personal Number: BAB1834284<44282767Q0 -:Country of Issue: ESP -:State of Issue: MADRID -:Issue Date: -:Expiration Date: 2030-01-01 -:Address: C/REAL N13, 1 DCHA COLLADO VILLALBA MADRID MADRID MADRID -:MRZ Line 1: IDESPBAB1834284<44282767Q0<<<< -:MRZ Line 2: 8001010F1301017ESP<<<<<<<<<<<3 -:MRZ Line 3: MUESTRA Note: a classification field's `value is always a `String`. - -### Date Field -Aside from the basic `Field` attributes, the date field `DateField` also implements the following: - -* **date_object** (`Date`): an accessible representation of the value as a JavaScript object. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -# Attributes -The following fields are extracted for International ID V2: - -## Address -**address** ([StringField](#string-field)): The physical address of the document holder. - -```rb -puts result.document.inference.prediction.address.value -``` - -## Birth Date -**birth_date** ([DateField](#date-field)): The date of birth of the document holder. - -```rb -puts result.document.inference.prediction.birth_date.value -``` - -## Birth Place -**birth_place** ([StringField](#string-field)): The place of birth of the document holder. - -```rb -puts result.document.inference.prediction.birth_place.value -``` - -## Country of Issue -**country_of_issue** ([StringField](#string-field)): The country where the document was issued. - -```rb -puts result.document.inference.prediction.country_of_issue.value -``` - -## Document Number -**document_number** ([StringField](#string-field)): The unique identifier assigned to the document. - -```rb -puts result.document.inference.prediction.document_number.value -``` - -## Document Type -**document_type** ([ClassificationField](#classification-field)): The type of personal identification document. - -#### Possible values include: - - 'IDENTIFICATION_CARD' - - 'PASSPORT' - - 'DRIVER_LICENSE' - - 'VISA' - - 'RESIDENCY_CARD' - - 'VOTER_REGISTRATION' - -```rb -puts result.document.inference.prediction.document_type.value -``` - -## Expiration Date -**expiry_date** ([DateField](#date-field)): The date when the document becomes invalid. - -```rb -puts result.document.inference.prediction.expiry_date.value -``` - -## Given Names -**given_names** (Array<[StringField](#string-field)>): The list of the document holder's given names. - -```rb -result.document.inference.prediction.given_names do |given_names_elem| - puts given_names_elem.value -end -``` - -## Issue Date -**issue_date** ([DateField](#date-field)): The date when the document was issued. - -```rb -puts result.document.inference.prediction.issue_date.value -``` - -## MRZ Line 1 -**mrz_line1** ([StringField](#string-field)): The Machine Readable Zone, first line. - -```rb -puts result.document.inference.prediction.mrz_line1.value -``` - -## MRZ Line 2 -**mrz_line2** ([StringField](#string-field)): The Machine Readable Zone, second line. - -```rb -puts result.document.inference.prediction.mrz_line2.value -``` - -## MRZ Line 3 -**mrz_line3** ([StringField](#string-field)): The Machine Readable Zone, third line. - -```rb -puts result.document.inference.prediction.mrz_line3.value -``` - -## Nationality -**nationality** ([StringField](#string-field)): The country of citizenship of the document holder. - -```rb -puts result.document.inference.prediction.nationality.value -``` - -## Personal Number -**personal_number** ([StringField](#string-field)): The unique identifier assigned to the document holder. - -```rb -puts result.document.inference.prediction.personal_number.value -``` - -## Sex -**sex** ([StringField](#string-field)): The biological sex of the document holder. - -```rb -puts result.document.inference.prediction.sex.value -``` - -## State of Issue -**state_of_issue** ([StringField](#string-field)): The state or territory where the document was issued. - -```rb -puts result.document.inference.prediction.state_of_issue.value -``` - -## Surnames -**surnames** (Array<[StringField](#string-field)>): The list of the document holder's family names. - -```rb -result.document.inference.prediction.surnames do |surnames_elem| - puts surnames_elem.value -end -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/global_products/invoice_splitter_v1.md b/docs/global_products/invoice_splitter_v1.md deleted file mode 100644 index e0a0b5e7c..000000000 --- a/docs/global_products/invoice_splitter_v1.md +++ /dev/null @@ -1,127 +0,0 @@ ---- -title: Invoice Splitter -category: 622b805aaec68102ea7fcbc2 -slug: ruby-invoice-splitter-ocr -parentDoc: 67b49df15b843f3fa9cd622b ---- -The Ruby Client Library supports the [Invoice Splitter API](https://platform.mindee.com/mindee/invoice_splitter). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `invoice_splitter` | -> | Recommended Version | `v1.4` | -> | Supports Polling/Webhooks | โœ”๏ธ Yes | -> | Support Synchronous HTTP Calls | โŒ No | -> | Geography | ๐ŸŒ Global | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- | ------------- | -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/invoice_splitter/default_sample.pdf), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Invoice Splitter sample](https://github.com/mindee/client-lib-test-data/blob/main/products/invoice_splitter/default_sample.pdf?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::InvoiceSplitter::InvoiceSplitterV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: 15ad7a19-7b75-43d0-b0c6-9a641a12b49b -:Filename: default_sample.pdf - -Inference -######### -:Product: mindee/invoice_splitter v1.2 -:Rotation applied: No - -Prediction -========== -:Invoice Page Groups: - +--------------------------------------------------------------------------+ - | Page Indexes | - +==========================================================================+ - | 0 | - +--------------------------------------------------------------------------+ - | 1 | - +--------------------------------------------------------------------------+ -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - -## Specific Fields -Fields which are specific to this product; they are not used in any other product. - -### Invoice Page Groups Field -List of page groups. Each group represents a single invoice within a multi-invoice document. - -A `InvoiceSplitterV1InvoicePageGroup` implements the following attributes: - -* `page_indexes` (Array): List of page indexes that belong to the same invoice (group). - -# Attributes -The following fields are extracted for Invoice Splitter V1: - -## Invoice Page Groups -**invoice_page_groups** (Array<[InvoiceSplitterV1InvoicePageGroup](#invoice-page-groups-field)>): List of page groups. Each group represents a single invoice within a multi-invoice document. - -```rb -result.document.inference.prediction.invoice_page_groups do |invoice_page_groups_elem| - puts invoice_page_groups_elem.value -end -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/global_products/invoices_v4.md b/docs/global_products/invoices_v4.md deleted file mode 100644 index 3d6d794d5..000000000 --- a/docs/global_products/invoices_v4.md +++ /dev/null @@ -1,576 +0,0 @@ ---- -title: Invoice -category: 622b805aaec68102ea7fcbc2 -slug: ruby-invoice-ocr -parentDoc: 67b49df15b843f3fa9cd622b ---- -The Ruby Client Library supports the [Invoice API](https://platform.mindee.com/mindee/invoices). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `invoices` | -> | Recommended Version | `v4.11` | -> | Supports Polling/Webhooks | โœ”๏ธ Yes | -> | Support Synchronous HTTP Calls | โœ”๏ธ Yes | -> | Geography | ๐ŸŒ Global | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- | ------------- | -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/invoices/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Invoice sample](https://github.com/mindee/client-lib-test-data/blob/main/products/invoices/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::Invoice::InvoiceV4, - enqueue: false -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -You can also call this product asynchronously: - -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::Invoice::InvoiceV4 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: 744748d5-9051-461c-b70c-bbf81f5ff943 -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/invoices v4.11 -:Rotation applied: Yes - -Prediction -========== -:Locale: en-CA; en; CA; CAD; -:Invoice Number: 14 -:Purchase Order Number: AD29094 -:Reference Numbers: AD29094 -:Purchase Date: 2018-09-25 -:Due Date: -:Payment Date: -:Total Net: 2145.00 -:Total Amount: 2608.20 -:Total Tax: 193.20 -:Taxes: - +---------------+--------+----------+---------------+ - | Base | Code | Rate (%) | Amount | - +===============+========+==========+===============+ - | 2145.00 | | 8.00 | 193.20 | - +---------------+--------+----------+---------------+ -:Supplier Payment Details: -:Supplier Name: TURNPIKE DESIGNS -:Supplier Company Registrations: -:Supplier Address: 156 University Ave, Toronto ON, Canada, M5H 2H7 -:Supplier Phone Number: 4165551212 -:Supplier Website: -:Supplier Email: j_coi@example.com -:Customer Name: JIRO DOI -:Customer Company Registrations: -:Customer Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada -:Customer ID: -:Shipping Address: -:Billing Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada -:Document Type: INVOICE -:Document Type Extended: INVOICE -:Purchase Subcategory: -:Purchase Category: miscellaneous -:Line Items: - +--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+ - | Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit of measure | Unit Price | - +======================================+==============+==========+============+==============+==============+=================+============+ - | Platinum web hosting package Down... | | 1.00 | | | 65.00 | | 65.00 | - +--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+ - | 2 page website design Includes ba... | | 3.00 | | | 2100.00 | | 2100.00 | - +--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+ - | Mobile designs Includes responsiv... | | 1.00 | | | 250.00 | 1 | 250.00 | - +--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+ - -Page Predictions -================ - -Page 0 ------- -:Locale: en-CA; en; CA; CAD; -:Invoice Number: 14 -:Purchase Order Number: AD29094 -:Reference Numbers: AD29094 -:Purchase Date: 2018-09-25 -:Due Date: -:Payment Date: -:Total Net: 2145.00 -:Total Amount: 2608.20 -:Total Tax: 193.20 -:Taxes: - +---------------+--------+----------+---------------+ - | Base | Code | Rate (%) | Amount | - +===============+========+==========+===============+ - | 2145.00 | | 8.00 | 193.20 | - +---------------+--------+----------+---------------+ -:Supplier Payment Details: -:Supplier Name: TURNPIKE DESIGNS -:Supplier Company Registrations: -:Supplier Address: 156 University Ave, Toronto ON, Canada, M5H 2H7 -:Supplier Phone Number: 4165551212 -:Supplier Website: -:Supplier Email: j_coi@example.com -:Customer Name: JIRO DOI -:Customer Company Registrations: -:Customer Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada -:Customer ID: -:Shipping Address: -:Billing Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada -:Document Type: INVOICE -:Document Type Extended: INVOICE -:Purchase Subcategory: -:Purchase Category: miscellaneous -:Line Items: - +--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+ - | Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit of measure | Unit Price | - +======================================+==============+==========+============+==============+==============+=================+============+ - | Platinum web hosting package Down... | | 1.00 | | | 65.00 | | 65.00 | - +--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+ - | 2 page website design Includes ba... | | 3.00 | | | 2100.00 | | 2100.00 | - +--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+ - | Mobile designs Includes responsiv... | | 1.00 | | | 250.00 | 1 | 250.00 | - +--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+ -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - - -### AddressField -Aside from the basic `BaseField` attributes, the address field `AddressField` also implements the following: - -* **street_number** (`String`): String representation of the street number. Can be `nil`. -* **street_name** (`String`): Name of the street. Can be `nil`. -* **po_box** (`String`): String representation of the PO Box number. Can be `nil`. -* **address_complement** (`String`): Address complement. Can be `nil`. -* **city** (`String`): City name. Can be `nil`. -* **postal_code** (`String`): String representation of the postal code. Can be `nil`. -* **state** (`String`): State name. Can be `nil`. -* **country** (`String`): Country name. Can be `nil`. - -Note: The `value` field of an AddressField should be a concatenation of the rest of the values. - - -### Amount Field -The amount field `AmountField` only has one constraint: its **value** is a `Float` (or `nil`). - - -### Classification Field -The classification field `ClassificationField` does not implement all the basic `Field` attributes. It only implements -**value**, **confidence** and **page_id**. - -> Note: a classification field's `value is always a `String`. - - -### Company Registration Field -Aside from the basic `Field` attributes, the company registration field `CompanyRegistrationField` also implements the -following: - -* **type** (`String`): the type of company. - -### Date Field -Aside from the basic `Field` attributes, the date field `DateField` also implements the following: - -* **date_object** (`Date`): an accessible representation of the value as a JavaScript object. - -### Locale Field -The locale field `LocaleField` only implements the **value**, **confidence** and **page_id** base `Field` attributes, -but it comes with its own: - -* **language** (`String`): ISO 639-1 language code (e.g.: `en` for English). Can be `nil`. -* **country** (`String`): ISO 3166-1 alpha-2 or ISO 3166-1 alpha-3 code for countries (e.g.: `GRB` or `GB` for "Great -Britain"). Can be `nil`. -* **currency** (`String`): ISO 4217 code for currencies (e.g.: `USD` for "US Dollars"). Can be `nil`. - -### Payment Details Field -Aside from the basic `Field` attributes, the payment details field `PaymentDetailsField` also implements the -following: - -* **account_number** (`String`): number of an account, expressed as a string. Can be `nil`. -* **iban** (`String`): International Bank Account Number. Can be `nil`. -* **routing_number** (`String`): routing number of an account. Can be `nil`. -* **swift** (`String`): the account holder's bank's SWIFT Business Identifier Code (BIC). Can be `nil`. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -### Taxes Field -#### Tax -Aside from the basic `Field` attributes, the tax field `TaxField` also implements the following: - -* **rate** (`Float`): the tax rate applied to an item can be expressed as a percentage. Can be `nil`. -* **code** (`String`): tax code (or equivalent, depending on the origin of the document). Can be `nil`. -* **base** (`Float`): base amount used for the tax. Can be `nil`. -* **value** (`Float`): the value of the tax. Can be `nil`. - -> Note: currently `TaxField` is not used on its own, and is accessed through a parent `Taxes` object, an array-like -structure. - -#### Taxes (Array) -The `Taxes` field represents an array-like collection of `TaxField` objects. As it is the representation of several -objects, it has access to a custom `to_s` method that can render a `TaxField` object as a table line. - -## Specific Fields -Fields which are specific to this product; they are not used in any other product. - -### Line Items Field -List of all the line items present on the invoice. - -A `InvoiceV4LineItem` implements the following attributes: - -* `description` (String): The item description. -* `product_code` (String): The product code of the item. -* `quantity` (Float): The item quantity -* `tax_amount` (Float): The item tax amount. -* `tax_rate` (Float): The item tax rate in percentage. -* `total_amount` (Float): The item total amount. -* `unit_measure` (String): The item unit of measure. -* `unit_price` (Float): The item unit price. - -# Attributes -The following fields are extracted for Invoice V4: - -## Billing Address -**billing_address** ([AddressField](#address-field)): The customer billing address. - -```rb -puts result.document.inference.prediction.billing_address.value -``` - -## Purchase Category -**category** ([ClassificationField](#classification-field)): The purchase category. - -#### Possible values include: - - 'toll' - - 'food' - - 'parking' - - 'transport' - - 'accommodation' - - 'telecom' - - 'miscellaneous' - - 'software' - - 'shopping' - - 'energy' - -```rb -puts result.document.inference.prediction.category.value -``` - -## Customer Address -**customer_address** ([AddressField](#address-field)): The address of the customer. - -```rb -puts result.document.inference.prediction.customer_address.value -``` - -## Customer Company Registrations -**customer_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company registration numbers associated to the customer. - -```rb -result.document.inference.prediction.customer_company_registrations do |customer_company_registrations_elem| - puts customer_company_registrations_elem.value -end -``` - -## Customer ID -**customer_id** ([StringField](#string-field)): The customer account number or identifier from the supplier. - -```rb -puts result.document.inference.prediction.customer_id.value -``` - -## Customer Name -**customer_name** ([StringField](#string-field)): The name of the customer or client. - -```rb -puts result.document.inference.prediction.customer_name.value -``` - -## Purchase Date -**date** ([DateField](#date-field)): The date the purchase was made. - -```rb -puts result.document.inference.prediction.date.value -``` - -## Document Type -**document_type** ([ClassificationField](#classification-field)): Document type: INVOICE or CREDIT NOTE. - -#### Possible values include: - - 'INVOICE' - - 'CREDIT NOTE' - -```rb -puts result.document.inference.prediction.document_type.value -``` - -## Document Type Extended -**document_type_extended** ([ClassificationField](#classification-field)): Document type extended. - -#### Possible values include: - - 'CREDIT NOTE' - - 'INVOICE' - - 'OTHER' - - 'OTHER_FINANCIAL' - - 'PAYSLIP' - - 'PURCHASE ORDER' - - 'QUOTE' - - 'RECEIPT' - - 'STATEMENT' - -```rb -puts result.document.inference.prediction.document_type_extended.value -``` - -## Due Date -**due_date** ([DateField](#date-field)): The date on which the payment is due. - -```rb -puts result.document.inference.prediction.due_date.value -``` - -## Invoice Number -**invoice_number** ([StringField](#string-field)): The invoice number or identifier. - -```rb -puts result.document.inference.prediction.invoice_number.value -``` - -## Line Items -**line_items** (Array<[InvoiceV4LineItem](#line-items-field)>): List of all the line items present on the invoice. - -```rb -result.document.inference.prediction.line_items do |line_items_elem| - puts line_items_elem.value -end -``` - -## Locale -**locale** ([LocaleField](#locale-field)): The locale of the document. - -```rb -puts result.document.inference.prediction.locale.value -``` - -## Payment Date -**payment_date** ([DateField](#date-field)): The date on which the payment is due / was full-filled. - -```rb -puts result.document.inference.prediction.payment_date.value -``` - -## Purchase Order Number -**po_number** ([StringField](#string-field)): The purchase order number. - -```rb -puts result.document.inference.prediction.po_number.value -``` - -## Reference Numbers -**reference_numbers** (Array<[StringField](#string-field)>): List of all reference numbers on the invoice, including the purchase order number. - -```rb -result.document.inference.prediction.reference_numbers do |reference_numbers_elem| - puts reference_numbers_elem.value -end -``` - -## Shipping Address -**shipping_address** ([AddressField](#address-field)): Customer's delivery address. - -```rb -puts result.document.inference.prediction.shipping_address.value -``` - -## Purchase Subcategory -**subcategory** ([ClassificationField](#classification-field)): The purchase subcategory for transport, food and shopping. - -#### Possible values include: - - 'plane' - - 'taxi' - - 'train' - - 'restaurant' - - 'shopping' - - 'other' - - 'groceries' - - 'cultural' - - 'electronics' - - 'office_supplies' - - 'micromobility' - - 'car_rental' - - 'public' - - 'delivery' - - nil - -```rb -puts result.document.inference.prediction.subcategory.value -``` - -## Supplier Address -**supplier_address** ([AddressField](#address-field)): The address of the supplier or merchant. - -```rb -puts result.document.inference.prediction.supplier_address.value -``` - -## Supplier Company Registrations -**supplier_company_registrations** (Array<[CompanyRegistrationField](#company-registration-field)>): List of company registration numbers associated to the supplier. - -```rb -result.document.inference.prediction.supplier_company_registrations do |supplier_company_registrations_elem| - puts supplier_company_registrations_elem.value -end -``` - -## Supplier Email -**supplier_email** ([StringField](#string-field)): The email address of the supplier or merchant. - -```rb -puts result.document.inference.prediction.supplier_email.value -``` - -## Supplier Name -**supplier_name** ([StringField](#string-field)): The name of the supplier or merchant. - -```rb -puts result.document.inference.prediction.supplier_name.value -``` - -## Supplier Payment Details -**supplier_payment_details** (Array<[PaymentDetailsField](#payment-details-field)>): List of payment details associated to the supplier of the invoice. - -```rb -result.document.inference.prediction.supplier_payment_details do |supplier_payment_details_elem| - puts supplier_payment_details_elem.value - puts supplier_payment_details_elem.rate - puts supplier_payment_details_elem.code - puts supplier_payment_details_elem.basis -end -``` - -## Supplier Phone Number -**supplier_phone_number** ([StringField](#string-field)): The phone number of the supplier or merchant. - -```rb -puts result.document.inference.prediction.supplier_phone_number.value -``` - -## Supplier Website -**supplier_website** ([StringField](#string-field)): The website URL of the supplier or merchant. - -```rb -puts result.document.inference.prediction.supplier_website.value -``` - -## Taxes -**taxes** (Array<[TaxField](#taxes-field)>): List of taxes. Each item contains the detail of the tax. - -```rb -result.document.inference.prediction.taxes do |taxes_elem| - puts taxes_elem.value -end -``` - -## Total Amount -**total_amount** ([AmountField](#amount-field)): The total amount of the invoice: includes taxes, tips, fees, and other charges. - -```rb -puts result.document.inference.prediction.total_amount.value -``` - -## Total Net -**total_net** ([AmountField](#amount-field)): The net amount of the invoice: does not include taxes, fees, and discounts. - -```rb -puts result.document.inference.prediction.total_net.value -``` - -## Total Tax -**total_tax** ([AmountField](#amount-field)): The total tax: the sum of all the taxes for this invoice. - -```rb -puts result.document.inference.prediction.total_tax.value -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/global_products/multi_receipts_detector_v1.md b/docs/global_products/multi_receipts_detector_v1.md deleted file mode 100644 index 1941efe78..000000000 --- a/docs/global_products/multi_receipts_detector_v1.md +++ /dev/null @@ -1,131 +0,0 @@ ---- -title: Multi Receipts Detector -category: 622b805aaec68102ea7fcbc2 -slug: ruby-multi-receipts-detector-ocr -parentDoc: 67b49df15b843f3fa9cd622b ---- -The Ruby Client Library supports the [Multi Receipts Detector API](https://platform.mindee.com/mindee/multi_receipts_detector). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `multi_receipts_detector` | -> | Recommended Version | `v1.1` | -> | Supports Polling/Webhooks | โŒ No | -> | Support Synchronous HTTP Calls | โœ”๏ธ Yes | -> | Geography | ๐ŸŒ Global | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/multi_receipts_detector/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Multi Receipts Detector sample](https://github.com/mindee/client-lib-test-data/blob/main/products/multi_receipts_detector/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::MultiReceiptsDetector::MultiReceiptsDetectorV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: d7c5b25f-e0d3-4491-af54-6183afa1aaab -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/multi_receipts_detector v1.0 -:Rotation applied: Yes - -Prediction -========== -:List of Receipts: Polygon with 4 points. - Polygon with 4 points. - Polygon with 4 points. - Polygon with 4 points. - Polygon with 4 points. - Polygon with 4 points. - -Page Predictions -================ - -Page 0 ------- -:List of Receipts: Polygon with 4 points. - Polygon with 4 points. - Polygon with 4 points. - Polygon with 4 points. - Polygon with 4 points. - Polygon with 4 points. -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - - -### Position Field -The position field `PositionField` does not implement all the basic `Field` attributes, only **bounding_box**, -**polygon** and **page_id**. On top of these, it has access to: - -* **rectangle** (`Mindee::Geometry::Quadrilateral`): a Polygon with four points that may be oriented (even beyond -canvas). -* **quadrangle** (`Mindee::Geometry::Quadrilateral`): a free polygon made up of four points. - -# Attributes -The following fields are extracted for Multi Receipts Detector V1: - -## List of Receipts -**receipts** (Array<[PositionField](#position-field)>): Positions of the receipts on the document. - -```rb -result.document.inference.prediction.receipts do |receipts_elem| - puts receipts_elem.polygon.to_s - puts receipts_elem.quadrangle.to_s - puts receipts_elem.rectangle.to_s - puts receipts_elem.boundingBox.to_s -end -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/global_products/nutrition_facts_v1.md b/docs/global_products/nutrition_facts_v1.md deleted file mode 100644 index 60902db28..000000000 --- a/docs/global_products/nutrition_facts_v1.md +++ /dev/null @@ -1,399 +0,0 @@ ---- -title: Nutrition Facts Label -category: 622b805aaec68102ea7fcbc2 -slug: ruby-nutrition-facts-label-ocr -parentDoc: 67b49df15b843f3fa9cd622b ---- -The Ruby Client Library supports the [Nutrition Facts Label API](https://platform.mindee.com/mindee/nutrition_facts). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `nutrition_facts` | -> | Recommended Version | `v1.0` | -> | Supports Polling/Webhooks | โœ”๏ธ Yes | -> | Support Synchronous HTTP Calls | โŒ No | -> | Geography | ๐ŸŒ Global | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- | ------------- | -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/nutrition_facts/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Nutrition Facts Label sample](https://github.com/mindee/client-lib-test-data/blob/main/products/nutrition_facts/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::NutritionFactsLabel::NutritionFactsLabelV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: 38a12fe0-5d69-4ca4-9b30-12f1b659311c -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/nutrition_facts v1.0 -:Rotation applied: No - -Prediction -========== -:Serving per Box: 2.00 -:Serving Size: - :Amount: 228.00 - :Unit: g -:Calories: - :Daily Value: - :Per 100g: - :Per Serving: 250.00 -:Total Fat: - :Daily Value: - :Per 100g: - :Per Serving: 12.00 -:Saturated Fat: - :Daily Value: 15.00 - :Per 100g: - :Per Serving: 3.00 -:Trans Fat: - :Daily Value: - :Per 100g: - :Per Serving: 3.00 -:Cholesterol: - :Daily Value: 10.00 - :Per 100g: - :Per Serving: 30.00 -:Total Carbohydrate: - :Daily Value: 10.00 - :Per 100g: - :Per Serving: 31.00 -:Dietary Fiber: - :Daily Value: 0.00 - :Per 100g: - :Per Serving: 0.00 -:Total Sugars: - :Daily Value: - :Per 100g: - :Per Serving: 5.00 -:Added Sugars: - :Daily Value: - :Per 100g: - :Per Serving: -:Protein: - :Daily Value: - :Per 100g: - :Per Serving: 5.00 -:sodium: - :Daily Value: 20.00 - :Per 100g: - :Per Serving: 470.00 - :Unit: mg -:nutrients: - +-------------+----------------------+----------+-------------+------+ - | Daily Value | Name | Per 100g | Per Serving | Unit | - +=============+======================+==========+=============+======+ - | 12.00 | Vitamin A | | 4.00 | mcg | - +-------------+----------------------+----------+-------------+------+ - | 12.00 | Vitamin C | | 2.00 | mg | - +-------------+----------------------+----------+-------------+------+ - | 12.00 | Calcium | | 45.60 | mg | - +-------------+----------------------+----------+-------------+------+ - | 12.00 | Iron | | 0.90 | mg | - +-------------+----------------------+----------+-------------+------+ -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - - -### Amount Field -The amount field `AmountField` only has one constraint: its **value** is a `Float` (or `nil`). - -## Specific Fields -Fields which are specific to this product; they are not used in any other product. - -### Serving Size Field -The size of a single serving of the product. - -A `NutritionFactsLabelV1ServingSize` implements the following attributes: - -* `amount` (Float): The amount of a single serving. -* `unit` (String): The unit for the amount of a single serving. -Fields which are specific to this product; they are not used in any other product. - -### Calories Field -The amount of calories in the product. - -A `NutritionFactsLabelV1Calorie` implements the following attributes: - -* `daily_value` (Float): DVs are the recommended amounts of calories to consume or not to exceed each day. -* `per_100g` (Float): The amount of calories per 100g of the product. -* `per_serving` (Float): The amount of calories per serving of the product. -Fields which are specific to this product; they are not used in any other product. - -### Total Fat Field -The total amount of fat in the product. - -A `NutritionFactsLabelV1TotalFat` implements the following attributes: - -* `daily_value` (Float): DVs are the recommended amounts of total fat to consume or not to exceed each day. -* `per_100g` (Float): The amount of total fat per 100g of the product. -* `per_serving` (Float): The amount of total fat per serving of the product. -Fields which are specific to this product; they are not used in any other product. - -### Saturated Fat Field -The amount of saturated fat in the product. - -A `NutritionFactsLabelV1SaturatedFat` implements the following attributes: - -* `daily_value` (Float): DVs are the recommended amounts of saturated fat to consume or not to exceed each day. -* `per_100g` (Float): The amount of saturated fat per 100g of the product. -* `per_serving` (Float): The amount of saturated fat per serving of the product. -Fields which are specific to this product; they are not used in any other product. - -### Trans Fat Field -The amount of trans fat in the product. - -A `NutritionFactsLabelV1TransFat` implements the following attributes: - -* `daily_value` (Float): DVs are the recommended amounts of trans fat to consume or not to exceed each day. -* `per_100g` (Float): The amount of trans fat per 100g of the product. -* `per_serving` (Float): The amount of trans fat per serving of the product. -Fields which are specific to this product; they are not used in any other product. - -### Cholesterol Field -The amount of cholesterol in the product. - -A `NutritionFactsLabelV1Cholesterol` implements the following attributes: - -* `daily_value` (Float): DVs are the recommended amounts of cholesterol to consume or not to exceed each day. -* `per_100g` (Float): The amount of cholesterol per 100g of the product. -* `per_serving` (Float): The amount of cholesterol per serving of the product. -Fields which are specific to this product; they are not used in any other product. - -### Total Carbohydrate Field -The total amount of carbohydrates in the product. - -A `NutritionFactsLabelV1TotalCarbohydrate` implements the following attributes: - -* `daily_value` (Float): DVs are the recommended amounts of total carbohydrates to consume or not to exceed each day. -* `per_100g` (Float): The amount of total carbohydrates per 100g of the product. -* `per_serving` (Float): The amount of total carbohydrates per serving of the product. -Fields which are specific to this product; they are not used in any other product. - -### Dietary Fiber Field -The amount of dietary fiber in the product. - -A `NutritionFactsLabelV1DietaryFiber` implements the following attributes: - -* `daily_value` (Float): DVs are the recommended amounts of dietary fiber to consume or not to exceed each day. -* `per_100g` (Float): The amount of dietary fiber per 100g of the product. -* `per_serving` (Float): The amount of dietary fiber per serving of the product. -Fields which are specific to this product; they are not used in any other product. - -### Total Sugars Field -The total amount of sugars in the product. - -A `NutritionFactsLabelV1TotalSugar` implements the following attributes: - -* `daily_value` (Float): DVs are the recommended amounts of total sugars to consume or not to exceed each day. -* `per_100g` (Float): The amount of total sugars per 100g of the product. -* `per_serving` (Float): The amount of total sugars per serving of the product. -Fields which are specific to this product; they are not used in any other product. - -### Added Sugars Field -The amount of added sugars in the product. - -A `NutritionFactsLabelV1AddedSugar` implements the following attributes: - -* `daily_value` (Float): DVs are the recommended amounts of added sugars to consume or not to exceed each day. -* `per_100g` (Float): The amount of added sugars per 100g of the product. -* `per_serving` (Float): The amount of added sugars per serving of the product. -Fields which are specific to this product; they are not used in any other product. - -### Protein Field -The amount of protein in the product. - -A `NutritionFactsLabelV1Protein` implements the following attributes: - -* `daily_value` (Float): DVs are the recommended amounts of protein to consume or not to exceed each day. -* `per_100g` (Float): The amount of protein per 100g of the product. -* `per_serving` (Float): The amount of protein per serving of the product. -Fields which are specific to this product; they are not used in any other product. - -### sodium Field -The amount of sodium in the product. - -A `NutritionFactsLabelV1Sodium` implements the following attributes: - -* `daily_value` (Float): DVs are the recommended amounts of sodium to consume or not to exceed each day. -* `per_100g` (Float): The amount of sodium per 100g of the product. -* `per_serving` (Float): The amount of sodium per serving of the product. -* `unit` (String): The unit of measurement for the amount of sodium. -Fields which are specific to this product; they are not used in any other product. - -### nutrients Field -The amount of nutrients in the product. - -A `NutritionFactsLabelV1Nutrient` implements the following attributes: - -* `daily_value` (Float): DVs are the recommended amounts of nutrients to consume or not to exceed each day. -* `name` (String): The name of nutrients of the product. -* `per_100g` (Float): The amount of nutrients per 100g of the product. -* `per_serving` (Float): The amount of nutrients per serving of the product. -* `unit` (String): The unit of measurement for the amount of nutrients. - -# Attributes -The following fields are extracted for Nutrition Facts Label V1: - -## Added Sugars -**added_sugars** ([NutritionFactsLabelV1AddedSugar](#added-sugars-field)): The amount of added sugars in the product. - -```rb -puts result.document.inference.prediction.added_sugars.value -``` - -## Calories -**calories** ([NutritionFactsLabelV1Calorie](#calories-field)): The amount of calories in the product. - -```rb -puts result.document.inference.prediction.calories.value -``` - -## Cholesterol -**cholesterol** ([NutritionFactsLabelV1Cholesterol](#cholesterol-field)): The amount of cholesterol in the product. - -```rb -puts result.document.inference.prediction.cholesterol.value -``` - -## Dietary Fiber -**dietary_fiber** ([NutritionFactsLabelV1DietaryFiber](#dietary-fiber-field)): The amount of dietary fiber in the product. - -```rb -puts result.document.inference.prediction.dietary_fiber.value -``` - -## nutrients -**nutrients** (Array<[NutritionFactsLabelV1Nutrient](#nutrients-field)>): The amount of nutrients in the product. - -```rb -result.document.inference.prediction.nutrients do |nutrients_elem| - puts nutrients_elem.value -end -``` - -## Protein -**protein** ([NutritionFactsLabelV1Protein](#protein-field)): The amount of protein in the product. - -```rb -puts result.document.inference.prediction.protein.value -``` - -## Saturated Fat -**saturated_fat** ([NutritionFactsLabelV1SaturatedFat](#saturated-fat-field)): The amount of saturated fat in the product. - -```rb -puts result.document.inference.prediction.saturated_fat.value -``` - -## Serving per Box -**serving_per_box** ([AmountField](#amount-field)): The number of servings in each box of the product. - -```rb -puts result.document.inference.prediction.serving_per_box.value -``` - -## Serving Size -**serving_size** ([NutritionFactsLabelV1ServingSize](#serving-size-field)): The size of a single serving of the product. - -```rb -puts result.document.inference.prediction.serving_size.value -``` - -## sodium -**sodium** ([NutritionFactsLabelV1Sodium](#sodium-field)): The amount of sodium in the product. - -```rb -puts result.document.inference.prediction.sodium.value -``` - -## Total Carbohydrate -**total_carbohydrate** ([NutritionFactsLabelV1TotalCarbohydrate](#total-carbohydrate-field)): The total amount of carbohydrates in the product. - -```rb -puts result.document.inference.prediction.total_carbohydrate.value -``` - -## Total Fat -**total_fat** ([NutritionFactsLabelV1TotalFat](#total-fat-field)): The total amount of fat in the product. - -```rb -puts result.document.inference.prediction.total_fat.value -``` - -## Total Sugars -**total_sugars** ([NutritionFactsLabelV1TotalSugar](#total-sugars-field)): The total amount of sugars in the product. - -```rb -puts result.document.inference.prediction.total_sugars.value -``` - -## Trans Fat -**trans_fat** ([NutritionFactsLabelV1TransFat](#trans-fat-field)): The amount of trans fat in the product. - -```rb -puts result.document.inference.prediction.trans_fat.value -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/global_products/passport_v1.md b/docs/global_products/passport_v1.md deleted file mode 100644 index aa8685a2c..000000000 --- a/docs/global_products/passport_v1.md +++ /dev/null @@ -1,207 +0,0 @@ ---- -title: Passport -category: 622b805aaec68102ea7fcbc2 -slug: ruby-passport-ocr -parentDoc: 67b49df15b843f3fa9cd622b ---- -The Ruby Client Library supports the [Passport API](https://platform.mindee.com/mindee/passport). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `passport` | -> | Recommended Version | `v1.1` | -> | Supports Polling/Webhooks | โŒ No | -> | Support Synchronous HTTP Calls | โœ”๏ธ Yes | -> | Geography | ๐ŸŒ Global | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/passport/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Passport sample](https://github.com/mindee/client-lib-test-data/blob/main/products/passport/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::Passport::PassportV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: 18e41f6c-16cd-4f8e-8cd2-00ca02a35764 -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/passport v1.0 -:Rotation applied: Yes - -Prediction -========== -:Country Code: GBR -:ID Number: 707797979 -:Given Name(s): HENERT -:Surname: PUDARSAN -:Date of Birth: 1995-05-20 -:Place of Birth: CAMTETH -:Gender: M -:Date of Issue: 2012-04-22 -:Expiry Date: 2017-04-22 -:MRZ Line 1: P): The given name(s) of the passport holder. - -```rb -result.document.inference.prediction.given_names do |given_names_elem| - puts given_names_elem.value -end -``` - -## ID Number -**id_number** ([StringField](#string-field)): The passport's identification number. - -```rb -puts result.document.inference.prediction.id_number.value -``` - -## Date of Issue -**issuance_date** ([DateField](#date-field)): The date the passport was issued. - -```rb -puts result.document.inference.prediction.issuance_date.value -``` - -## MRZ Line 1 -**mrz1** ([StringField](#string-field)): Machine Readable Zone, first line - -```rb -puts result.document.inference.prediction.mrz1.value -``` - -## MRZ Line 2 -**mrz2** ([StringField](#string-field)): Machine Readable Zone, second line - -```rb -puts result.document.inference.prediction.mrz2.value -``` - -## Surname -**surname** ([StringField](#string-field)): The surname of the passport holder. - -```rb -puts result.document.inference.prediction.surname.value -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/global_products/resume_v1.md b/docs/global_products/resume_v1.md deleted file mode 100644 index 304309964..000000000 --- a/docs/global_products/resume_v1.md +++ /dev/null @@ -1,384 +0,0 @@ ---- -title: Resume -category: 622b805aaec68102ea7fcbc2 -slug: ruby-resume-ocr -parentDoc: 67b49df15b843f3fa9cd622b ---- -The Ruby Client Library supports the [Resume API](https://platform.mindee.com/mindee/resume). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `resume` | -> | Recommended Version | `v1.2` | -> | Supports Polling/Webhooks | โœ”๏ธ Yes | -> | Support Synchronous HTTP Calls | โŒ No | -> | Geography | ๐ŸŒ Global | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- | ------------- | -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/resume/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Resume sample](https://github.com/mindee/client-lib-test-data/blob/main/products/resume/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::Resume::ResumeV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: 9daa3085-152c-454e-9245-636f13fc9dc3 -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/resume v1.1 -:Rotation applied: Yes - -Prediction -========== -:Document Language: ENG -:Document Type: RESUME -:Given Names: Christopher -:Surnames: Morgan -:Nationality: -:Email Address: christoper.m@gmail.com -:Phone Number: +44 (0)20 7666 8555 -:Address: 177 Great Portland Street, London, W5W 6PQ -:Social Networks: - +----------------------+----------------------------------------------------+ - | Name | URL | - +======================+====================================================+ - | LinkedIn | linkedin.com/christopher.morgan | - +----------------------+----------------------------------------------------+ -:Profession: Senior Web Developer -:Job Applied: -:Languages: - +----------+----------------------+ - | Language | Level | - +==========+======================+ - | SPA | Fluent | - +----------+----------------------+ - | ZHO | Beginner | - +----------+----------------------+ - | DEU | Beginner | - +----------+----------------------+ -:Hard Skills: HTML5 - PHP OOP - JavaScript - CSS - MySQL - SQL -:Soft Skills: Project management - Creative design - Strong decision maker - Innovative - Complex problem solver - Service-focused -:Education: - +-----------------+---------------------------+-----------+----------+---------------------------+-------------+------------+ - | Domain | Degree | End Month | End Year | School | Start Month | Start Year | - +=================+===========================+===========+==========+===========================+=============+============+ - | Computer Inf... | Bachelor | | 2014 | Columbia University, NY | | | - +-----------------+---------------------------+-----------+----------+---------------------------+-------------+------------+ -:Professional Experiences: - +-----------------+------------+--------------------------------------+---------------------------+-----------+----------+----------------------+-------------+------------+ - | Contract Type | Department | Description | Employer | End Month | End Year | Role | Start Month | Start Year | - +=================+============+======================================+===========================+===========+==========+======================+=============+============+ - | | | Cooperate with designers to creat... | Luna Web Design, New York | 05 | 2019 | Web Developer | 09 | 2015 | - +-----------------+------------+--------------------------------------+---------------------------+-----------+----------+----------------------+-------------+------------+ -:Certificates: - +------------+--------------------------------+---------------------------+------+ - | Grade | Name | Provider | Year | - +============+================================+===========================+======+ - | | PHP Framework (certificate)... | | | - +------------+--------------------------------+---------------------------+------+ -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - - -### Classification Field -The classification field `ClassificationField` does not implement all the basic `Field` attributes. It only implements -**value**, **confidence** and **page_id**. - -> Note: a classification field's `value is always a `String`. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -## Specific Fields -Fields which are specific to this product; they are not used in any other product. - -### Social Networks Field -The list of social network profiles of the candidate. - -A `ResumeV1SocialNetworksUrl` implements the following attributes: - -* `name` (String): The name of the social network. -* `url` (String): The URL of the social network. -Fields which are specific to this product; they are not used in any other product. - -### Languages Field -The list of languages that the candidate is proficient in. - -A `ResumeV1Language` implements the following attributes: - -* `language` (String): The language's ISO 639 code. -* `level` (String): The candidate's level for the language. - -#### Possible values include: - - Native - - Fluent - - Proficient - - Intermediate - - Beginner - -Fields which are specific to this product; they are not used in any other product. - -### Education Field -The list of the candidate's educational background. - -A `ResumeV1Education` implements the following attributes: - -* `degree_domain` (String): The area of study or specialization. -* `degree_type` (String): The type of degree obtained, such as Bachelor's, Master's, or Doctorate. -* `end_month` (String): The month when the education program or course was completed. -* `end_year` (String): The year when the education program or course was completed. -* `school` (String): The name of the school. -* `start_month` (String): The month when the education program or course began. -* `start_year` (String): The year when the education program or course began. -Fields which are specific to this product; they are not used in any other product. - -### Professional Experiences Field -The list of the candidate's professional experiences. - -A `ResumeV1ProfessionalExperience` implements the following attributes: - -* `contract_type` (String): The type of contract for the professional experience. - -#### Possible values include: - - Full-Time - - Part-Time - - Internship - - Freelance - -* `department` (String): The specific department or division within the company. -* `description` (String): The description of the professional experience as written in the document. -* `employer` (String): The name of the company or organization. -* `end_month` (String): The month when the professional experience ended. -* `end_year` (String): The year when the professional experience ended. -* `role` (String): The position or job title held by the candidate. -* `start_month` (String): The month when the professional experience began. -* `start_year` (String): The year when the professional experience began. -Fields which are specific to this product; they are not used in any other product. - -### Certificates Field -The list of certificates obtained by the candidate. - -A `ResumeV1Certificate` implements the following attributes: - -* `grade` (String): The grade obtained for the certificate. -* `name` (String): The name of certification. -* `provider` (String): The organization or institution that issued the certificate. -* `year` (String): The year when a certificate was issued or received. - -# Attributes -The following fields are extracted for Resume V1: - -## Address -**address** ([StringField](#string-field)): The location information of the candidate, including city, state, and country. - -```rb -puts result.document.inference.prediction.address.value -``` - -## Certificates -**certificates** (Array<[ResumeV1Certificate](#certificates-field)>): The list of certificates obtained by the candidate. - -```rb -result.document.inference.prediction.certificates do |certificates_elem| - puts certificates_elem.value -end -``` - -## Document Language -**document_language** ([StringField](#string-field)): The ISO 639 code of the language in which the document is written. - -```rb -puts result.document.inference.prediction.document_language.value -``` - -## Document Type -**document_type** ([ClassificationField](#classification-field)): The type of the document sent. - -#### Possible values include: - - 'RESUME' - - 'MOTIVATION_LETTER' - - 'RECOMMENDATION_LETTER' - -```rb -puts result.document.inference.prediction.document_type.value -``` - -## Education -**education** (Array<[ResumeV1Education](#education-field)>): The list of the candidate's educational background. - -```rb -result.document.inference.prediction.education do |education_elem| - puts education_elem.value -end -``` - -## Email Address -**email_address** ([StringField](#string-field)): The email address of the candidate. - -```rb -puts result.document.inference.prediction.email_address.value -``` - -## Given Names -**given_names** (Array<[StringField](#string-field)>): The candidate's first or given names. - -```rb -result.document.inference.prediction.given_names do |given_names_elem| - puts given_names_elem.value -end -``` - -## Hard Skills -**hard_skills** (Array<[StringField](#string-field)>): The list of the candidate's technical abilities and knowledge. - -```rb -result.document.inference.prediction.hard_skills do |hard_skills_elem| - puts hard_skills_elem.value -end -``` - -## Job Applied -**job_applied** ([StringField](#string-field)): The position that the candidate is applying for. - -```rb -puts result.document.inference.prediction.job_applied.value -``` - -## Languages -**languages** (Array<[ResumeV1Language](#languages-field)>): The list of languages that the candidate is proficient in. - -```rb -result.document.inference.prediction.languages do |languages_elem| - puts languages_elem.value -end -``` - -## Nationality -**nationality** ([StringField](#string-field)): The ISO 3166 code for the country of citizenship of the candidate. - -```rb -puts result.document.inference.prediction.nationality.value -``` - -## Phone Number -**phone_number** ([StringField](#string-field)): The phone number of the candidate. - -```rb -puts result.document.inference.prediction.phone_number.value -``` - -## Profession -**profession** ([StringField](#string-field)): The candidate's current profession. - -```rb -puts result.document.inference.prediction.profession.value -``` - -## Professional Experiences -**professional_experiences** (Array<[ResumeV1ProfessionalExperience](#professional-experiences-field)>): The list of the candidate's professional experiences. - -```rb -result.document.inference.prediction.professional_experiences do |professional_experiences_elem| - puts professional_experiences_elem.value -end -``` - -## Social Networks -**social_networks_urls** (Array<[ResumeV1SocialNetworksUrl](#social-networks-field)>): The list of social network profiles of the candidate. - -```rb -result.document.inference.prediction.social_networks_urls do |social_networks_urls_elem| - puts social_networks_urls_elem.value -end -``` - -## Soft Skills -**soft_skills** (Array<[StringField](#string-field)>): The list of the candidate's interpersonal and communication abilities. - -```rb -result.document.inference.prediction.soft_skills do |soft_skills_elem| - puts soft_skills_elem.value -end -``` - -## Surnames -**surnames** (Array<[StringField](#string-field)>): The candidate's last names. - -```rb -result.document.inference.prediction.surnames do |surnames_elem| - puts surnames_elem.value -end -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/global_products/universal.md b/docs/global_products/universal.md deleted file mode 100644 index 95dabd179..000000000 --- a/docs/global_products/universal.md +++ /dev/null @@ -1,113 +0,0 @@ ---- -title: Universal -category: 622b805aaec68102ea7fcbc2 -slug: ruby-universal-ocr -parentDoc: 67b49df15b843f3fa9cd622b ---- -The Ruby Client Library implements a universal wrapper class for all products. - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ |-----------------------------------------------------------------| -> | Endpoint Name | `` | -> | Recommended Version | `v` Defaults to 1 for custom products. | -> | Supports Polling/Webhooks | โ“๏ธ Variable | -> | Support Synchronous HTTP Calls | โ“ Variable | -> | Geography | โ“ Variable | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- |---------------| -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - -The `Universal` product supports all products in a catch-all generic format, and can be used in the following manner: - -# Quick-Start - -```rb -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Initialize a custom endpoint for this product -custom_endpoint = mindee_client.create_endpoint( - account_name: 'my-account', - endpoint_name: 'my-endpoint', - version: 'my-version' -) - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::Universal::Universal, - endpoint: custom_endpoint - # Note: On compatible APIs, you can run this HTTP call synchronously by setting `enqueue: false` -) - -# Print a full summary of the parsed data in RST format -puts result.document -``` - -# Universal Endpoints - -You may have noticed in the previous step that in order to access a universal build, you will need to provide an account and an endpoint name at the very least. - -Although it is optional, the version number should match the latest version of your build in most use-cases. -If it is not set, it will default to "1". - -# Field Types - -## Universal Fields - -### Universal List Field - -A `UniversalListField` is a special type of custom list that implements the following: - -- **values** (`Array`): the confidence score of the field prediction. -- **page_id** (`Integer`): only available for some documents ATM. - -Since the inner contents can vary, the value isn't accessed through a property, but rather through the following functions: - -- **contents_list()** (`-> Array>`): returns a list of values for each element. -- **contents_string(separator=" ")** (`-> String`): returns a list of concatenated values, with an optional **separator** `String` between them. -> **Note:** the `to_s` method returns a string representation of all values of this object, with an empty space between each of them. - -### Universal Object Field - -Unrecognized structures and sometimes values of `ListField`s are stored in a `UniversalObjectField` structure, which is implemented dynamically depending on the object's structure. - -- **page_id** (`[Integer, nil]`): the ID of the page, is `nil` when at document-level. -- **raw_value** (`[String, nil]`): an optional field for when some post-processing has been done on fields (e.g. amounts). `nil` in most instances. -- **confidence** (`[Float, nil]`): the confidence score of the field prediction. Warning: support isn't guaranteed on all APIs. - - -> **Other fields**:No matter what, other fields will be stored in a dictionary-like structure with a `key: value` pair where `key` is a string and `value` is a nullable string. They can be accessed like any other regular value, but won't be suggested by your IDE. - - -### StringField -The text field `StringField` only has one constraint: its **value** is an `Optional[str]`. - - -# Attributes - -Universal builds always have access to at least two attributes: - -## Fields - -**fields** (`Hash>`): - -```rb -puts result.document.inference.prediction.fields["my-field"].to_s -``` - -# Questions? - -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/loading_a_document.md b/docs/loading_a_document.md deleted file mode 100644 index 4b5aa54ab..000000000 --- a/docs/loading_a_document.md +++ /dev/null @@ -1,330 +0,0 @@ ---- -title: Document Loading -category: 622b805aaec68102ea7fcbc2 -slug: ruby-document-loading -parentDoc: 6294d97ee723f1008d2ab28e ---- - -## Calling the Mindee API using webhooks - -> ๐Ÿšง This feature is only available for compatible products. -> -> See the `Supports Polling/Webhooks` section on the product's documentation. - -After [setting up a webhook for your account](https://developers.mindee.com/docs/webhooks), you can send a document, -and then retrieve the results from an API call in the following fashion: - -```rb -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Send the file to the server -enqueue_response = mindee_client.enqueue( - input_source, - Mindee::Product::Receipt::ReceiptV5 # ReceiptV5 supports asynchronous polling -) -``` - -Once your prediction is ready, the server will send it to your webhook. You can then use the payload as a regular -prediction: - -```rb -# Load the JSON string sent by the Mindee webhook POST callback. -# Reading the callback data will vary greatly depending on your HTTP server. -# This is therefore beyond the scope of this example. - -local_response = Mindee::Input::LocalResponse.new(request.body.string) - -# You can also use a File object as the input. -# FILE_PATH = File.join('path', 'to', 'file.json').freeze -# local_response = Mindee::Input::LocalResponse.new(FILE_PATH); - -# Optional: verify the HMAC signature. -unless local_response.valid_hmac_signature?(my_secret_key, 'invalid signature') - raise "Invalid HMAC signature!" -end - - -# Deserialize the response: -result = mindee_client.load_prediction( - Mindee::Product::Receipt::ReceiptV5, # The prediction type must match the initial enqueuing to work properly. - local_response -) - -# Print a summary of the parsed data in RST format -puts result.document -``` - -## Parsing operations - -Operations pertaining to the Client's `parse()` method. -The parsing process supports both synchronous and asynchronous modes, and you can fine-tune its behavior using several options. - -### Polling options - -When performing an asynchronous parse (i.e. when the document is enqueued), the client will poll the API for the result. -The following options control the polling behavior: - -* `initial_delay_sec`: The initial delay (in seconds) before the first polling attempt. -* `delay_sec`: The delay (in seconds) between subsequent polls. -* `max_retries`: The maximum number of polling attempts before timing out. - -These parameters ensure that the client does not overload the API with too-frequent requests and also avoid premature -timeouts. - -Example: - -```rb -result = mindee_client.parse( - input_source, - Mindee::Product::Invoice::InvoiceV4, - options: { - initial_delay_sec: 2, # Wait 2 seconds before the first poll. - delay_sec: 1.5, # Wait 1.5 seconds between polls. - max_retries: 80 # Try polling a maximum of 80 times. - } -) -``` - -> โš ๏ธ Warning: Setting `delay_sec` too low might lead to insufficient wait time between polls. -> -> This will cause the server to block your API calls for a short time (HTTP 429 errors). - -### Page operations - -When parsing PDFs, you can preprocess the document using page operations. -Using the `page_options` parameter, you can specify which pages to keep or remove even before the file is sent to the server. -This is especially useful if your document contains extraneous pages that you do not want to process. - -The available options are: - -* `page_indexes`: An array of zero-based page indexes. -* `operation`: The operation to performโ€”either: - * `:KEEP_ONLY` (keep only the specified pages) - * `:REMOVE` (remove the specified pages). -* `on_min_pages`: Apply the operation only if the document has at least the specified number of pages. - -Example: - -```rb -page_options = { - page_indexes:[1, 3], # Only target pages 1 and 3. - operation: :KEEP_ONLY, # Remove all other pages. - on_min_pages: 3 # Only apply if the document has at least 3 pages. -} - -result = mindee_client.parse( - input_source, - Mindee::Product::Invoice::InvoiceV4, - options: { - page_options: page_options - } -) -``` - -> โš ๏ธ Warning: Page operations alter the document's content. -> -> Ensure that this behavior is acceptable for your use case, as there is no undo once the pages are modified. - -## Workflow operations - -Workflow operations are similar to parsing operations, but they apply to calls made through the workflow feature. - -Example: - -```rb -workflow_options = { - document_alias: "my_document", - priority: :high, - page_options: { - page_indexes:[0, 1], - operation: :REMOVE - } - } - -result = mindee_client.execute_workflow( - input_source, - "workflow_id", - options: workflow_options -) -``` - -## Enqueueing and polling manually - -> โ—๏ธ We _strongly_ recommend you use a webhook setup, or a simple`parse()` call for most operations. -> -> Only use manual polling if you are **certain** that it is the best solution for you. - -> ๐Ÿšง This feature is only available for compatible products. -> -> See the `Supports Polling/Webhooks` section on the product's documentation. - -Instead of relying on the `parse()` method, you can enqueue documents and poll -the server manually: - -```rb -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Send the file to the server -enqueue_response = mindee_client.enqueue( - input_source, - Mindee::Product::Invoice::InvoiceV4 # InvoiceV4 supports asynchronous polling -) - -job_id = enqueue_response.job.id - -queue_res = parse_queued(job_id, Mindee::Product::Invoice::InvoiceV4, endpoint: endpoint) -polling_attempts = 0 - -while [Mindee::Parsing::Common::JobStatus::PROCESSING, Mindee::Parsing::Common::JobStatus::WAITING].include?( - queue_res.job.status) && polling_attempts < 80 # Recommended amounts of total retries for asynchronous polling. - sleep(1.5) # Recommended waiting time for re-attempts - queue_res = parse_queued(job_id, Mindee::Product::Invoice::InvoiceV4) - polling_attempts += 1 -end - -# If all went well, print a short summary of the result. -if queue_res.job.status == Mindee::Parsing::Common::JobStatus::COMPLETED - puts queue_res.document -end -``` - -## Loading a Document File - -Before sending a document to Mindeeโ€™s API, you first need to load the file into one of our input source wrappers. -These wrappers not only validate the file type (using a trusted MIME type check) but also give you access the following helper methods: - -* [image compression](https://developers.mindee.com/docs/ruby-advanced-file-operations#image-compression) -* [pdf compression](https://developers.mindee.com/docs/ruby-advanced-file-operations#pdf-compression) -* [PDF fixing](https://developers.mindee.com/docs/ruby-advanced-file-operations#pdf-fixing) - -> ๐Ÿ“˜ Regardless of how a document is loaded, the subsequent parsing or workflow operations remain the same. - -Mindeeโ€™s Ruby client supports several methods for loading a document. - -These can either be done locally: - -* Loading from a [local path](#loading-from-a-local-path) -* Loading from a [File object](#loading-from-a-file-object) -* Loading from a [Base64-encoded string](#loading-from-a-base64-encoded-string) -* Loading from a [raw sequence of bytes](#loading-from-raw-bytes) - -These four methods inherit from the `LocalInputSource` class, which provides a few common utility features described -[here](#under-the-hood---local-input-source-details). - -Or loading from a [URL](#loading-by-url). - -### Loading from a Local Path - -The most straightforward way of loading a document: load a file directly from disk by providing its path. - -Example: - -```rb -# Initialize the client. -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk using its absolute path. -input_source = mindee_client.source_from_path('/absolute/path/to/file.ext') -``` - -### Loading from a File Object - -When you already have an open file (in binary mode), you can pass it along with its original filename. - -Example: - -```rb -File.open('invoice.jpg', 'rb') do |file_obj| - # Creating a local input source from the file object. - input_source = mindee_client.source_from_file(file_obj, "invoice.jpg") - # Parsing happens similarly. -end -``` - -### Loading from a Base64-Encoded String - -For cases where you have file data encoded in Base64, load the document by providing the encoded string along with the -original filename. This converts the Base64 string into a local input source for further processing. - -Example: - -```rb -b64_string = "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGB..." # Example dummy b64_string. - -input_source = mindee_client.source_from_b64string(b64_string, "receipt.jpg") -``` - -### Loading from Raw Bytes - -If you have the fileโ€™s raw binary data (as bytes), create an input source by passing the bytes and the original -filename. - -Example: - -```rb -raw_bytes = b"%PDF-1.3\n%\xbf\xf7\xa2\xfe\n1 0 obj..." # Example dummy raw bytes sequence. - -input_source = mindee_client.source_from_bytes(raw_bytes, "invoice.pdf") -``` - -### Loading by URL - -For remote documents, you can load a file through its URL. The server will accept direct urls if: - -* They begin with "https\://". -* They point to a valid file. -* They do not redirect the request (e.g. Google Drive documents or proxies). - -Under the hood, the -[Mindee::Input::Source::URLInputSource](https://mindee.github.io/mindee-api-ruby/Mindee/Input/Source/URLInputSource.html) -class validates the URL, but won't perform an HTTP GET request unless specifically requested (using Rubyโ€™s Net::HTTP). - -Example: - -```rb -input_source = mindee_client.source_from_url("https://www.example.com/invoice.pdf") -result = mindee_client.parse(input_source, Mindee::Product::Invoice::InvoiceV4) -``` - -To download the files before sending them, you can use the `as_local_input_source` method. -It allows to follow redirects, and supports optional authentication (via basic auth or JWT tokens). -You can optionally download and save the file locally or convert it into a local input source for further processingโ€”thus benefiting from the same processing methods as local files. - -Additional URL features include: - -* Validation: The URLInputSource throws an error if the URL does not start with โ€œhttps\://โ€. -* Authentication: You can supply basic authentication (username/password) or a bearer token. -* Local Conversion: Methods such as `write_to_file` let you download and inspect the file locally. Alternatively, -* `as_local_input_source` converts the downloaded content into a LocalInputSource so you can apply operations like -* compression. - -Example: - -```rb -# Load the URL input normally: -remote_input_source = mindee_client.source_from_url("https://www.example.com/invoice.pdf") - -# Download the file and convert it to a `BytesInputSource` (type of `LocalInputSource`): -local_input_source = remote_input_source.as_local_input_source(filename: 'my_downloaded_invoice.pdf') - -# Download the file and save it to the specified directory: -local_downloaded_file_path = remote_input_source.write_to_file("path/to/my/downloaded/invoice.pdf") -``` - -### Under the Hood - Local Input Source Details - -When loading using from either a path, file, raw byte sequence or base64 string, the created object inherits from -[Mindee::Input::Source::LocalInputSource](https://mindee.github.io/mindee-api-ruby/Mindee/Input/Source/LocalInputSource.html). Key features include: - -* Automatic MIME Type Validation using Marcel to check for server file format compliance. -* An option ([repair_pdf](https://mindee.github.io/mindee-api-ruby/Mindee/Input/Source/LocalInputSource.html#initialize-instance_method)) to attempt recovery of PDFs with broken header information. -* File Operations: - * [compress!](https://mindee.github.io/mindee-api-ruby/Mindee/Input/Source/LocalInputSource.html#compress!-instance_method) โ€“ Compresses the file by invoking either the PDFCompressor for PDFs or the ImageCompressor for images. Parameters such as quality, max dimensions, and options to force or disable source text (for PDFs) are available. - * `write_to_file` ([URLInputSource version](https://mindee.github.io/mindee-api-ruby/Mindee/Input/Source/URLInputSource.html#write_to_file-instance_method), [LocalInputSource version](https://mindee.github.io/mindee-api-ruby/Mindee/Input/Source/LocalInputSource.html#write_to_file-instance_method)) โ€“ Saves the current state of the input (after possible operations) to disk. This is handy for inspection before parsing. - * [count_pages](https://mindee.github.io/mindee-api-ruby/Mindee/Input/Source/LocalInputSource.html#count_pages-instance_method) โ€“ For PDF files, returns the total page count; by default, non-PDF files are assumed to be single-page documents. - -## Questions? - -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/localized_products.md b/docs/localized_products.md deleted file mode 100644 index fd63b417b..000000000 --- a/docs/localized_products.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Localized Products -category: 622b805aaec68102ea7fcbc2 -slug: ruby-localized-products -parentDoc: 6294d97ee723f1008d2ab28e ---- \ No newline at end of file diff --git a/docs/localized_products/bank_account_details_v2.md b/docs/localized_products/bank_account_details_v2.md deleted file mode 100644 index 3a3896148..000000000 --- a/docs/localized_products/bank_account_details_v2.md +++ /dev/null @@ -1,158 +0,0 @@ ---- -title: FR Bank Account Details -category: 622b805aaec68102ea7fcbc2 -slug: ruby-fr-bank-account-details-ocr -parentDoc: 67b49e29a2cd6f08d69a40d8 ---- -The Ruby Client Library supports the [Bank Account Details API](https://platform.mindee.com/mindee/bank_account_details). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `bank_account_details` | -> | Recommended Version | `v2.0` | -> | Supports Polling/Webhooks | โŒ No | -> | Support Synchronous HTTP Calls | โœ”๏ธ Yes | -> | Geography | ๐Ÿ‡ซ๐Ÿ‡ท France | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/bank_account_details/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Bank Account Details sample](https://github.com/mindee/client-lib-test-data/blob/main/products/bank_account_details/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::FR::BankAccountDetails::BankAccountDetailsV2 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: bc8f7265-8dab-49fe-810c-d50049605578 -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/bank_account_details v2.0 -:Rotation applied: Yes - -Prediction -========== -:Account Holder's Names: MME HEGALALDIA L ENVOL -:Basic Bank Account Number: - :Bank Code: 13335 - :Branch Code: 00040 - :Key: 06 - :Account Number: 08932891361 -:IBAN: FR7613335000400893289136106 -:SWIFT Code: CEPAFRPP333 - -Page Predictions -================ - -Page 0 ------- -:Account Holder's Names: MME HEGALALDIA L ENVOL -:Basic Bank Account Number: - :Bank Code: 13335 - :Branch Code: 00040 - :Key: 06 - :Account Number: 08932891361 -:IBAN: FR7613335000400893289136106 -:SWIFT Code: CEPAFRPP333 -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -## Specific Fields -Fields which are specific to this product; they are not used in any other product. - -### Basic Bank Account Number Field -Full extraction of BBAN, including: branch code, bank code, account and key. - -A `BankAccountDetailsV2Bban` implements the following attributes: - -* `bban_bank_code` (String): The BBAN bank code outputted as a string. -* `bban_branch_code` (String): The BBAN branch code outputted as a string. -* `bban_key` (String): The BBAN key outputted as a string. -* `bban_number` (String): The BBAN Account number outputted as a string. - -# Attributes -The following fields are extracted for Bank Account Details V2: - -## Account Holder's Names -**account_holders_names** ([StringField](#string-field)): Full extraction of the account holders names. - -```rb -puts result.document.inference.prediction.account_holders_names.value -``` - -## Basic Bank Account Number -**bban** ([BankAccountDetailsV2Bban](#basic-bank-account-number-field)): Full extraction of BBAN, including: branch code, bank code, account and key. - -```rb -puts result.document.inference.prediction.bban.value -``` - -## IBAN -**iban** ([StringField](#string-field)): Full extraction of the IBAN number. - -```rb -puts result.document.inference.prediction.iban.value -``` - -## SWIFT Code -**swift_code** ([StringField](#string-field)): Full extraction of the SWIFT code. - -```rb -puts result.document.inference.prediction.swift_code.value -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/localized_products/bank_check_v1.md b/docs/localized_products/bank_check_v1.md deleted file mode 100644 index c470b870d..000000000 --- a/docs/localized_products/bank_check_v1.md +++ /dev/null @@ -1,205 +0,0 @@ ---- -title: US Bank Check -category: 622b805aaec68102ea7fcbc2 -slug: ruby-us-bank-check-ocr -parentDoc: 67b49e29a2cd6f08d69a40d8 ---- -The Ruby Client Library supports the [Bank Check API](https://platform.mindee.com/mindee/bank_check). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `bank_check` | -> | Recommended Version | `v1.1` | -> | Supports Polling/Webhooks | โŒ No | -> | Support Synchronous HTTP Calls | โœ”๏ธ Yes | -> | Geography | ๐Ÿ‡บ๐Ÿ‡ธ United States | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/bank_check/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Bank Check sample](https://github.com/mindee/client-lib-test-data/blob/main/products/bank_check/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::US::BankCheck::BankCheckV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: b9809586-57ae-4f84-a35d-a85b2be1f2a2 -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/bank_check v1.0 -:Rotation applied: Yes - -Prediction -========== -:Check Issue Date: 2022-03-29 -:Amount: 15332.90 -:Payees: JOHN DOE - JANE DOE -:Routing Number: -:Account Number: 7789778136 -:Check Number: 0003401 - -Page Predictions -================ - -Page 0 ------- -:Check Position: Polygon with 21 points. -:Signature Positions: Polygon with 6 points. -:Check Issue Date: 2022-03-29 -:Amount: 15332.90 -:Payees: JOHN DOE - JANE DOE -:Routing Number: -:Account Number: 7789778136 -:Check Number: 0003401 -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - - -### Amount Field -The amount field `AmountField` only has one constraint: its **value** is a `Float` (or `nil`). - -### Date Field -Aside from the basic `Field` attributes, the date field `DateField` also implements the following: - -* **date_object** (`Date`): an accessible representation of the value as a JavaScript object. - - -### Position Field -The position field `PositionField` does not implement all the basic `Field` attributes, only **bounding_box**, -**polygon** and **page_id**. On top of these, it has access to: - -* **rectangle** (`Mindee::Geometry::Quadrilateral`): a Polygon with four points that may be oriented (even beyond -canvas). -* **quadrangle** (`Mindee::Geometry::Quadrilateral`): a free polygon made up of four points. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -## Page-Level Fields -Some fields are constrained to the page level, and so will not be retrievable at document level. - -# Attributes -The following fields are extracted for Bank Check V1: - -## Account Number -**account_number** ([StringField](#string-field)): The check payer's account number. - -```rb -puts result.document.inference.prediction.account_number.value -``` - -## Amount -**amount** ([AmountField](#amount-field)): The amount of the check. - -```rb -puts result.document.inference.prediction.amount.value -``` - -## Check Number -**check_number** ([StringField](#string-field)): The issuer's check number. - -```rb -puts result.document.inference.prediction.check_number.value -``` - -## Check Position -[๐Ÿ“„](#page-level-fields "This field is only present on individual pages.")**check_position** ([PositionField](#position-field)): The position of the check on the document. - -```rb - result.document.check_position.each do |check_position_elem| - puts check_position_elem.polygon - end -``` - -## Check Issue Date -**date** ([DateField](#date-field)): The date the check was issued. - -```rb -puts result.document.inference.prediction.date.value -``` - -## Payees -**payees** (Array<[StringField](#string-field)>): List of the check's payees (recipients). - -```rb -result.document.inference.prediction.payees do |payees_elem| - puts payees_elem.value -end -``` - -## Routing Number -**routing_number** ([StringField](#string-field)): The check issuer's routing number. - -```rb -puts result.document.inference.prediction.routing_number.value -``` - -## Signature Positions -[๐Ÿ“„](#page-level-fields "This field is only present on individual pages.")**signatures_positions** (Array<[PositionField](#position-field)>): List of signature positions - -```rb - result.document.inference.pages do |page| - page.prediction.signatures_positions do |signatures_positions_elem| - puts signatures_positions_elem.polygon.to_s - puts signatures_positions_elem.quadrangle.to_s - puts signatures_positions_elem.rectangle.to_s - puts signatures_positions_elem.boundingBox.to_s - end - end -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/localized_products/bank_statement_fr_v2.md b/docs/localized_products/bank_statement_fr_v2.md deleted file mode 100644 index e7f6998f2..000000000 --- a/docs/localized_products/bank_statement_fr_v2.md +++ /dev/null @@ -1,269 +0,0 @@ ---- -title: FR Bank Statement -category: 622b805aaec68102ea7fcbc2 -slug: ruby-fr-bank-statement-ocr -parentDoc: 67b49e29a2cd6f08d69a40d8 ---- -The Ruby Client Library supports the [Bank Statement API](https://platform.mindee.com/mindee/bank_statement_fr). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `bank_statement_fr` | -> | Recommended Version | `v2.0` | -> | Supports Polling/Webhooks | โœ”๏ธ Yes | -> | Support Synchronous HTTP Calls | โŒ No | -> | Geography | ๐Ÿ‡ซ๐Ÿ‡ท France | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- | ------------- | -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/bank_statement_fr/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Bank Statement sample](https://github.com/mindee/client-lib-test-data/blob/main/products/bank_statement_fr/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::FR::BankStatement::BankStatementV2 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: 3c1811c0-9876-45ae-91ad-c2e9cd75dd83 -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/bank_statement_fr v2.0 -:Rotation applied: Yes - -Prediction -========== -:Account Number: XXXXXXXXXXXXXX -:Bank Name: Banque lafinancepourtous -:Bank Address: 1 rue de la Banque, 100210 Cassette -:Client Names: Karine Plume -:Client Address: 1 rue des Cigales, 100210 Cassette -:Statement Date: 2002-02-28 -:Statement Start Date: 2002-02-01 -:Statement End Date: 2002-02-28 -:Opening Balance: 22.15 -:Closing Balance: -278.96 -:Transactions: - +------------+------------+--------------------------------------+ - | Amount | Date | Description | - +============+============+======================================+ - | 1240.00 | 2002-02-01 | Virement salaire | - +------------+------------+--------------------------------------+ - | -520.00 | 2002-02-02 | Virement loyer | - +------------+------------+--------------------------------------+ - | -312.00 | 2002-02-03 | Dรฉbit Carte nยบxxxx | - +------------+------------+--------------------------------------+ - | 12.47 | 2002-02-04 | Virement CPAM | - +------------+------------+--------------------------------------+ - | 65.00 | 2002-02-05 | Virement APL | - +------------+------------+--------------------------------------+ - | -110.00 | 2002-02-07 | Dรฉbit Carte nxxxxxxxxxxxxxxxx | - +------------+------------+--------------------------------------+ - | -3.30 | 2002-02-08 | Cotisation mensuelle carte bancaire | - +------------+------------+--------------------------------------+ - | -120.00 | 2002-02-09 | Chรจque nยฐ xxxxxx98 | - +------------+------------+--------------------------------------+ - | -60.00 | 2002-02-09 | Retrait espรจces DAB | - +------------+------------+--------------------------------------+ - | -55.00 | 2002-02-15 | Chรจque nยฐ xxxxxx99 | - +------------+------------+--------------------------------------+ - | -80.00 | 2002-02-16 | Prรฉlรจvement supercrรฉdit | - +------------+------------+--------------------------------------+ - | -120.00 | 2002-02-17 | Chรจque nยฐ xxxxx 100 | - +------------+------------+--------------------------------------+ - | -163.25 | 2002-02-20 | Dรฉbit Carte nยบxxxxxxxxxxxxx | - +------------+------------+--------------------------------------+ - | -25.50 | 2002-02-21 | Dรฉbit Carte nยฐxxxxxxxxxxxxxxxxxx | - +------------+------------+--------------------------------------+ - | -30.00 | 2002-02-24 | Prรฉlรจvement Opรฉrateur tรฉlรฉphonique | - +------------+------------+--------------------------------------+ - | -6.53 | 2002-02-25 | Agios | - +------------+------------+--------------------------------------+ - | -13.00 | 2002-02-28 | Frais irrรฉgularitรฉs et incidents ... | - +------------+------------+--------------------------------------+ -:Total Debits: 1618.58 -:Total Credits: 1339.62 -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - - -### Amount Field -The amount field `AmountField` only has one constraint: its **value** is a `Float` (or `nil`). - -### Date Field -Aside from the basic `Field` attributes, the date field `DateField` also implements the following: - -* **date_object** (`Date`): an accessible representation of the value as a JavaScript object. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -## Specific Fields -Fields which are specific to this product; they are not used in any other product. - -### Transactions Field -The list of values that represent the financial transactions recorded in a bank statement. - -A `BankStatementV2Transaction` implements the following attributes: - -* `amount` (Float): The monetary amount of the transaction. -* `date` (String): The date on which the transaction occurred. -* `description` (String): The additional information about the transaction. - -# Attributes -The following fields are extracted for Bank Statement V2: - -## Account Number -**account_number** ([StringField](#string-field)): The unique identifier for a customer's account in the bank's system. - -```rb -puts result.document.inference.prediction.account_number.value -``` - -## Bank Address -**bank_address** ([StringField](#string-field)): The physical location of the bank where the statement was issued. - -```rb -puts result.document.inference.prediction.bank_address.value -``` - -## Bank Name -**bank_name** ([StringField](#string-field)): The name of the bank that issued the statement. - -```rb -puts result.document.inference.prediction.bank_name.value -``` - -## Client Address -**client_address** ([StringField](#string-field)): The address of the client associated with the bank statement. - -```rb -puts result.document.inference.prediction.client_address.value -``` - -## Client Names -**client_names** (Array<[StringField](#string-field)>): The name of the clients who own the bank statement. - -```rb -result.document.inference.prediction.client_names do |client_names_elem| - puts client_names_elem.value -end -``` - -## Closing Balance -**closing_balance** ([AmountField](#amount-field)): The final amount of money in the account at the end of the statement period. - -```rb -puts result.document.inference.prediction.closing_balance.value -``` - -## Opening Balance -**opening_balance** ([AmountField](#amount-field)): The initial amount of money in an account at the start of the period. - -```rb -puts result.document.inference.prediction.opening_balance.value -``` - -## Statement Date -**statement_date** ([DateField](#date-field)): The date on which the bank statement was generated. - -```rb -puts result.document.inference.prediction.statement_date.value -``` - -## Statement End Date -**statement_end_date** ([DateField](#date-field)): The date when the statement period ends. - -```rb -puts result.document.inference.prediction.statement_end_date.value -``` - -## Statement Start Date -**statement_start_date** ([DateField](#date-field)): The date when the bank statement period begins. - -```rb -puts result.document.inference.prediction.statement_start_date.value -``` - -## Total Credits -**total_credits** ([AmountField](#amount-field)): The total amount of money deposited into the account. - -```rb -puts result.document.inference.prediction.total_credits.value -``` - -## Total Debits -**total_debits** ([AmountField](#amount-field)): The total amount of money debited from the account. - -```rb -puts result.document.inference.prediction.total_debits.value -``` - -## Transactions -**transactions** (Array<[BankStatementV2Transaction](#transactions-field)>): The list of values that represent the financial transactions recorded in a bank statement. - -```rb -result.document.inference.prediction.transactions do |transactions_elem| - puts transactions_elem.value -end -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/localized_products/carte_grise_v1.md b/docs/localized_products/carte_grise_v1.md deleted file mode 100644 index 59c5ebada..000000000 --- a/docs/localized_products/carte_grise_v1.md +++ /dev/null @@ -1,475 +0,0 @@ ---- -title: FR Carte Grise -category: 622b805aaec68102ea7fcbc2 -slug: ruby-fr-carte-grise-ocr -parentDoc: 67b49e29a2cd6f08d69a40d8 ---- -The Ruby Client Library supports the [Carte Grise API](https://platform.mindee.com/mindee/carte_grise). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `carte_grise` | -> | Recommended Version | `v1.1` | -> | Supports Polling/Webhooks | โŒ No | -> | Support Synchronous HTTP Calls | โœ”๏ธ Yes | -> | Geography | ๐Ÿ‡ซ๐Ÿ‡ท France | - - -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 Ruby Client Library. -![Carte Grise sample](https://github.com/mindee/client-lib-test-data/blob/main/products/carte_grise/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::FR::CarteGrise::CarteGriseV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: 4443182b-57c1-4426-a288-01b94f226e84 -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/carte_grise v1.1 -:Rotation applied: Yes - -Prediction -========== -:a: AB-123-CD -:b: 1998-01-05 -:c1: DUPONT YVES -:c3: 27 RUE DES ROITELETS 59169 FERIN LES BAINS FRANCE -:c41: 2 DELAROCHE -:c4a: EST LE PROPRIETAIRE DU VEHICULE -:d1: -:d3: MODELE -:e: VFS1V2009AS1V2009 -:f1: 1915 -:f2: 1915 -:f3: 1915 -:g: 3030 -:g1: 1307 -:i: 2009-12-04 -:j: N1 -:j1: VP -:j2: AA -:j3: CI -:p1: 1900 -:p2: 90 -:p3: GO -:p6: 6 -:q: 006 -:s1: 5 -:s2: -:u1: 77 -:u2: 3000 -:v7: 155 -:x1: 2011-07-06 -:y1: 17835 -:y2: -:y3: 0 -:y4: 4 -:y5: 2.5 -:y6: 178.35 -:Formula Number: 2009AS05284 -:Owner's First Name: YVES -:Owner's Surname: DUPONT -:MRZ Line 1: -:MRZ Line 2: CI< ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `energy_bill_fra` | -> | Recommended Version | `v1.2` | -> | Supports Polling/Webhooks | โœ”๏ธ Yes | -> | Support Synchronous HTTP Calls | โŒ No | -> | Geography | ๐Ÿ‡ซ๐Ÿ‡ท France | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- | ------------- | -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - - -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 Ruby Client Library. -![Energy Bill sample](https://github.com/mindee/client-lib-test-data/blob/main/products/energy_bill_fra/default_sample.pdf?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::FR::EnergyBill::EnergyBillV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: ff1f2ca8-4d29-44d8-a564-599a982a4ef7 -:Filename: default_sample.pdf - -Inference -######### -:Product: mindee/energy_bill_fra v1.2 -:Rotation applied: Yes - -Prediction -========== -:Invoice Number: 1234567890 -:Contract ID: 9876543210 -:Delivery Point: 98765432109876 -:Invoice Date: 2021-01-29 -:Due Date: 2021-02-15 -:Total Before Taxes: 1241.03 -:Total Taxes: 238.82 -:Total Amount: 1479.85 -:Energy Supplier: - :Address: TSA 12345, 12345 DEMOCITY CEDEX - :Name: EDF -:Energy Consumer: - :Address: 123 RUE DE L'IMAGINAIRE, 75001 PARIS - :Name: JOHN DOE -:Subscription: - +--------------------------------------+------------+------------+----------+-----------+------------+ - | Description | End Date | Start Date | Tax Rate | Total | Unit Price | - +======================================+============+============+==========+===========+============+ - | Abonnement รฉlectricitรฉ | 2021-02-28 | 2021-01-01 | 5.50 | 59.00 | 29.50 | - +--------------------------------------+------------+------------+----------+-----------+------------+ -:Energy Usage: - +-------------+--------------------------------------+------------+------------+----------+-----------+-----------------+------------+ - | Consumption | Description | End Date | Start Date | Tax Rate | Total | Unit of Measure | Unit Price | - +=============+======================================+============+============+==========+===========+=================+============+ - | 8581.00 | Consommation รฉlectricitรฉ | 2021-01-27 | 2020-11-28 | 20.00 | 898.43 | kWh | 0.1047 | - +-------------+--------------------------------------+------------+------------+----------+-----------+-----------------+------------+ -:Taxes and Contributions: - +--------------------------------------+------------+------------+----------+-----------+------------+ - | Description | End Date | Start Date | Tax Rate | Total | Unit Price | - +======================================+============+============+==========+===========+============+ - | Contribution au Service Public de... | 2021-01-27 | 2020-11-28 | 20.00 | 193.07 | 0.0225 | - +--------------------------------------+------------+------------+----------+-----------+------------+ - | Taxe Dรฉpartementale sur la Conso ... | 2021-01-27 | 2020-11-28 | 20.00 | 13.98 | 0.003315 | - +--------------------------------------+------------+------------+----------+-----------+------------+ - | Taxe Communale sur la Conso Final... | 2021-01-27 | 2020-11-28 | 20.00 | 28.56 | 0.006545 | - +--------------------------------------+------------+------------+----------+-----------+------------+ - | Taxe Communale sur la Conso Final... | 2021-01-27 | 2020-11-28 | 20.00 | 27.96 | 0.00663 | - +--------------------------------------+------------+------------+----------+-----------+------------+ -:Meter Details: - :Meter Number: 620 - :Meter Type: electricity - :Unit of Power: 36kVA -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - - -### Amount Field -The amount field `AmountField` only has one constraint: its **value** is a `Float` (or `nil`). - -### Date Field -Aside from the basic `Field` attributes, the date field `DateField` also implements the following: - -* **date_object** (`Date`): an accessible representation of the value as a JavaScript object. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -## Specific Fields -Fields which are specific to this product; they are not used in any other product. - -### Energy Supplier Field -The company that supplies the energy. - -A `EnergyBillV1EnergySupplier` implements the following attributes: - -* `address` (String): The address of the energy supplier. -* `name` (String): The name of the energy supplier. -Fields which are specific to this product; they are not used in any other product. - -### Energy Consumer Field -The entity that consumes the energy. - -A `EnergyBillV1EnergyConsumer` implements the following attributes: - -* `address` (String): The address of the energy consumer. -* `name` (String): The name of the energy consumer. -Fields which are specific to this product; they are not used in any other product. - -### Subscription Field -The subscription details fee for the energy service. - -A `EnergyBillV1Subscription` implements the following attributes: - -* `description` (String): Description or details of the subscription. -* `end_date` (String): The end date of the subscription. -* `start_date` (String): The start date of the subscription. -* `tax_rate` (Float): The rate of tax applied to the total cost. -* `total` (Float): The total cost of subscription. -* `unit_price` (Float): The price per unit of subscription. -Fields which are specific to this product; they are not used in any other product. - -### Energy Usage Field -Details of energy consumption. - -A `EnergyBillV1EnergyUsage` implements the following attributes: - -* `consumption` (Float): The price per unit of energy consumed. -* `description` (String): Description or details of the energy usage. -* `end_date` (String): The end date of the energy usage. -* `start_date` (String): The start date of the energy usage. -* `tax_rate` (Float): The rate of tax applied to the total cost. -* `total` (Float): The total cost of energy consumed. -* `unit` (String): The unit of measurement for energy consumption. - -#### Possible values include: - - kWh - - m3 - - L - -* `unit_price` (Float): The price per unit of energy consumed. -Fields which are specific to this product; they are not used in any other product. - -### Taxes and Contributions Field -Details of Taxes and Contributions. - -A `EnergyBillV1TaxesAndContribution` implements the following attributes: - -* `description` (String): Description or details of the Taxes and Contributions. -* `end_date` (String): The end date of the Taxes and Contributions. -* `start_date` (String): The start date of the Taxes and Contributions. -* `tax_rate` (Float): The rate of tax applied to the total cost. -* `total` (Float): The total cost of Taxes and Contributions. -* `unit_price` (Float): The price per unit of Taxes and Contributions. -Fields which are specific to this product; they are not used in any other product. - -### Meter Details Field -Information about the energy meter. - -A `EnergyBillV1MeterDetail` implements the following attributes: - -* `meter_number` (String): The unique identifier of the energy meter. -* `meter_type` (String): The type of energy meter. - -#### Possible values include: - - electricity - - gas - - water - - None - -* `unit` (String): The unit of power for energy consumption. - -# Attributes -The following fields are extracted for Energy Bill V1: - -## Contract ID -**contract_id** ([StringField](#string-field)): The unique identifier associated with a specific contract. - -```rb -puts result.document.inference.prediction.contract_id.value -``` - -## Delivery Point -**delivery_point** ([StringField](#string-field)): The unique identifier assigned to each electricity or gas consumption point. It specifies the exact location where the energy is delivered. - -```rb -puts result.document.inference.prediction.delivery_point.value -``` - -## Due Date -**due_date** ([DateField](#date-field)): The date by which the payment for the energy invoice is due. - -```rb -puts result.document.inference.prediction.due_date.value -``` - -## Energy Consumer -**energy_consumer** ([EnergyBillV1EnergyConsumer](#energy-consumer-field)): The entity that consumes the energy. - -```rb -puts result.document.inference.prediction.energy_consumer.value -``` - -## Energy Supplier -**energy_supplier** ([EnergyBillV1EnergySupplier](#energy-supplier-field)): The company that supplies the energy. - -```rb -puts result.document.inference.prediction.energy_supplier.value -``` - -## Energy Usage -**energy_usage** (Array<[EnergyBillV1EnergyUsage](#energy-usage-field)>): Details of energy consumption. - -```rb -result.document.inference.prediction.energy_usage do |energy_usage_elem| - puts energy_usage_elem.value -end -``` - -## Invoice Date -**invoice_date** ([DateField](#date-field)): The date when the energy invoice was issued. - -```rb -puts result.document.inference.prediction.invoice_date.value -``` - -## Invoice Number -**invoice_number** ([StringField](#string-field)): The unique identifier of the energy invoice. - -```rb -puts result.document.inference.prediction.invoice_number.value -``` - -## Meter Details -**meter_details** ([EnergyBillV1MeterDetail](#meter-details-field)): Information about the energy meter. - -```rb -puts result.document.inference.prediction.meter_details.value -``` - -## Subscription -**subscription** (Array<[EnergyBillV1Subscription](#subscription-field)>): The subscription details fee for the energy service. - -```rb -result.document.inference.prediction.subscription do |subscription_elem| - puts subscription_elem.value -end -``` - -## Taxes and Contributions -**taxes_and_contributions** (Array<[EnergyBillV1TaxesAndContribution](#taxes-and-contributions-field)>): Details of Taxes and Contributions. - -```rb -result.document.inference.prediction.taxes_and_contributions do |taxes_and_contributions_elem| - puts taxes_and_contributions_elem.value -end -``` - -## Total Amount -**total_amount** ([AmountField](#amount-field)): The total amount to be paid for the energy invoice. - -```rb -puts result.document.inference.prediction.total_amount.value -``` - -## Total Before Taxes -**total_before_taxes** ([AmountField](#amount-field)): The total amount to be paid for the energy invoice before taxes. - -```rb -puts result.document.inference.prediction.total_before_taxes.value -``` - -## Total Taxes -**total_taxes** ([AmountField](#amount-field)): Total of taxes applied to the invoice. - -```rb -puts result.document.inference.prediction.total_taxes.value -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/localized_products/french_healthcard_v1.md b/docs/localized_products/french_healthcard_v1.md deleted file mode 100644 index 3f1c56a40..000000000 --- a/docs/localized_products/french_healthcard_v1.md +++ /dev/null @@ -1,142 +0,0 @@ ---- -title: FR Health Card -category: 622b805aaec68102ea7fcbc2 -slug: ruby-fr-health-card-ocr -parentDoc: 67b49e29a2cd6f08d69a40d8 ---- -The Ruby Client Library supports the [Health Card API](https://platform.mindee.com/mindee/french_healthcard). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `french_healthcard` | -> | Recommended Version | `v1.0` | -> | Supports Polling/Webhooks | โœ”๏ธ Yes | -> | Support Synchronous HTTP Calls | โŒ No | -> | Geography | ๐Ÿ‡ซ๐Ÿ‡ท France | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- | ------------- | -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - - -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 Ruby Client Library. -![Health Card sample](https://github.com/mindee/client-lib-test-data/blob/main/products/french_healthcard/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::FR::HealthCard::HealthCardV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: 9ee2733d-933a-4dcd-a73a-a31395e3b288 -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/french_healthcard v1.0 -:Rotation applied: Yes - -Prediction -========== -:Given Name(s): NATHALIE -:Surname: DURAND -:Social Security Number: 2 69 05 49 588 157 80 -:Issuance Date: 2007-01-01 -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - -### Date Field -Aside from the basic `Field` attributes, the date field `DateField` also implements the following: - -* **date_object** (`Date`): an accessible representation of the value as a JavaScript object. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -# Attributes -The following fields are extracted for Health Card V1: - -## Given Name(s) -**given_names** (Array<[StringField](#string-field)>): The given names of the card holder. - -```rb -result.document.inference.prediction.given_names do |given_names_elem| - puts given_names_elem.value -end -``` - -## Issuance Date -**issuance_date** ([DateField](#date-field)): The date when the carte vitale document was issued. - -```rb -puts result.document.inference.prediction.issuance_date.value -``` - -## Social Security Number -**social_security** ([StringField](#string-field)): The social security number of the card holder. - -```rb -puts result.document.inference.prediction.social_security.value -``` - -## Surname -**surname** ([StringField](#string-field)): The surname of the card holder. - -```rb -puts result.document.inference.prediction.surname.value -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/localized_products/idcard_fr_v2.md b/docs/localized_products/idcard_fr_v2.md deleted file mode 100644 index 97c4961d2..000000000 --- a/docs/localized_products/idcard_fr_v2.md +++ /dev/null @@ -1,284 +0,0 @@ ---- -title: FR Carte Nationale d'Identitรฉ -category: 622b805aaec68102ea7fcbc2 -slug: ruby-fr-carte-nationale-didentite-ocr -parentDoc: 67b49e29a2cd6f08d69a40d8 ---- -The Ruby Client Library supports the [Carte Nationale d'Identitรฉ API](https://platform.mindee.com/mindee/idcard_fr). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `idcard_fr` | -> | Recommended Version | `v2.0` | -> | Supports Polling/Webhooks | โŒ No | -> | Support Synchronous HTTP Calls | โœ”๏ธ Yes | -> | Geography | ๐Ÿ‡ซ๐Ÿ‡ท France | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/idcard_fr/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Carte Nationale d'Identitรฉ sample](https://github.com/mindee/client-lib-test-data/blob/main/products/idcard_fr/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::FR::IdCard::IdCardV2 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: d33828f1-ef7e-4984-b9df-a2bfaa38a78d -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/idcard_fr v2.0 -:Rotation applied: Yes - -Prediction -========== -:Nationality: -:Card Access Number: 175775H55790 -:Document Number: -:Given Name(s): Victor - Marie -:Surname: DAMBARD -:Alternate Name: -:Date of Birth: 1994-04-24 -:Place of Birth: LYON 4E ARRONDISSEM -:Gender: M -:Expiry Date: 2030-04-02 -:Mrz Line 1: IDFRADAMBARD<<<<<<<<<<<<<<<<<<075025 -:Mrz Line 2: 170775H557903VICTOR< Note: a classification field's `value is always a `String`. - -### Date Field -Aside from the basic `Field` attributes, the date field `DateField` also implements the following: - -* **date_object** (`Date`): an accessible representation of the value as a JavaScript object. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -## Page-Level Fields -Some fields are constrained to the page level, and so will not be retrievable at document level. - -# Attributes -The following fields are extracted for Carte Nationale d'Identitรฉ V2: - -## Alternate Name -**alternate_name** ([StringField](#string-field)): The alternate name of the card holder. - -```rb -puts result.document.inference.prediction.alternate_name.value -``` - -## Issuing Authority -**authority** ([StringField](#string-field)): The name of the issuing authority. - -```rb -puts result.document.inference.prediction.authority.value -``` - -## Date of Birth -**birth_date** ([DateField](#date-field)): The date of birth of the card holder. - -```rb -puts result.document.inference.prediction.birth_date.value -``` - -## Place of Birth -**birth_place** ([StringField](#string-field)): The place of birth of the card holder. - -```rb -puts result.document.inference.prediction.birth_place.value -``` - -## Card Access Number -**card_access_number** ([StringField](#string-field)): The card access number (CAN). - -```rb -puts result.document.inference.prediction.card_access_number.value -``` - -## Document Number -**document_number** ([StringField](#string-field)): The document number. - -```rb -puts result.document.inference.prediction.document_number.value -``` - -## Document Sides -[๐Ÿ“„](#page-level-fields "This field is only present on individual pages.")**document_side** ([ClassificationField](#classification-field)): The sides of the document which are visible. - -#### Possible values include: - - 'RECTO' - - 'VERSO' - - 'RECTO & VERSO' - -```rb - result.document.document_side.each do |document_side_elem| - puts document_side_elem.value - end -``` - -## Document Type -[๐Ÿ“„](#page-level-fields "This field is only present on individual pages.")**document_type** ([ClassificationField](#classification-field)): The document type or format. - -#### Possible values include: - - 'NEW' - - 'OLD' - -```rb - result.document.document_type.each do |document_type_elem| - puts document_type_elem.value - end -``` - -## Expiry Date -**expiry_date** ([DateField](#date-field)): The expiry date of the identification card. - -```rb -puts result.document.inference.prediction.expiry_date.value -``` - -## Gender -**gender** ([StringField](#string-field)): The gender of the card holder. - -```rb -puts result.document.inference.prediction.gender.value -``` - -## Given Name(s) -**given_names** (Array<[StringField](#string-field)>): The given name(s) of the card holder. - -```rb -result.document.inference.prediction.given_names do |given_names_elem| - puts given_names_elem.value -end -``` - -## Date of Issue -**issue_date** ([DateField](#date-field)): The date of issue of the identification card. - -```rb -puts result.document.inference.prediction.issue_date.value -``` - -## Mrz Line 1 -**mrz1** ([StringField](#string-field)): The Machine Readable Zone, first line. - -```rb -puts result.document.inference.prediction.mrz1.value -``` - -## Mrz Line 2 -**mrz2** ([StringField](#string-field)): The Machine Readable Zone, second line. - -```rb -puts result.document.inference.prediction.mrz2.value -``` - -## Mrz Line 3 -**mrz3** ([StringField](#string-field)): The Machine Readable Zone, third line. - -```rb -puts result.document.inference.prediction.mrz3.value -``` - -## Nationality -**nationality** ([StringField](#string-field)): The nationality of the card holder. - -```rb -puts result.document.inference.prediction.nationality.value -``` - -## Surname -**surname** ([StringField](#string-field)): The surname of the card holder. - -```rb -puts result.document.inference.prediction.surname.value -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/localized_products/ind_passport_v1.md b/docs/localized_products/ind_passport_v1.md deleted file mode 100644 index 8786e5d80..000000000 --- a/docs/localized_products/ind_passport_v1.md +++ /dev/null @@ -1,307 +0,0 @@ ---- -title: IND Passport - India -category: 622b805aaec68102ea7fcbc2 -slug: ruby-ind-passport---india-ocr -parentDoc: 67b49e29a2cd6f08d69a40d8 ---- -The Ruby Client Library supports the [Passport - India API](https://platform.mindee.com/mindee/ind_passport). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `ind_passport` | -> | Recommended Version | `v1.2` | -> | Supports Polling/Webhooks | โœ”๏ธ Yes | -> | Support Synchronous HTTP Calls | โŒ No | -> | Geography | ๐Ÿ‡ฎ๐Ÿ‡ณ India | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- | ------------- | -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - - -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 Ruby Client Library. -![Passport - India sample](https://github.com/mindee/client-lib-test-data/blob/main/products/ind_passport/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::IND::IndianPassport::IndianPassportV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: cf88fd43-eaa1-497a-ba29-a9569a4edaa7 -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/ind_passport v1.2 -:Rotation applied: Yes - -Prediction -========== -:Page Number: 1 -:Country: IND -:ID Number: J8369854 -:Given Names: JOCELYN MICHELLE -:Surname: DOE -:Birth Date: 1959-09-23 -:Birth Place: GUNDUGOLANU -:Issuance Place: HYDERABAD -:Gender: F -:Issuance Date: 2011-10-11 -:Expiry Date: 2021-10-10 -:MRZ Line 1: P Note: a classification field's `value is always a `String`. - -### Date Field -Aside from the basic `Field` attributes, the date field `DateField` also implements the following: - -* **date_object** (`Date`): an accessible representation of the value as a JavaScript object. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -# Attributes -The following fields are extracted for Passport - India V1: - -## Address Line 1 -**address1** ([StringField](#string-field)): The first line of the address of the passport holder. - -```rb -puts result.document.inference.prediction.address1.value -``` - -## Address Line 2 -**address2** ([StringField](#string-field)): The second line of the address of the passport holder. - -```rb -puts result.document.inference.prediction.address2.value -``` - -## Address Line 3 -**address3** ([StringField](#string-field)): The third line of the address of the passport holder. - -```rb -puts result.document.inference.prediction.address3.value -``` - -## Birth Date -**birth_date** ([DateField](#date-field)): The birth date of the passport holder, ISO format: YYYY-MM-DD. - -```rb -puts result.document.inference.prediction.birth_date.value -``` - -## Birth Place -**birth_place** ([StringField](#string-field)): The birth place of the passport holder. - -```rb -puts result.document.inference.prediction.birth_place.value -``` - -## Country -**country** ([StringField](#string-field)): ISO 3166-1 alpha-3 country code (3 letters format). - -```rb -puts result.document.inference.prediction.country.value -``` - -## Expiry Date -**expiry_date** ([DateField](#date-field)): The date when the passport will expire, ISO format: YYYY-MM-DD. - -```rb -puts result.document.inference.prediction.expiry_date.value -``` - -## File Number -**file_number** ([StringField](#string-field)): The file number of the passport document. - -```rb -puts result.document.inference.prediction.file_number.value -``` - -## Gender -**gender** ([ClassificationField](#classification-field)): The gender of the passport holder. - -#### Possible values include: - - 'M' - - 'F' - -```rb -puts result.document.inference.prediction.gender.value -``` - -## Given Names -**given_names** ([StringField](#string-field)): The given names of the passport holder. - -```rb -puts result.document.inference.prediction.given_names.value -``` - -## ID Number -**id_number** ([StringField](#string-field)): The identification number of the passport document. - -```rb -puts result.document.inference.prediction.id_number.value -``` - -## Issuance Date -**issuance_date** ([DateField](#date-field)): The date when the passport was issued, ISO format: YYYY-MM-DD. - -```rb -puts result.document.inference.prediction.issuance_date.value -``` - -## Issuance Place -**issuance_place** ([StringField](#string-field)): The place where the passport was issued. - -```rb -puts result.document.inference.prediction.issuance_place.value -``` - -## Legal Guardian -**legal_guardian** ([StringField](#string-field)): The name of the legal guardian of the passport holder (if applicable). - -```rb -puts result.document.inference.prediction.legal_guardian.value -``` - -## MRZ Line 1 -**mrz1** ([StringField](#string-field)): The first line of the machine-readable zone (MRZ) of the passport document. - -```rb -puts result.document.inference.prediction.mrz1.value -``` - -## MRZ Line 2 -**mrz2** ([StringField](#string-field)): The second line of the machine-readable zone (MRZ) of the passport document. - -```rb -puts result.document.inference.prediction.mrz2.value -``` - -## Name of Mother -**name_of_mother** ([StringField](#string-field)): The name of the mother of the passport holder. - -```rb -puts result.document.inference.prediction.name_of_mother.value -``` - -## Name of Spouse -**name_of_spouse** ([StringField](#string-field)): The name of the spouse of the passport holder (if applicable). - -```rb -puts result.document.inference.prediction.name_of_spouse.value -``` - -## Old Passport Date of Issue -**old_passport_date_of_issue** ([DateField](#date-field)): The date of issue of the old passport (if applicable), ISO format: YYYY-MM-DD. - -```rb -puts result.document.inference.prediction.old_passport_date_of_issue.value -``` - -## Old Passport Number -**old_passport_number** ([StringField](#string-field)): The number of the old passport (if applicable). - -```rb -puts result.document.inference.prediction.old_passport_number.value -``` - -## Old Passport Place of Issue -**old_passport_place_of_issue** ([StringField](#string-field)): The place of issue of the old passport (if applicable). - -```rb -puts result.document.inference.prediction.old_passport_place_of_issue.value -``` - -## Page Number -**page_number** ([ClassificationField](#classification-field)): The page number of the passport document. - -#### Possible values include: - - '1' - - '2' - -```rb -puts result.document.inference.prediction.page_number.value -``` - -## Surname -**surname** ([StringField](#string-field)): The surname of the passport holder. - -```rb -puts result.document.inference.prediction.surname.value -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/localized_products/payslip_fra_v3.md b/docs/localized_products/payslip_fra_v3.md deleted file mode 100644 index 8dea1f06c..000000000 --- a/docs/localized_products/payslip_fra_v3.md +++ /dev/null @@ -1,344 +0,0 @@ ---- -title: FR Payslip -category: 622b805aaec68102ea7fcbc2 -slug: ruby-fr-payslip-ocr -parentDoc: 67b49e29a2cd6f08d69a40d8 ---- -The Ruby Client Library supports the [Payslip API](https://platform.mindee.com/mindee/payslip_fra). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `payslip_fra` | -> | Recommended Version | `v3.0` | -> | Supports Polling/Webhooks | โœ”๏ธ Yes | -> | Support Synchronous HTTP Calls | โŒ No | -> | Geography | ๐Ÿ‡ซ๐Ÿ‡ท France | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- | ------------- | -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/payslip_fra/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Payslip sample](https://github.com/mindee/client-lib-test-data/blob/main/products/payslip_fra/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::FR::Payslip::PayslipV3 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: a479e3e7-6838-4e82-9a7d-99289f34ec7f -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/payslip_fra v3.0 -:Rotation applied: Yes - -Prediction -========== -:Pay Period: - :End Date: 2023-03-31 - :Month: 03 - :Payment Date: 2023-03-29 - :Start Date: 2023-03-01 - :Year: 2023 -:Employee: - :Address: 52 RUE DES FLEURS 33500 LIBOURNE FRANCE - :Date of Birth: - :First Name: Jean Luc - :Last Name: Picard - :Phone Number: - :Registration Number: - :Social Security Number: 123456789012345 -:Employer: - :Address: 1 RUE DU TONNOT 25210 DOUBS - :Company ID: 12345678901234 - :Company Site: - :NAF Code: 1234A - :Name: DEMO COMPANY - :Phone Number: - :URSSAF Number: -:Bank Account Details: - :Bank Name: - :IBAN: - :SWIFT: -:Employment: - :Category: Cadre - :Coefficient: 600,000 - :Collective Agreement: Construction -- Promotion - :Job Title: Directeur Rรฉgional du Dรฉveloppement - :Position Level: Niveau 5 Echelon 3 - :Seniority Date: - :Start Date: 2022-05-01 -:Salary Details: - +--------------+-----------+--------------------------------------+--------+-----------+ - | Amount | Base | Description | Number | Rate | - +==============+===========+======================================+========+===========+ - | 6666.67 | | Salaire de base | | | - +--------------+-----------+--------------------------------------+--------+-----------+ - | 9.30 | | Part patronale Mutuelle NR | | | - +--------------+-----------+--------------------------------------+--------+-----------+ - | 508.30 | | Avantages en nature voiture | | | - +--------------+-----------+--------------------------------------+--------+-----------+ -:Pay Detail: - :Gross Salary: 7184.27 - :Gross Salary YTD: 18074.81 - :Income Tax Rate: 17.60 - :Income Tax Withheld: 1030.99 - :Net Paid: 3868.32 - :Net Paid Before Tax: 4899.31 - :Net Taxable: 5857.90 - :Net Taxable YTD: 14752.73 - :Total Cost Employer: 10486.94 - :Total Taxes and Deductions: 1650.36 -:Paid Time Off: - +-----------+--------+-------------+-----------+-----------+ - | Accrued | Period | Type | Remaining | Used | - +===========+========+=============+===========+===========+ - | | N-1 | VACATION | | | - +-----------+--------+-------------+-----------+-----------+ - | 6.17 | N | VACATION | 6.17 | | - +-----------+--------+-------------+-----------+-----------+ - | 2.01 | N | RTT | 2.01 | | - +-----------+--------+-------------+-----------+-----------+ -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - -## Specific Fields -Fields which are specific to this product; they are not used in any other product. - -### Pay Period Field -Information about the pay period. - -A `PayslipV3PayPeriod` implements the following attributes: - -* `end_date` (String): The end date of the pay period. -* `month` (String): The month of the pay period. -* `payment_date` (String): The date of payment for the pay period. -* `start_date` (String): The start date of the pay period. -* `year` (String): The year of the pay period. -Fields which are specific to this product; they are not used in any other product. - -### Employee Field -Information about the employee. - -A `PayslipV3Employee` implements the following attributes: - -* `address` (String): The address of the employee. -* `date_of_birth` (String): The date of birth of the employee. -* `first_name` (String): The first name of the employee. -* `last_name` (String): The last name of the employee. -* `phone_number` (String): The phone number of the employee. -* `registration_number` (String): The registration number of the employee. -* `social_security_number` (String): The social security number of the employee. -Fields which are specific to this product; they are not used in any other product. - -### Employer Field -Information about the employer. - -A `PayslipV3Employer` implements the following attributes: - -* `address` (String): The address of the employer. -* `company_id` (String): The company ID of the employer. -* `company_site` (String): The site of the company. -* `naf_code` (String): The NAF code of the employer. -* `name` (String): The name of the employer. -* `phone_number` (String): The phone number of the employer. -* `urssaf_number` (String): The URSSAF number of the employer. -Fields which are specific to this product; they are not used in any other product. - -### Bank Account Details Field -Information about the employee's bank account. - -A `PayslipV3BankAccountDetail` implements the following attributes: - -* `bank_name` (String): The name of the bank. -* `iban` (String): The IBAN of the bank account. -* `swift` (String): The SWIFT code of the bank. -Fields which are specific to this product; they are not used in any other product. - -### Employment Field -Information about the employment. - -A `PayslipV3Employment` implements the following attributes: - -* `category` (String): The category of the employment. -* `coefficient` (String): The coefficient of the employment. -* `collective_agreement` (String): The collective agreement of the employment. -* `job_title` (String): The job title of the employee. -* `position_level` (String): The position level of the employment. -* `seniority_date` (String): The seniority date of the employment. -* `start_date` (String): The start date of the employment. -Fields which are specific to this product; they are not used in any other product. - -### Salary Details Field -Detailed information about the earnings. - -A `PayslipV3SalaryDetail` implements the following attributes: - -* `amount` (Float): The amount of the earning. -* `base` (Float): The base rate value of the earning. -* `description` (String): The description of the earnings. -* `number` (Float): The number of units in the earning. -* `rate` (Float): The rate of the earning. -Fields which are specific to this product; they are not used in any other product. - -### Pay Detail Field -Detailed information about the pay. - -A `PayslipV3PayDetail` implements the following attributes: - -* `gross_salary` (Float): The gross salary of the employee. -* `gross_salary_ytd` (Float): The year-to-date gross salary of the employee. -* `income_tax_rate` (Float): The income tax rate of the employee. -* `income_tax_withheld` (Float): The income tax withheld from the employee's pay. -* `net_paid` (Float): The net paid amount of the employee. -* `net_paid_before_tax` (Float): The net paid amount before tax of the employee. -* `net_taxable` (Float): The net taxable amount of the employee. -* `net_taxable_ytd` (Float): The year-to-date net taxable amount of the employee. -* `total_cost_employer` (Float): The total cost to the employer. -* `total_taxes_and_deductions` (Float): The total taxes and deductions of the employee. -Fields which are specific to this product; they are not used in any other product. - -### Paid Time Off Field -Information about paid time off. - -A `PayslipV3PaidTimeOff` implements the following attributes: - -* `accrued` (Float): The amount of paid time off accrued in the period. -* `period` (String): The paid time off period. - -#### Possible values include: - - N - - N-1 - - N-2 - -* `pto_type` (String): The type of paid time off. - -#### Possible values include: - - VACATION - - RTT - - COMPENSATORY - -* `remaining` (Float): The remaining amount of paid time off at the end of the period. -* `used` (Float): The amount of paid time off used in the period. - -# Attributes -The following fields are extracted for Payslip V3: - -## Bank Account Details -**bank_account_details** ([PayslipV3BankAccountDetail](#bank-account-details-field)): Information about the employee's bank account. - -```rb -puts result.document.inference.prediction.bank_account_details.value -``` - -## Employee -**employee** ([PayslipV3Employee](#employee-field)): Information about the employee. - -```rb -puts result.document.inference.prediction.employee.value -``` - -## Employer -**employer** ([PayslipV3Employer](#employer-field)): Information about the employer. - -```rb -puts result.document.inference.prediction.employer.value -``` - -## Employment -**employment** ([PayslipV3Employment](#employment-field)): Information about the employment. - -```rb -puts result.document.inference.prediction.employment.value -``` - -## Paid Time Off -**paid_time_off** (Array<[PayslipV3PaidTimeOff](#paid-time-off-field)>): Information about paid time off. - -```rb -result.document.inference.prediction.paid_time_off do |paid_time_off_elem| - puts paid_time_off_elem.value -end -``` - -## Pay Detail -**pay_detail** ([PayslipV3PayDetail](#pay-detail-field)): Detailed information about the pay. - -```rb -puts result.document.inference.prediction.pay_detail.value -``` - -## Pay Period -**pay_period** ([PayslipV3PayPeriod](#pay-period-field)): Information about the pay period. - -```rb -puts result.document.inference.prediction.pay_period.value -``` - -## Salary Details -**salary_details** (Array<[PayslipV3SalaryDetail](#salary-details-field)>): Detailed information about the earnings. - -```rb -result.document.inference.prediction.salary_details do |salary_details_elem| - puts salary_details_elem.value -end -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/localized_products/us_healthcare_cards_v1.md b/docs/localized_products/us_healthcare_cards_v1.md deleted file mode 100644 index 4ac8155e3..000000000 --- a/docs/localized_products/us_healthcare_cards_v1.md +++ /dev/null @@ -1,258 +0,0 @@ ---- -title: US Healthcare Card -category: 622b805aaec68102ea7fcbc2 -slug: ruby-us-healthcare-card-ocr -parentDoc: 67b49e29a2cd6f08d69a40d8 ---- -The Ruby Client Library supports the [Healthcare Card API](https://platform.mindee.com/mindee/us_healthcare_cards). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `us_healthcare_cards` | -> | Recommended Version | `v1.3` | -> | Supports Polling/Webhooks | โœ”๏ธ Yes | -> | Support Synchronous HTTP Calls | โŒ No | -> | Geography | ๐Ÿ‡บ๐Ÿ‡ธ United States | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- | ------------- | -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/us_healthcare_cards/default_sample.jpg), -we are going to illustrate how to extract the data that we want using the Ruby Client Library. -![Healthcare Card sample](https://github.com/mindee/client-lib-test-data/blob/main/products/us_healthcare_cards/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::US::HealthcareCard::HealthcareCardV1 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: 5e917fc8-5c13-42b2-967f-954f4eed9959 -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/us_healthcare_cards v1.3 -:Rotation applied: Yes - -Prediction -========== -:Company Name: UnitedHealthcare -:Plan Name: Choice Plus -:Member Name: SUBSCRIBER SMITH -:Member ID: 123456789 -:Issuer 80840: -:Dependents: SPOUSE SMITH - CHILD1 SMITH - CHILD2 SMITH - CHILD3 SMITH -:Group Number: 98765 -:Payer ID: 87726 -:RX BIN: 610279 -:RX ID: -:RX GRP: UHEALTH -:RX PCN: 9999 -:Copays: - +--------------+----------------------+ - | Service Fees | Service Name | - +==============+======================+ - | 20.00 | office_visit | - +--------------+----------------------+ - | 300.00 | emergency_room | - +--------------+----------------------+ - | 75.00 | urgent_care | - +--------------+----------------------+ - | 30.00 | specialist | - +--------------+----------------------+ -:Enrollment Date: -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - -### Date Field -Aside from the basic `Field` attributes, the date field `DateField` also implements the following: - -* **date_object** (`Date`): an accessible representation of the value as a JavaScript object. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -## Specific Fields -Fields which are specific to this product; they are not used in any other product. - -### Copays Field -Copayments for covered services. - -A `HealthcareCardV1Copay` implements the following attributes: - -* `service_fees` (Float): The price of the service. -* `service_name` (String): The name of the service. - -#### Possible values include: - - primary_care - - emergency_room - - urgent_care - - specialist - - office_visit - - prescription - - -# Attributes -The following fields are extracted for Healthcare Card V1: - -## Company Name -**company_name** ([StringField](#string-field)): The name of the company that provides the healthcare plan. - -```rb -puts result.document.inference.prediction.company_name.value -``` - -## Copays -**copays** (Array<[HealthcareCardV1Copay](#copays-field)>): Copayments for covered services. - -```rb -result.document.inference.prediction.copays do |copays_elem| - puts copays_elem.value -end -``` - -## Dependents -**dependents** (Array<[StringField](#string-field)>): The list of dependents covered by the healthcare plan. - -```rb -result.document.inference.prediction.dependents do |dependents_elem| - puts dependents_elem.value -end -``` - -## Enrollment Date -**enrollment_date** ([DateField](#date-field)): The date when the member enrolled in the healthcare plan. - -```rb -puts result.document.inference.prediction.enrollment_date.value -``` - -## Group Number -**group_number** ([StringField](#string-field)): The group number associated with the healthcare plan. - -```rb -puts result.document.inference.prediction.group_number.value -``` - -## Issuer 80840 -**issuer80840** ([StringField](#string-field)): The organization that issued the healthcare plan. - -```rb -puts result.document.inference.prediction.issuer80840.value -``` - -## Member ID -**member_id** ([StringField](#string-field)): The unique identifier for the member in the healthcare system. - -```rb -puts result.document.inference.prediction.member_id.value -``` - -## Member Name -**member_name** ([StringField](#string-field)): The name of the member covered by the healthcare plan. - -```rb -puts result.document.inference.prediction.member_name.value -``` - -## Payer ID -**payer_id** ([StringField](#string-field)): The unique identifier for the payer in the healthcare system. - -```rb -puts result.document.inference.prediction.payer_id.value -``` - -## Plan Name -**plan_name** ([StringField](#string-field)): The name of the healthcare plan. - -```rb -puts result.document.inference.prediction.plan_name.value -``` - -## RX BIN -**rx_bin** ([StringField](#string-field)): The BIN number for prescription drug coverage. - -```rb -puts result.document.inference.prediction.rx_bin.value -``` - -## RX GRP -**rx_grp** ([StringField](#string-field)): The group number for prescription drug coverage. - -```rb -puts result.document.inference.prediction.rx_grp.value -``` - -## RX ID -**rx_id** ([StringField](#string-field)): The ID number for prescription drug coverage. - -```rb -puts result.document.inference.prediction.rx_id.value -``` - -## RX PCN -**rx_pcn** ([StringField](#string-field)): The PCN number for prescription drug coverage. - -```rb -puts result.document.inference.prediction.rx_pcn.value -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/localized_products/us_mail_v3.md b/docs/localized_products/us_mail_v3.md deleted file mode 100644 index fa8f3cf2c..000000000 --- a/docs/localized_products/us_mail_v3.md +++ /dev/null @@ -1,152 +0,0 @@ ---- -title: US US Mail -category: 622b805aaec68102ea7fcbc2 -slug: ruby-us-us-mail-ocr -parentDoc: 67b49e29a2cd6f08d69a40d8 ---- -The Ruby Client Library supports the [US Mail API](https://platform.mindee.com/mindee/us_mail). - - -> ๐Ÿ“ Product Specs -> -> | Specification | Details | -> | ------------------------------ | -------------------------------------------------- | -> | Endpoint Name | `us_mail` | -> | Recommended Version | `v3.0` | -> | Supports Polling/Webhooks | โœ”๏ธ Yes | -> | Support Synchronous HTTP Calls | โŒ No | -> | Geography | ๐Ÿ‡บ๐Ÿ‡ธ United States | - -> ๐Ÿ” Polling Limitations -> -> | Setting | Parameter name | Default Value | -> | ------------------------------- | ----------------------- | ------------- | -> | Initial Delay Before Polling | `initial_delay_seconds` | 2 seconds | -> | Default Delay Between Calls | `delay_sec` | 1.5 seconds | -> | Polling Attempts Before Timeout | `max_retries` | 80 retries | - - -The [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/us_mail/default_sample.jpg) can be used for testing purposes. -![US Mail sample](https://github.com/mindee/client-lib-test-data/blob/main/products/us_mail/default_sample.jpg?raw=true) - -# Quick-Start -```rb -# -# Install the Ruby client library by running: -# gem install mindee -# - -require 'mindee' - -# Init a new client -mindee_client = Mindee::Client.new(api_key: 'my-api-key') - -# Load a file from disk -input_source = mindee_client.source_from_path('/path/to/the/file.ext') - -# Parse the file -result = mindee_client.parse( - input_source, - Mindee::Product::US::UsMail::UsMailV3 -) - -# Print a full summary of the parsed data in RST format -puts result.document - -# Print the document-level parsed data -# puts result.document.inference.prediction -``` -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### Basic Field -Each prediction object contains a set of fields that inherit from the generic `Field` class. -A typical `Field` object will have the following attributes: - -* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted. -* **confidence** (Float, nil): the confidence score of the field prediction. -* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image. -* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level. -* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it). - - -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. - -### String Field -The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`). - -## Specific Fields -Fields which are specific to this product; they are not used in any other product. - -### Sender Address Field -The address of the sender. - -A `UsMailV3SenderAddress` implements the following attributes: - -* `city` (String): The city of the sender's address. -* `complete` (String): The complete address of the sender. -* `postal_code` (String): The postal code of the sender's address. -* `state` (String): Second part of the ISO 3166-2 code, consisting of two letters indicating the US State. -* `street` (String): The street of the sender's address. -Fields which are specific to this product; they are not used in any other product. - -### Recipient Addresses Field -The addresses of the recipients. - -A `UsMailV3RecipientAddress` implements the following attributes: - -* `city` (String): The city of the recipient's address. -* `complete` (String): The complete address of the recipient. -* `is_address_change` (bool): Indicates if the recipient's address is a change of address. -* `postal_code` (String): The postal code of the recipient's address. -* `private_mailbox_number` (String): The private mailbox number of the recipient's address. -* `state` (String): Second part of the ISO 3166-2 code, consisting of two letters indicating the US State. -* `street` (String): The street of the recipient's address. -* `unit` (String): The unit number of the recipient's address. - -# Attributes -The following fields are extracted for US Mail V3: - -## Return to Sender -**is_return_to_sender** ([BooleanField](#boolean-field)): Whether the mailing is marked as return to sender. - -```rb -puts result.document.inference.prediction.is_return_to_sender.value -``` - -## Recipient Addresses -**recipient_addresses** (Array<[UsMailV3RecipientAddress](#recipient-addresses-field)>): The addresses of the recipients. - -```rb -result.document.inference.prediction.recipient_addresses do |recipient_addresses_elem| - puts recipient_addresses_elem.value -end -``` - -## Recipient Names -**recipient_names** (Array<[StringField](#string-field)>): The names of the recipients. - -```rb -result.document.inference.prediction.recipient_names do |recipient_names_elem| - puts recipient_names_elem.value -end -``` - -## Sender Address -**sender_address** ([UsMailV3SenderAddress](#sender-address-field)): The address of the sender. - -```rb -puts result.document.inference.prediction.sender_address.value -``` - -## Sender Name -**sender_name** ([StringField](#string-field)): The name of the sender. - -```rb -puts result.document.inference.prediction.sender_name.value -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/lib/mindee/version.rb b/lib/mindee/version.rb index badab6d77..27017852c 100644 --- a/lib/mindee/version.rb +++ b/lib/mindee/version.rb @@ -3,7 +3,7 @@ # Mindee module Mindee # Current version. - VERSION = '4.7.2' + VERSION = '4.8.0' # Finds and return the current platform. # @return [Symbol, Hash[String | Symbol, Regexp], Nil?]