From 5acc90c7495c01d69e2b9796b9cb64798c9c7597 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Tue, 18 Nov 2025 17:29:55 +0100 Subject: [PATCH 1/2] :recycle: uniformize tests with other libs --- .../java/com/mindee/{ => v1}/MindeeClientTest.java | 4 +++- .../mindee/{ => v1}/extraction/ImageExtractorTest.java | 2 +- .../extraction/InvoiceSplitterAutoExtractionIT.java | 2 +- .../mindee/{ => v1}/extraction/PDFExtractorTest.java | 2 +- .../parsing/common/AsyncPredictResponseTest.java | 2 +- .../mindee/{ => v1}/parsing/common/CropperTest.java | 2 +- .../com/mindee/{ => v1}/parsing/common/ErrorTest.java | 2 +- .../{ => v1}/parsing/common/FullTextOcrTest.java | 2 +- .../com/mindee/{ => v1}/parsing/common/OcrTest.java | 2 +- .../parsing/custom/lineitems/FakeListField.java | 2 +- .../parsing/custom/lineitems/LineGeneratorTest.java | 2 +- .../{ => v1}/parsing/standard/DateFieldTest.java | 2 +- .../product/barcodereader/BarcodeReaderV1Test.java | 2 +- .../product/billoflading/BillOfLadingV1Test.java | 2 +- .../product/businesscard/BusinessCardV1Test.java | 2 +- .../mindee/{ => v1}/product/cropper/CropperV1Test.java | 2 +- .../mindee/{ => v1}/product/custom/CustomV1Test.java | 2 +- .../product/custom/CustomV1WithLineItemsTest.java | 2 +- .../product/deliverynote/DeliveryNoteV1Test.java | 2 +- .../product/driverlicense/DriverLicenseV1Test.java | 2 +- .../financialdocument/FinancialDocumentV1Test.java | 2 +- .../bankaccountdetails/BankAccountDetailsV1Test.java | 2 +- .../bankaccountdetails/BankAccountDetailsV2Test.java | 2 +- .../product/fr/cartegrise/CarteGriseV1Test.java | 2 +- .../product/fr/energybill/EnergyBillV1Test.java | 2 +- .../product/fr/healthcard/HealthCardV1Test.java | 2 +- .../{ => v1}/product/fr/idcard/IdCardV1Test.java | 2 +- .../{ => v1}/product/fr/idcard/IdCardV2Test.java | 2 +- .../{ => v1}/product/fr/payslip/PayslipV2Test.java | 2 +- .../{ => v1}/product/fr/payslip/PayslipV3Test.java | 2 +- .../{ => v1}/product/generated/GeneratedV1Test.java | 2 +- .../ind/indianpassport/IndianPassportV1Test.java | 2 +- .../product/internationalid/InternationalIdV2Test.java | 2 +- .../mindee/{ => v1}/product/invoice/InvoiceV4Test.java | 2 +- .../product/invoicesplitter/InvoiceSplitterV1Test.java | 2 +- .../MultiReceiptsDetectorV1Test.java | 2 +- .../nutritionfactslabel/NutritionFactsLabelV1Test.java | 2 +- .../{ => v1}/product/passport/PassportV1Test.java | 2 +- .../mindee/{ => v1}/product/receipt/ReceiptV5Test.java | 2 +- .../mindee/{ => v1}/product/resume/ResumeV1Test.java | 2 +- .../{ => v1}/product/us/bankcheck/BankCheckV1Test.java | 2 +- .../us/healthcarecard/HealthcareCardV1Test.java | 2 +- .../{ => v1}/product/us/usmail/UsMailV3Test.java | 2 +- .../java/com/mindee/{ => v2}/MindeeClientV2IT.java | 5 ++++- .../java/com/mindee/{ => v2}/MindeeClientV2Test.java | 4 +++- .../{parsing/v2 => v2/parsing}/InferenceTest.java | 10 +++++++++- .../com/mindee/{parsing/v2 => v2/parsing}/JobTest.java | 5 ++++- src/test/resources | 2 +- 48 files changed, 66 insertions(+), 48 deletions(-) rename src/test/java/com/mindee/{ => v1}/MindeeClientTest.java (99%) rename src/test/java/com/mindee/{ => v1}/extraction/ImageExtractorTest.java (99%) rename src/test/java/com/mindee/{ => v1}/extraction/InvoiceSplitterAutoExtractionIT.java (99%) rename src/test/java/com/mindee/{ => v1}/extraction/PDFExtractorTest.java (98%) rename src/test/java/com/mindee/{ => v1}/parsing/common/AsyncPredictResponseTest.java (99%) rename src/test/java/com/mindee/{ => v1}/parsing/common/CropperTest.java (97%) rename src/test/java/com/mindee/{ => v1}/parsing/common/ErrorTest.java (97%) rename src/test/java/com/mindee/{ => v1}/parsing/common/FullTextOcrTest.java (98%) rename src/test/java/com/mindee/{ => v1}/parsing/common/OcrTest.java (98%) rename src/test/java/com/mindee/{ => v1}/parsing/custom/lineitems/FakeListField.java (99%) rename src/test/java/com/mindee/{ => v1}/parsing/custom/lineitems/LineGeneratorTest.java (98%) rename src/test/java/com/mindee/{ => v1}/parsing/standard/DateFieldTest.java (95%) rename src/test/java/com/mindee/{ => v1}/product/barcodereader/BarcodeReaderV1Test.java (97%) rename src/test/java/com/mindee/{ => v1}/product/billoflading/BillOfLadingV1Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/businesscard/BusinessCardV1Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/cropper/CropperV1Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/custom/CustomV1Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/custom/CustomV1WithLineItemsTest.java (98%) rename src/test/java/com/mindee/{ => v1}/product/deliverynote/DeliveryNoteV1Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/driverlicense/DriverLicenseV1Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/financialdocument/FinancialDocumentV1Test.java (99%) rename src/test/java/com/mindee/{ => v1}/product/fr/bankaccountdetails/BankAccountDetailsV1Test.java (97%) rename src/test/java/com/mindee/{ => v1}/product/fr/bankaccountdetails/BankAccountDetailsV2Test.java (97%) rename src/test/java/com/mindee/{ => v1}/product/fr/cartegrise/CarteGriseV1Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/fr/energybill/EnergyBillV1Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/fr/healthcard/HealthCardV1Test.java (97%) rename src/test/java/com/mindee/{ => v1}/product/fr/idcard/IdCardV1Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/fr/idcard/IdCardV2Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/fr/payslip/PayslipV2Test.java (99%) rename src/test/java/com/mindee/{ => v1}/product/fr/payslip/PayslipV3Test.java (99%) rename src/test/java/com/mindee/{ => v1}/product/generated/GeneratedV1Test.java (99%) rename src/test/java/com/mindee/{ => v1}/product/ind/indianpassport/IndianPassportV1Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/internationalid/InternationalIdV2Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/invoice/InvoiceV4Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/invoicesplitter/InvoiceSplitterV1Test.java (97%) rename src/test/java/com/mindee/{ => v1}/product/multireceiptsdetector/MultiReceiptsDetectorV1Test.java (97%) rename src/test/java/com/mindee/{ => v1}/product/nutritionfactslabel/NutritionFactsLabelV1Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/passport/PassportV1Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/receipt/ReceiptV5Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/resume/ResumeV1Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/us/bankcheck/BankCheckV1Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/us/healthcarecard/HealthcareCardV1Test.java (98%) rename src/test/java/com/mindee/{ => v1}/product/us/usmail/UsMailV3Test.java (98%) rename src/test/java/com/mindee/{ => v2}/MindeeClientV2IT.java (97%) rename src/test/java/com/mindee/{ => v2}/MindeeClientV2Test.java (98%) rename src/test/java/com/mindee/{parsing/v2 => v2/parsing}/InferenceTest.java (98%) rename src/test/java/com/mindee/{parsing/v2 => v2/parsing}/JobTest.java (92%) diff --git a/src/test/java/com/mindee/MindeeClientTest.java b/src/test/java/com/mindee/v1/MindeeClientTest.java similarity index 99% rename from src/test/java/com/mindee/MindeeClientTest.java rename to src/test/java/com/mindee/v1/MindeeClientTest.java index 3884959a6..9809f18cd 100644 --- a/src/test/java/com/mindee/MindeeClientTest.java +++ b/src/test/java/com/mindee/v1/MindeeClientTest.java @@ -1,5 +1,7 @@ -package com.mindee; +package com.mindee.v1; +import com.mindee.MindeeClient; +import com.mindee.PredictOptions; import com.mindee.http.Endpoint; import com.mindee.input.LocalResponse; import com.mindee.input.LocalInputSource; diff --git a/src/test/java/com/mindee/extraction/ImageExtractorTest.java b/src/test/java/com/mindee/v1/extraction/ImageExtractorTest.java similarity index 99% rename from src/test/java/com/mindee/extraction/ImageExtractorTest.java rename to src/test/java/com/mindee/v1/extraction/ImageExtractorTest.java index bb8df9ad0..af0d6810f 100644 --- a/src/test/java/com/mindee/extraction/ImageExtractorTest.java +++ b/src/test/java/com/mindee/v1/extraction/ImageExtractorTest.java @@ -1,4 +1,4 @@ -package com.mindee.extraction; +package com.mindee.v1.extraction; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/extraction/InvoiceSplitterAutoExtractionIT.java b/src/test/java/com/mindee/v1/extraction/InvoiceSplitterAutoExtractionIT.java similarity index 99% rename from src/test/java/com/mindee/extraction/InvoiceSplitterAutoExtractionIT.java rename to src/test/java/com/mindee/v1/extraction/InvoiceSplitterAutoExtractionIT.java index d8e5ac61f..5a22e332a 100644 --- a/src/test/java/com/mindee/extraction/InvoiceSplitterAutoExtractionIT.java +++ b/src/test/java/com/mindee/v1/extraction/InvoiceSplitterAutoExtractionIT.java @@ -1,4 +1,4 @@ -package com.mindee.extraction; +package com.mindee.v1.extraction; import static com.mindee.TestingUtilities.getV1ResourcePath; import static com.mindee.TestingUtilities.levenshteinRatio; diff --git a/src/test/java/com/mindee/extraction/PDFExtractorTest.java b/src/test/java/com/mindee/v1/extraction/PDFExtractorTest.java similarity index 98% rename from src/test/java/com/mindee/extraction/PDFExtractorTest.java rename to src/test/java/com/mindee/v1/extraction/PDFExtractorTest.java index 846b55919..1c1846efb 100644 --- a/src/test/java/com/mindee/extraction/PDFExtractorTest.java +++ b/src/test/java/com/mindee/v1/extraction/PDFExtractorTest.java @@ -1,4 +1,4 @@ -package com.mindee.extraction; +package com.mindee.v1.extraction; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/parsing/common/AsyncPredictResponseTest.java b/src/test/java/com/mindee/v1/parsing/common/AsyncPredictResponseTest.java similarity index 99% rename from src/test/java/com/mindee/parsing/common/AsyncPredictResponseTest.java rename to src/test/java/com/mindee/v1/parsing/common/AsyncPredictResponseTest.java index 4f2a828db..3a965a53d 100644 --- a/src/test/java/com/mindee/parsing/common/AsyncPredictResponseTest.java +++ b/src/test/java/com/mindee/v1/parsing/common/AsyncPredictResponseTest.java @@ -1,4 +1,4 @@ -package com.mindee.parsing.common; +package com.mindee.v1.parsing.common; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JavaType; diff --git a/src/test/java/com/mindee/parsing/common/CropperTest.java b/src/test/java/com/mindee/v1/parsing/common/CropperTest.java similarity index 97% rename from src/test/java/com/mindee/parsing/common/CropperTest.java rename to src/test/java/com/mindee/v1/parsing/common/CropperTest.java index 9b99bc2f0..1260364b9 100644 --- a/src/test/java/com/mindee/parsing/common/CropperTest.java +++ b/src/test/java/com/mindee/v1/parsing/common/CropperTest.java @@ -1,4 +1,4 @@ -package com.mindee.parsing.common; +package com.mindee.v1.parsing.common; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/parsing/common/ErrorTest.java b/src/test/java/com/mindee/v1/parsing/common/ErrorTest.java similarity index 97% rename from src/test/java/com/mindee/parsing/common/ErrorTest.java rename to src/test/java/com/mindee/v1/parsing/common/ErrorTest.java index 9462d1090..323c4ef2b 100644 --- a/src/test/java/com/mindee/parsing/common/ErrorTest.java +++ b/src/test/java/com/mindee/v1/parsing/common/ErrorTest.java @@ -1,4 +1,4 @@ -package com.mindee.parsing.common; +package com.mindee.v1.parsing.common; import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.Assertions; diff --git a/src/test/java/com/mindee/parsing/common/FullTextOcrTest.java b/src/test/java/com/mindee/v1/parsing/common/FullTextOcrTest.java similarity index 98% rename from src/test/java/com/mindee/parsing/common/FullTextOcrTest.java rename to src/test/java/com/mindee/v1/parsing/common/FullTextOcrTest.java index 94e5382fc..3f6ef059f 100644 --- a/src/test/java/com/mindee/parsing/common/FullTextOcrTest.java +++ b/src/test/java/com/mindee/v1/parsing/common/FullTextOcrTest.java @@ -1,4 +1,4 @@ -package com.mindee.parsing.common; +package com.mindee.v1.parsing.common; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/parsing/common/OcrTest.java b/src/test/java/com/mindee/v1/parsing/common/OcrTest.java similarity index 98% rename from src/test/java/com/mindee/parsing/common/OcrTest.java rename to src/test/java/com/mindee/v1/parsing/common/OcrTest.java index e8b0df446..be3cf9d2c 100644 --- a/src/test/java/com/mindee/parsing/common/OcrTest.java +++ b/src/test/java/com/mindee/v1/parsing/common/OcrTest.java @@ -1,4 +1,4 @@ -package com.mindee.parsing.common; +package com.mindee.v1.parsing.common; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/parsing/custom/lineitems/FakeListField.java b/src/test/java/com/mindee/v1/parsing/custom/lineitems/FakeListField.java similarity index 99% rename from src/test/java/com/mindee/parsing/custom/lineitems/FakeListField.java rename to src/test/java/com/mindee/v1/parsing/custom/lineitems/FakeListField.java index 505089ab4..fa7afaea5 100644 --- a/src/test/java/com/mindee/parsing/custom/lineitems/FakeListField.java +++ b/src/test/java/com/mindee/v1/parsing/custom/lineitems/FakeListField.java @@ -1,4 +1,4 @@ -package com.mindee.parsing.custom.lineitems; +package com.mindee.v1.parsing.custom.lineitems; import java.util.Arrays; import java.util.HashMap; diff --git a/src/test/java/com/mindee/parsing/custom/lineitems/LineGeneratorTest.java b/src/test/java/com/mindee/v1/parsing/custom/lineitems/LineGeneratorTest.java similarity index 98% rename from src/test/java/com/mindee/parsing/custom/lineitems/LineGeneratorTest.java rename to src/test/java/com/mindee/v1/parsing/custom/lineitems/LineGeneratorTest.java index f340e1393..4c867096e 100644 --- a/src/test/java/com/mindee/parsing/custom/lineitems/LineGeneratorTest.java +++ b/src/test/java/com/mindee/v1/parsing/custom/lineitems/LineGeneratorTest.java @@ -1,4 +1,4 @@ -package com.mindee.parsing.custom.lineitems; +package com.mindee.v1.parsing.custom.lineitems; import java.util.Arrays; import java.util.Collection; diff --git a/src/test/java/com/mindee/parsing/standard/DateFieldTest.java b/src/test/java/com/mindee/v1/parsing/standard/DateFieldTest.java similarity index 95% rename from src/test/java/com/mindee/parsing/standard/DateFieldTest.java rename to src/test/java/com/mindee/v1/parsing/standard/DateFieldTest.java index 5303b545a..d0a7c64d5 100644 --- a/src/test/java/com/mindee/parsing/standard/DateFieldTest.java +++ b/src/test/java/com/mindee/v1/parsing/standard/DateFieldTest.java @@ -1,4 +1,4 @@ -package com.mindee.parsing.standard; +package com.mindee.v1.parsing.standard; import com.mindee.geometry.Point; import com.mindee.geometry.Polygon; diff --git a/src/test/java/com/mindee/product/barcodereader/BarcodeReaderV1Test.java b/src/test/java/com/mindee/v1/product/barcodereader/BarcodeReaderV1Test.java similarity index 97% rename from src/test/java/com/mindee/product/barcodereader/BarcodeReaderV1Test.java rename to src/test/java/com/mindee/v1/product/barcodereader/BarcodeReaderV1Test.java index bb1a005df..1717ba0d5 100644 --- a/src/test/java/com/mindee/product/barcodereader/BarcodeReaderV1Test.java +++ b/src/test/java/com/mindee/v1/product/barcodereader/BarcodeReaderV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.barcodereader; +package com.mindee.v1.product.barcodereader; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/billoflading/BillOfLadingV1Test.java b/src/test/java/com/mindee/v1/product/billoflading/BillOfLadingV1Test.java similarity index 98% rename from src/test/java/com/mindee/product/billoflading/BillOfLadingV1Test.java rename to src/test/java/com/mindee/v1/product/billoflading/BillOfLadingV1Test.java index e7da3ec0f..065540d3f 100644 --- a/src/test/java/com/mindee/product/billoflading/BillOfLadingV1Test.java +++ b/src/test/java/com/mindee/v1/product/billoflading/BillOfLadingV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.billoflading; +package com.mindee.v1.product.billoflading; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/businesscard/BusinessCardV1Test.java b/src/test/java/com/mindee/v1/product/businesscard/BusinessCardV1Test.java similarity index 98% rename from src/test/java/com/mindee/product/businesscard/BusinessCardV1Test.java rename to src/test/java/com/mindee/v1/product/businesscard/BusinessCardV1Test.java index c85a003e8..cf55ef39b 100644 --- a/src/test/java/com/mindee/product/businesscard/BusinessCardV1Test.java +++ b/src/test/java/com/mindee/v1/product/businesscard/BusinessCardV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.businesscard; +package com.mindee.v1.product.businesscard; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/cropper/CropperV1Test.java b/src/test/java/com/mindee/v1/product/cropper/CropperV1Test.java similarity index 98% rename from src/test/java/com/mindee/product/cropper/CropperV1Test.java rename to src/test/java/com/mindee/v1/product/cropper/CropperV1Test.java index 35b127aed..9075d084f 100644 --- a/src/test/java/com/mindee/product/cropper/CropperV1Test.java +++ b/src/test/java/com/mindee/v1/product/cropper/CropperV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.cropper; +package com.mindee.v1.product.cropper; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/custom/CustomV1Test.java b/src/test/java/com/mindee/v1/product/custom/CustomV1Test.java similarity index 98% rename from src/test/java/com/mindee/product/custom/CustomV1Test.java rename to src/test/java/com/mindee/v1/product/custom/CustomV1Test.java index 04c1e6d11..7859d2503 100644 --- a/src/test/java/com/mindee/product/custom/CustomV1Test.java +++ b/src/test/java/com/mindee/v1/product/custom/CustomV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.custom; +package com.mindee.v1.product.custom; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/custom/CustomV1WithLineItemsTest.java b/src/test/java/com/mindee/v1/product/custom/CustomV1WithLineItemsTest.java similarity index 98% rename from src/test/java/com/mindee/product/custom/CustomV1WithLineItemsTest.java rename to src/test/java/com/mindee/v1/product/custom/CustomV1WithLineItemsTest.java index 685026da5..5aa569e16 100644 --- a/src/test/java/com/mindee/product/custom/CustomV1WithLineItemsTest.java +++ b/src/test/java/com/mindee/v1/product/custom/CustomV1WithLineItemsTest.java @@ -1,4 +1,4 @@ -package com.mindee.product.custom; +package com.mindee.v1.product.custom; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/deliverynote/DeliveryNoteV1Test.java b/src/test/java/com/mindee/v1/product/deliverynote/DeliveryNoteV1Test.java similarity index 98% rename from src/test/java/com/mindee/product/deliverynote/DeliveryNoteV1Test.java rename to src/test/java/com/mindee/v1/product/deliverynote/DeliveryNoteV1Test.java index 21ecd105a..eedf204e4 100644 --- a/src/test/java/com/mindee/product/deliverynote/DeliveryNoteV1Test.java +++ b/src/test/java/com/mindee/v1/product/deliverynote/DeliveryNoteV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.deliverynote; +package com.mindee.v1.product.deliverynote; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/driverlicense/DriverLicenseV1Test.java b/src/test/java/com/mindee/v1/product/driverlicense/DriverLicenseV1Test.java similarity index 98% rename from src/test/java/com/mindee/product/driverlicense/DriverLicenseV1Test.java rename to src/test/java/com/mindee/v1/product/driverlicense/DriverLicenseV1Test.java index 2b06b50b5..e1ab7eb10 100644 --- a/src/test/java/com/mindee/product/driverlicense/DriverLicenseV1Test.java +++ b/src/test/java/com/mindee/v1/product/driverlicense/DriverLicenseV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.driverlicense; +package com.mindee.v1.product.driverlicense; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/financialdocument/FinancialDocumentV1Test.java b/src/test/java/com/mindee/v1/product/financialdocument/FinancialDocumentV1Test.java similarity index 99% rename from src/test/java/com/mindee/product/financialdocument/FinancialDocumentV1Test.java rename to src/test/java/com/mindee/v1/product/financialdocument/FinancialDocumentV1Test.java index 7a377a51c..0aadf948d 100644 --- a/src/test/java/com/mindee/product/financialdocument/FinancialDocumentV1Test.java +++ b/src/test/java/com/mindee/v1/product/financialdocument/FinancialDocumentV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.financialdocument; +package com.mindee.v1.product.financialdocument; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/fr/bankaccountdetails/BankAccountDetailsV1Test.java b/src/test/java/com/mindee/v1/product/fr/bankaccountdetails/BankAccountDetailsV1Test.java similarity index 97% rename from src/test/java/com/mindee/product/fr/bankaccountdetails/BankAccountDetailsV1Test.java rename to src/test/java/com/mindee/v1/product/fr/bankaccountdetails/BankAccountDetailsV1Test.java index 056121529..6ae81225b 100644 --- a/src/test/java/com/mindee/product/fr/bankaccountdetails/BankAccountDetailsV1Test.java +++ b/src/test/java/com/mindee/v1/product/fr/bankaccountdetails/BankAccountDetailsV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.fr.bankaccountdetails; +package com.mindee.v1.product.fr.bankaccountdetails; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/fr/bankaccountdetails/BankAccountDetailsV2Test.java b/src/test/java/com/mindee/v1/product/fr/bankaccountdetails/BankAccountDetailsV2Test.java similarity index 97% rename from src/test/java/com/mindee/product/fr/bankaccountdetails/BankAccountDetailsV2Test.java rename to src/test/java/com/mindee/v1/product/fr/bankaccountdetails/BankAccountDetailsV2Test.java index 792977c69..319a4ad62 100644 --- a/src/test/java/com/mindee/product/fr/bankaccountdetails/BankAccountDetailsV2Test.java +++ b/src/test/java/com/mindee/v1/product/fr/bankaccountdetails/BankAccountDetailsV2Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.fr.bankaccountdetails; +package com.mindee.v1.product.fr.bankaccountdetails; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/fr/cartegrise/CarteGriseV1Test.java b/src/test/java/com/mindee/v1/product/fr/cartegrise/CarteGriseV1Test.java similarity index 98% rename from src/test/java/com/mindee/product/fr/cartegrise/CarteGriseV1Test.java rename to src/test/java/com/mindee/v1/product/fr/cartegrise/CarteGriseV1Test.java index cadb3bf57..23ec462a1 100644 --- a/src/test/java/com/mindee/product/fr/cartegrise/CarteGriseV1Test.java +++ b/src/test/java/com/mindee/v1/product/fr/cartegrise/CarteGriseV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.fr.cartegrise; +package com.mindee.v1.product.fr.cartegrise; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/fr/energybill/EnergyBillV1Test.java b/src/test/java/com/mindee/v1/product/fr/energybill/EnergyBillV1Test.java similarity index 98% rename from src/test/java/com/mindee/product/fr/energybill/EnergyBillV1Test.java rename to src/test/java/com/mindee/v1/product/fr/energybill/EnergyBillV1Test.java index b7ee102db..5650a6575 100644 --- a/src/test/java/com/mindee/product/fr/energybill/EnergyBillV1Test.java +++ b/src/test/java/com/mindee/v1/product/fr/energybill/EnergyBillV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.fr.energybill; +package com.mindee.v1.product.fr.energybill; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/fr/healthcard/HealthCardV1Test.java b/src/test/java/com/mindee/v1/product/fr/healthcard/HealthCardV1Test.java similarity index 97% rename from src/test/java/com/mindee/product/fr/healthcard/HealthCardV1Test.java rename to src/test/java/com/mindee/v1/product/fr/healthcard/HealthCardV1Test.java index 1171d1c41..e73eaead5 100644 --- a/src/test/java/com/mindee/product/fr/healthcard/HealthCardV1Test.java +++ b/src/test/java/com/mindee/v1/product/fr/healthcard/HealthCardV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.fr.healthcard; +package com.mindee.v1.product.fr.healthcard; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/fr/idcard/IdCardV1Test.java b/src/test/java/com/mindee/v1/product/fr/idcard/IdCardV1Test.java similarity index 98% rename from src/test/java/com/mindee/product/fr/idcard/IdCardV1Test.java rename to src/test/java/com/mindee/v1/product/fr/idcard/IdCardV1Test.java index 66bdd7493..ee2e5b26f 100644 --- a/src/test/java/com/mindee/product/fr/idcard/IdCardV1Test.java +++ b/src/test/java/com/mindee/v1/product/fr/idcard/IdCardV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.fr.idcard; +package com.mindee.v1.product.fr.idcard; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/fr/idcard/IdCardV2Test.java b/src/test/java/com/mindee/v1/product/fr/idcard/IdCardV2Test.java similarity index 98% rename from src/test/java/com/mindee/product/fr/idcard/IdCardV2Test.java rename to src/test/java/com/mindee/v1/product/fr/idcard/IdCardV2Test.java index 473ed7eb2..af18c4f58 100644 --- a/src/test/java/com/mindee/product/fr/idcard/IdCardV2Test.java +++ b/src/test/java/com/mindee/v1/product/fr/idcard/IdCardV2Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.fr.idcard; +package com.mindee.v1.product.fr.idcard; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/fr/payslip/PayslipV2Test.java b/src/test/java/com/mindee/v1/product/fr/payslip/PayslipV2Test.java similarity index 99% rename from src/test/java/com/mindee/product/fr/payslip/PayslipV2Test.java rename to src/test/java/com/mindee/v1/product/fr/payslip/PayslipV2Test.java index fe88d2608..91535e20b 100644 --- a/src/test/java/com/mindee/product/fr/payslip/PayslipV2Test.java +++ b/src/test/java/com/mindee/v1/product/fr/payslip/PayslipV2Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.fr.payslip; +package com.mindee.v1.product.fr.payslip; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/fr/payslip/PayslipV3Test.java b/src/test/java/com/mindee/v1/product/fr/payslip/PayslipV3Test.java similarity index 99% rename from src/test/java/com/mindee/product/fr/payslip/PayslipV3Test.java rename to src/test/java/com/mindee/v1/product/fr/payslip/PayslipV3Test.java index 8a4c973d8..3fde3714b 100644 --- a/src/test/java/com/mindee/product/fr/payslip/PayslipV3Test.java +++ b/src/test/java/com/mindee/v1/product/fr/payslip/PayslipV3Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.fr.payslip; +package com.mindee.v1.product.fr.payslip; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/generated/GeneratedV1Test.java b/src/test/java/com/mindee/v1/product/generated/GeneratedV1Test.java similarity index 99% rename from src/test/java/com/mindee/product/generated/GeneratedV1Test.java rename to src/test/java/com/mindee/v1/product/generated/GeneratedV1Test.java index da28e1f46..20b51d96e 100644 --- a/src/test/java/com/mindee/product/generated/GeneratedV1Test.java +++ b/src/test/java/com/mindee/v1/product/generated/GeneratedV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.generated; +package com.mindee.v1.product.generated; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/ind/indianpassport/IndianPassportV1Test.java b/src/test/java/com/mindee/v1/product/ind/indianpassport/IndianPassportV1Test.java similarity index 98% rename from src/test/java/com/mindee/product/ind/indianpassport/IndianPassportV1Test.java rename to src/test/java/com/mindee/v1/product/ind/indianpassport/IndianPassportV1Test.java index 6c11bd93e..0e091ca2b 100644 --- a/src/test/java/com/mindee/product/ind/indianpassport/IndianPassportV1Test.java +++ b/src/test/java/com/mindee/v1/product/ind/indianpassport/IndianPassportV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.ind.indianpassport; +package com.mindee.v1.product.ind.indianpassport; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/internationalid/InternationalIdV2Test.java b/src/test/java/com/mindee/v1/product/internationalid/InternationalIdV2Test.java similarity index 98% rename from src/test/java/com/mindee/product/internationalid/InternationalIdV2Test.java rename to src/test/java/com/mindee/v1/product/internationalid/InternationalIdV2Test.java index b6998950b..9d83036fc 100644 --- a/src/test/java/com/mindee/product/internationalid/InternationalIdV2Test.java +++ b/src/test/java/com/mindee/v1/product/internationalid/InternationalIdV2Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.internationalid; +package com.mindee.v1.product.internationalid; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/invoice/InvoiceV4Test.java b/src/test/java/com/mindee/v1/product/invoice/InvoiceV4Test.java similarity index 98% rename from src/test/java/com/mindee/product/invoice/InvoiceV4Test.java rename to src/test/java/com/mindee/v1/product/invoice/InvoiceV4Test.java index 27b0482ca..6160b6994 100644 --- a/src/test/java/com/mindee/product/invoice/InvoiceV4Test.java +++ b/src/test/java/com/mindee/v1/product/invoice/InvoiceV4Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.invoice; +package com.mindee.v1.product.invoice; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/invoicesplitter/InvoiceSplitterV1Test.java b/src/test/java/com/mindee/v1/product/invoicesplitter/InvoiceSplitterV1Test.java similarity index 97% rename from src/test/java/com/mindee/product/invoicesplitter/InvoiceSplitterV1Test.java rename to src/test/java/com/mindee/v1/product/invoicesplitter/InvoiceSplitterV1Test.java index ec601e93b..39d5286a7 100644 --- a/src/test/java/com/mindee/product/invoicesplitter/InvoiceSplitterV1Test.java +++ b/src/test/java/com/mindee/v1/product/invoicesplitter/InvoiceSplitterV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.invoicesplitter; +package com.mindee.v1.product.invoicesplitter; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/multireceiptsdetector/MultiReceiptsDetectorV1Test.java b/src/test/java/com/mindee/v1/product/multireceiptsdetector/MultiReceiptsDetectorV1Test.java similarity index 97% rename from src/test/java/com/mindee/product/multireceiptsdetector/MultiReceiptsDetectorV1Test.java rename to src/test/java/com/mindee/v1/product/multireceiptsdetector/MultiReceiptsDetectorV1Test.java index 8dd6174fa..8c5b1cee1 100644 --- a/src/test/java/com/mindee/product/multireceiptsdetector/MultiReceiptsDetectorV1Test.java +++ b/src/test/java/com/mindee/v1/product/multireceiptsdetector/MultiReceiptsDetectorV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.multireceiptsdetector; +package com.mindee.v1.product.multireceiptsdetector; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/nutritionfactslabel/NutritionFactsLabelV1Test.java b/src/test/java/com/mindee/v1/product/nutritionfactslabel/NutritionFactsLabelV1Test.java similarity index 98% rename from src/test/java/com/mindee/product/nutritionfactslabel/NutritionFactsLabelV1Test.java rename to src/test/java/com/mindee/v1/product/nutritionfactslabel/NutritionFactsLabelV1Test.java index fca4db33c..6fb6676eb 100644 --- a/src/test/java/com/mindee/product/nutritionfactslabel/NutritionFactsLabelV1Test.java +++ b/src/test/java/com/mindee/v1/product/nutritionfactslabel/NutritionFactsLabelV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.nutritionfactslabel; +package com.mindee.v1.product.nutritionfactslabel; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/passport/PassportV1Test.java b/src/test/java/com/mindee/v1/product/passport/PassportV1Test.java similarity index 98% rename from src/test/java/com/mindee/product/passport/PassportV1Test.java rename to src/test/java/com/mindee/v1/product/passport/PassportV1Test.java index d2f0befc5..53c46dcbc 100644 --- a/src/test/java/com/mindee/product/passport/PassportV1Test.java +++ b/src/test/java/com/mindee/v1/product/passport/PassportV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.passport; +package com.mindee.v1.product.passport; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/receipt/ReceiptV5Test.java b/src/test/java/com/mindee/v1/product/receipt/ReceiptV5Test.java similarity index 98% rename from src/test/java/com/mindee/product/receipt/ReceiptV5Test.java rename to src/test/java/com/mindee/v1/product/receipt/ReceiptV5Test.java index ba8ba24e6..2f70bad88 100644 --- a/src/test/java/com/mindee/product/receipt/ReceiptV5Test.java +++ b/src/test/java/com/mindee/v1/product/receipt/ReceiptV5Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.receipt; +package com.mindee.v1.product.receipt; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/resume/ResumeV1Test.java b/src/test/java/com/mindee/v1/product/resume/ResumeV1Test.java similarity index 98% rename from src/test/java/com/mindee/product/resume/ResumeV1Test.java rename to src/test/java/com/mindee/v1/product/resume/ResumeV1Test.java index 9df0abf02..56ee91ce4 100644 --- a/src/test/java/com/mindee/product/resume/ResumeV1Test.java +++ b/src/test/java/com/mindee/v1/product/resume/ResumeV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.resume; +package com.mindee.v1.product.resume; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/us/bankcheck/BankCheckV1Test.java b/src/test/java/com/mindee/v1/product/us/bankcheck/BankCheckV1Test.java similarity index 98% rename from src/test/java/com/mindee/product/us/bankcheck/BankCheckV1Test.java rename to src/test/java/com/mindee/v1/product/us/bankcheck/BankCheckV1Test.java index 8a39a8296..772606951 100644 --- a/src/test/java/com/mindee/product/us/bankcheck/BankCheckV1Test.java +++ b/src/test/java/com/mindee/v1/product/us/bankcheck/BankCheckV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.us.bankcheck; +package com.mindee.v1.product.us.bankcheck; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/us/healthcarecard/HealthcareCardV1Test.java b/src/test/java/com/mindee/v1/product/us/healthcarecard/HealthcareCardV1Test.java similarity index 98% rename from src/test/java/com/mindee/product/us/healthcarecard/HealthcareCardV1Test.java rename to src/test/java/com/mindee/v1/product/us/healthcarecard/HealthcareCardV1Test.java index 3c15f9097..08a784270 100644 --- a/src/test/java/com/mindee/product/us/healthcarecard/HealthcareCardV1Test.java +++ b/src/test/java/com/mindee/v1/product/us/healthcarecard/HealthcareCardV1Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.us.healthcarecard; +package com.mindee.v1.product.us.healthcarecard; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/product/us/usmail/UsMailV3Test.java b/src/test/java/com/mindee/v1/product/us/usmail/UsMailV3Test.java similarity index 98% rename from src/test/java/com/mindee/product/us/usmail/UsMailV3Test.java rename to src/test/java/com/mindee/v1/product/us/usmail/UsMailV3Test.java index 67e772dc4..4e0aad2c6 100644 --- a/src/test/java/com/mindee/product/us/usmail/UsMailV3Test.java +++ b/src/test/java/com/mindee/v1/product/us/usmail/UsMailV3Test.java @@ -1,4 +1,4 @@ -package com.mindee.product.us.usmail; +package com.mindee.v1.product.us.usmail; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/test/java/com/mindee/MindeeClientV2IT.java b/src/test/java/com/mindee/v2/MindeeClientV2IT.java similarity index 97% rename from src/test/java/com/mindee/MindeeClientV2IT.java rename to src/test/java/com/mindee/v2/MindeeClientV2IT.java index 624f997a9..bbaee4c92 100644 --- a/src/test/java/com/mindee/MindeeClientV2IT.java +++ b/src/test/java/com/mindee/v2/MindeeClientV2IT.java @@ -1,5 +1,8 @@ -package com.mindee; +package com.mindee.v2; +import com.mindee.AsyncPollingOptions; +import com.mindee.InferenceParameters; +import com.mindee.MindeeClientV2; import com.mindee.http.MindeeHttpExceptionV2; import com.mindee.input.LocalInputSource; import com.mindee.input.URLInputSource; diff --git a/src/test/java/com/mindee/MindeeClientV2Test.java b/src/test/java/com/mindee/v2/MindeeClientV2Test.java similarity index 98% rename from src/test/java/com/mindee/MindeeClientV2Test.java rename to src/test/java/com/mindee/v2/MindeeClientV2Test.java index b0a8b1b85..bb254b896 100644 --- a/src/test/java/com/mindee/MindeeClientV2Test.java +++ b/src/test/java/com/mindee/v2/MindeeClientV2Test.java @@ -1,7 +1,9 @@ -package com.mindee; +package com.mindee.v2; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import com.mindee.InferenceParameters; +import com.mindee.MindeeClientV2; import com.mindee.http.MindeeApiV2; import com.mindee.input.LocalInputSource; import com.mindee.input.LocalResponse; diff --git a/src/test/java/com/mindee/parsing/v2/InferenceTest.java b/src/test/java/com/mindee/v2/parsing/InferenceTest.java similarity index 98% rename from src/test/java/com/mindee/parsing/v2/InferenceTest.java rename to src/test/java/com/mindee/v2/parsing/InferenceTest.java index 2c82d9626..9319ff94b 100644 --- a/src/test/java/com/mindee/parsing/v2/InferenceTest.java +++ b/src/test/java/com/mindee/v2/parsing/InferenceTest.java @@ -1,8 +1,16 @@ -package com.mindee.parsing.v2; +package com.mindee.v2.parsing; import com.mindee.geometry.Point; import com.mindee.geometry.Polygon; import com.mindee.input.LocalResponse; +import com.mindee.parsing.v2.Inference; +import com.mindee.parsing.v2.InferenceActiveOptions; +import com.mindee.parsing.v2.InferenceFile; +import com.mindee.parsing.v2.InferenceModel; +import com.mindee.parsing.v2.InferenceResponse; +import com.mindee.parsing.v2.RagMetadata; +import com.mindee.parsing.v2.RawText; +import com.mindee.parsing.v2.RawTextPage; import com.mindee.parsing.v2.field.DynamicField; import com.mindee.parsing.v2.field.FieldConfidence; import com.mindee.parsing.v2.field.FieldLocation; diff --git a/src/test/java/com/mindee/parsing/v2/JobTest.java b/src/test/java/com/mindee/v2/parsing/JobTest.java similarity index 92% rename from src/test/java/com/mindee/parsing/v2/JobTest.java rename to src/test/java/com/mindee/v2/parsing/JobTest.java index bec940ac2..196476472 100644 --- a/src/test/java/com/mindee/parsing/v2/JobTest.java +++ b/src/test/java/com/mindee/v2/parsing/JobTest.java @@ -1,6 +1,9 @@ -package com.mindee.parsing.v2; +package com.mindee.v2.parsing; import com.mindee.input.LocalResponse; +import com.mindee.parsing.v2.ErrorResponse; +import com.mindee.parsing.v2.Job; +import com.mindee.parsing.v2.JobResponse; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; diff --git a/src/test/resources b/src/test/resources index 7d843db01..b0d725b71 160000 --- a/src/test/resources +++ b/src/test/resources @@ -1 +1 @@ -Subproject commit 7d843db01df952740d0f2d39f62fc3efb86f92bb +Subproject commit b0d725b71784a45db611c325739320b6c192b7e5 From f554d6eddbd994713ff40d613ce89d16404ac398 Mon Sep 17 00:00:00 2001 From: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> Date: Tue, 18 Nov 2025 17:30:23 +0100 Subject: [PATCH 2/2] remove deprecated doc --- docs/bank_account_details_v2.md | 165 -------- docs/bank_check_v1.md | 216 ---------- docs/barcode_reader_v1.md | 134 ------ docs/bill_of_lading_v1.md | 276 ------------- docs/business_card_v1.md | 194 --------- docs/carte_grise_v1.md | 482 ---------------------- docs/cropper_v1.md | 130 ------ docs/custom_v1.md | 134 ------ docs/delivery_notes_v1.md | 167 -------- docs/driver_license_v1.md | 211 ---------- docs/energy_bill_fra_v1.md | 344 ---------------- docs/expense_receipts_v5.md | 433 -------------------- docs/financial_document_v1.md | 627 ----------------------------- docs/french_healthcard_v1.md | 142 ------- docs/generated_v1.md | 106 ----- docs/getting_started.md | 346 ---------------- docs/idcard_fr_v2.md | 297 -------------- docs/ind_passport_v1.md | 307 -------------- docs/international_id_v2.md | 266 ------------ docs/invoice_splitter_v1.md | 125 ------ docs/invoices_v4.md | 588 --------------------------- docs/java-field.md | 87 ---- docs/multi_receipts_detector_v1.md | 137 ------- docs/nutrition_facts_v1.md | 397 ------------------ docs/passport_v1.md | 215 ---------- docs/payslip_fra_v3.md | 343 ---------------- docs/resume_v1.md | 393 ------------------ docs/us_healthcare_cards_v1.md | 259 ------------ docs/us_mail_v3.md | 191 --------- 29 files changed, 7712 deletions(-) delete mode 100644 docs/bank_account_details_v2.md delete mode 100644 docs/bank_check_v1.md delete mode 100644 docs/barcode_reader_v1.md delete mode 100644 docs/bill_of_lading_v1.md delete mode 100644 docs/business_card_v1.md delete mode 100644 docs/carte_grise_v1.md delete mode 100644 docs/cropper_v1.md delete mode 100644 docs/custom_v1.md delete mode 100644 docs/delivery_notes_v1.md delete mode 100644 docs/driver_license_v1.md delete mode 100644 docs/energy_bill_fra_v1.md delete mode 100644 docs/expense_receipts_v5.md delete mode 100644 docs/financial_document_v1.md delete mode 100644 docs/french_healthcard_v1.md delete mode 100644 docs/generated_v1.md delete mode 100644 docs/getting_started.md delete mode 100644 docs/idcard_fr_v2.md delete mode 100644 docs/ind_passport_v1.md delete mode 100644 docs/international_id_v2.md delete mode 100644 docs/invoice_splitter_v1.md delete mode 100644 docs/invoices_v4.md delete mode 100644 docs/java-field.md delete mode 100644 docs/multi_receipts_detector_v1.md delete mode 100644 docs/nutrition_facts_v1.md delete mode 100644 docs/passport_v1.md delete mode 100644 docs/payslip_fra_v3.md delete mode 100644 docs/resume_v1.md delete mode 100644 docs/us_healthcare_cards_v1.md delete mode 100644 docs/us_mail_v3.md diff --git a/docs/bank_account_details_v2.md b/docs/bank_account_details_v2.md deleted file mode 100644 index a9abac274..000000000 --- a/docs/bank_account_details_v2.md +++ /dev/null @@ -1,165 +0,0 @@ ---- -title: FR Bank Account Details OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-fr-bank-account-details-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Bank Account Details API](https://platform.mindee.com/mindee/bank_account_details). - -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 OCR SDK. -![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 -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.PredictResponse; -import com.mindee.product.fr.bankaccountdetails.BankAccountDetailsV2; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(filePath); - - // Parse the file - PredictResponse response = mindeeClient.parse( - BankAccountDetailsV2.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocument().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocument().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocument().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -## 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: - -* **bbanBankCode** (`String`): The BBAN bank code outputted as a string. -* **bbanBranchCode** (`String`): The BBAN branch code outputted as a string. -* **bbanKey** (`String`): The BBAN key outputted as a string. -* **bbanNumber** (`String`): The BBAN Account number outputted as a string. - -# Attributes -The following fields are extracted for Bank Account Details V2: - -## Account Holder's Names -**accountHoldersNames**: Full extraction of the account holders names. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getAccountHoldersNames().value); -``` - -## Basic Bank Account Number -**bban**([BankAccountDetailsV2Bban](#basic-bank-account-number-field)): Full extraction of BBAN, including: branch code, bank code, account and key. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getBban().value); -``` - -## IBAN -**iban**: Full extraction of the IBAN number. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getIban().value); -``` - -## SWIFT Code -**swiftCode**: Full extraction of the SWIFT code. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSwiftCode().value); -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/bank_check_v1.md b/docs/bank_check_v1.md deleted file mode 100644 index d3c7026b2..000000000 --- a/docs/bank_check_v1.md +++ /dev/null @@ -1,216 +0,0 @@ ---- -title: US Bank Check OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-us-bank-check-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Bank Check API](https://platform.mindee.com/mindee/bank_check). - -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 OCR SDK. -![Bank Check sample](https://github.com/mindee/client-lib-test-data/blob/main/products/bank_check/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.PredictResponse; -import com.mindee.product.us.bankcheck.BankCheckV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(filePath); - - // Parse the file - PredictResponse response = mindeeClient.parse( - BankCheckV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocument().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocument().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocument().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - -### AmountField -An amount field `AmountField` extends `BaseField`, but also implements: -* **value** (`Double`): corresponds to the field value. Can be `null` if no value was extracted. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -### DateField -The date field `DateField` extends `BaseField`, but also implements: - -* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`. - - -### PositionField -The position field `PositionField` implements: - -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **rectangle** (`Polygon`): a polygon with four points that may be oriented (even beyond canvas). -* **quadrangle** (`Polygon`): 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 Bank Check V1: - -## Account Number -**accountNumber**: The check payer's account number. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getAccountNumber().value); -``` - -## Amount -**amount**: The amount of the check. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getAmount().value); -``` - -## Check Number -**checkNumber**: The issuer's check number. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCheckNumber().value); -``` - -## Check Position -[📄](#page-level-fields "This field is only present on individual pages.")**checkPosition**: The position of the check on the document. - -```java -for (PositionField checkPositionElem : result.getDocument().getInference().getPrediction().getCheckPosition()) -{ - System.out.println(checkPositionElem).polygon; -} -``` - -## Check Issue Date -**date**: The date the check was issued. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDate().value); -``` - -## Payees -**payees**: List of the check's payees (recipients). - -```java -for (payeesElem : result.getDocument().getInference().getPrediction().getPayees()) -{ - System.out.println(payeesElem.value); -} -``` - -## Routing Number -**routingNumber**: The check issuer's routing number. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getRoutingNumber().value); -``` - -## Signature Positions -[📄](#page-level-fields "This field is only present on individual pages.")**signaturesPositions**: List of signature positions - -```java -for (Page page : result.getDocument().getInference().getPages()) -{ - for (PositionField signaturesPositionsElem : page.getSignaturesPositions()) - { - System.out.println(signaturesPositionsElem.polygon); - System.out.println(signaturesPositionsElem.quadrangle); - System.out.println(signaturesPositionsElem.rectangle); - System.out.println(signaturesPositionsElem.boundingBox); - } -} -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/barcode_reader_v1.md b/docs/barcode_reader_v1.md deleted file mode 100644 index d349d0d6b..000000000 --- a/docs/barcode_reader_v1.md +++ /dev/null @@ -1,134 +0,0 @@ ---- -title: Barcode Reader OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-barcode-reader-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Barcode Reader API](https://platform.mindee.com/mindee/barcode_reader). - -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 OCR SDK. -![Barcode Reader sample](https://github.com/mindee/client-lib-test-data/blob/main/products/barcode_reader/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.PredictResponse; -import com.mindee.product.barcodereader.BarcodeReaderV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(filePath); - - // Parse the file - PredictResponse response = mindeeClient.parse( - BarcodeReaderV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocument().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocument().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocument().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -# Attributes -The following fields are extracted for Barcode Reader V1: - -## Barcodes 1D -**codes1D**: List of decoded 1D barcodes. - -```java -for (codes1DElem : result.getDocument().getInference().getPrediction().getCodes1D()) -{ - System.out.println(codes1DElem.value); -} -``` - -## Barcodes 2D -**codes2D**: List of decoded 2D barcodes. - -```java -for (codes2DElem : result.getDocument().getInference().getPrediction().getCodes2D()) -{ - System.out.println(codes2DElem.value); -} -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/bill_of_lading_v1.md b/docs/bill_of_lading_v1.md deleted file mode 100644 index 490ca2aa0..000000000 --- a/docs/bill_of_lading_v1.md +++ /dev/null @@ -1,276 +0,0 @@ ---- -title: Bill of Lading OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-bill-of-lading-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Bill of Lading API](https://platform.mindee.com/mindee/bill_of_lading). - -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 OCR SDK. -![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 -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.AsyncPredictResponse; -import com.mindee.product.billoflading.BillOfLadingV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException, InterruptedException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(new File(filePath)); - - // Parse the file asynchronously - AsyncPredictResponse response = mindeeClient.enqueueAndParse( - BillOfLadingV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocumentObj().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocumentObj().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocumentObj().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -### DateField -The date field `DateField` extends `BaseField`, but also implements: - -* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`. - -## Specific Fields -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. -* **professionalNumber** (`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. - -### 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. - -### Items Field -The goods being shipped. - -A `BillOfLadingV1CarrierItem` implements the following attributes: - -* **description** (`String`): A description of the item. -* **grossWeight** (`Double`): The gross weight of the item. -* **measurement** (`Double`): The measurement of the item. -* **measurementUnit** (`String`): The unit of measurement for the measurement. -* **quantity** (`Double`): The quantity of the item being shipped. -* **weightUnit** (`String`): The unit of measurement for weights. -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. - -### 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. - -# Attributes -The following fields are extracted for Bill of Lading V1: - -## Bill of Lading Number -**billOfLadingNumber**: A unique identifier assigned to a Bill of Lading document. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getBillOfLadingNumber().value); -``` - -## Carrier -**carrier**([BillOfLadingV1Carrier](#carrier-field)): The shipping company responsible for transporting the goods. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCarrier().value); -``` - -## Items -**carrierItems**(List<[BillOfLadingV1CarrierItem](#items-field)>): The goods being shipped. - -```java -for (carrierItemsElem : result.getDocument().getInference().getPrediction().getCarrierItems()) -{ - System.out.println(carrierItemsElem.value); -} -``` - -## Consignee -**consignee**([BillOfLadingV1Consignee](#consignee-field)): The party to whom the goods are being shipped. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getConsignee().value); -``` - -## Date of issue -**dateOfIssue**: The date when the bill of lading is issued. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDateOfIssue().value); -``` - -## Departure Date -**departureDate**: The date when the vessel departs from the port of loading. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDepartureDate().value); -``` - -## Notify Party -**notifyParty**([BillOfLadingV1NotifyParty](#notify-party-field)): The party to be notified of the arrival of the goods. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getNotifyParty().value); -``` - -## Place of Delivery -**placeOfDelivery**: The place where the goods are to be delivered. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getPlaceOfDelivery().value); -``` - -## Port of Discharge -**portOfDischarge**: The port where the goods are unloaded from the vessel. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getPortOfDischarge().value); -``` - -## Port of Loading -**portOfLoading**: The port where the goods are loaded onto the vessel. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getPortOfLoading().value); -``` - -## Shipper -**shipper**([BillOfLadingV1Shipper](#shipper-field)): The party responsible for shipping the goods. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getShipper().value); -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/business_card_v1.md b/docs/business_card_v1.md deleted file mode 100644 index 8f2f3e87b..000000000 --- a/docs/business_card_v1.md +++ /dev/null @@ -1,194 +0,0 @@ ---- -title: Business Card OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-business-card-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Business Card API](https://platform.mindee.com/mindee/business_card). - -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 OCR SDK. -![Business Card sample](https://github.com/mindee/client-lib-test-data/blob/main/products/business_card/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.AsyncPredictResponse; -import com.mindee.product.businesscard.BusinessCardV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException, InterruptedException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(new File(filePath)); - - // Parse the file asynchronously - AsyncPredictResponse response = mindeeClient.enqueueAndParse( - BusinessCardV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocumentObj().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocumentObj().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocumentObj().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -# Attributes -The following fields are extracted for Business Card V1: - -## Address -**address**: The address of the person. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getAddress().value); -``` - -## Company -**company**: The company the person works for. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCompany().value); -``` - -## Email -**email**: The email address of the person. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getEmail().value); -``` - -## Fax Number -**faxNumber**: The Fax number of the person. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getFaxNumber().value); -``` - -## Firstname -**firstname**: The given name of the person. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getFirstname().value); -``` - -## Job Title -**jobTitle**: The job title of the person. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getJobTitle().value); -``` - -## Lastname -**lastname**: The lastname of the person. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getLastname().value); -``` - -## Mobile Number -**mobileNumber**: The mobile number of the person. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getMobileNumber().value); -``` - -## Phone Number -**phoneNumber**: The phone number of the person. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getPhoneNumber().value); -``` - -## Social Media -**socialMedia**: The social media profiles of the person or company. - -```java -for (socialMediaElem : result.getDocument().getInference().getPrediction().getSocialMedia()) -{ - System.out.println(socialMediaElem.value); -} -``` - -## Website -**website**: The website of the person or company. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getWebsite().value); -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/carte_grise_v1.md b/docs/carte_grise_v1.md deleted file mode 100644 index e5e92cfd9..000000000 --- a/docs/carte_grise_v1.md +++ /dev/null @@ -1,482 +0,0 @@ ---- -title: FR Carte Grise OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-fr-carte-grise-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Carte Grise API](https://platform.mindee.com/mindee/carte_grise). - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/carte_grise/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK. -![Carte Grise sample](https://github.com/mindee/client-lib-test-data/blob/main/products/carte_grise/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.PredictResponse; -import com.mindee.product.fr.cartegrise.CarteGriseV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(filePath); - - // Parse the file - PredictResponse response = mindeeClient.parse( - CarteGriseV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocument().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocument().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocument().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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<`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -### DateField -The date field `DateField` extends `BaseField`, but also implements: - -* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`. - -# Attributes -The following fields are extracted for Carte Grise V1: - -## a -**a**: The vehicle's license plate number. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getA().value); -``` - -## b -**b**: The vehicle's first release date. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getB().value); -``` - -## c1 -**c1**: The vehicle owner's full name including maiden name. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getC1().value); -``` - -## c3 -**c3**: The vehicle owner's address. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getC3().value); -``` - -## c41 -**c41**: Number of owners of the license certificate. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getC41().value); -``` - -## c4a -**c4A**: Mentions about the ownership of the vehicle. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getC4A().value); -``` - -## d1 -**d1**: The vehicle's brand. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getD1().value); -``` - -## d3 -**d3**: The vehicle's commercial name. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getD3().value); -``` - -## e -**e**: The Vehicle Identification Number (VIN). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getE().value); -``` - -## f1 -**f1**: The vehicle's maximum admissible weight. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getF1().value); -``` - -## f2 -**f2**: The vehicle's maximum admissible weight within the license's state. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getF2().value); -``` - -## f3 -**f3**: The vehicle's maximum authorized weight with coupling. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getF3().value); -``` - -## Formula Number -**formulaNumber**: The document's formula number. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getFormulaNumber().value); -``` - -## g -**g**: The vehicle's weight with coupling if tractor different than category M1. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getG().value); -``` - -## g1 -**g1**: The vehicle's national empty weight. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getG1().value); -``` - -## i -**i**: The car registration date of the given certificate. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getI().value); -``` - -## j -**j**: The vehicle's category. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getJ().value); -``` - -## j1 -**j1**: The vehicle's national type. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getJ1().value); -``` - -## j2 -**j2**: The vehicle's body type (CE). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getJ2().value); -``` - -## j3 -**j3**: The vehicle's body type (National designation). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getJ3().value); -``` - -## MRZ Line 1 -**mrz1**: Machine Readable Zone, first line. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getMrz1().value); -``` - -## MRZ Line 2 -**mrz2**: Machine Readable Zone, second line. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getMrz2().value); -``` - -## Owner's First Name -**ownerFirstName**: The vehicle's owner first name. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getOwnerFirstName().value); -``` - -## Owner's Surname -**ownerSurname**: The vehicle's owner surname. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getOwnerSurname().value); -``` - -## p1 -**p1**: The vehicle engine's displacement (cm3). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getP1().value); -``` - -## p2 -**p2**: The vehicle's maximum net power (kW). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getP2().value); -``` - -## p3 -**p3**: The vehicle's fuel type or energy source. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getP3().value); -``` - -## p6 -**p6**: The vehicle's administrative power (fiscal horsepower). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getP6().value); -``` - -## q -**q**: The vehicle's power to weight ratio. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getQ().value); -``` - -## s1 -**s1**: The vehicle's number of seats. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getS1().value); -``` - -## s2 -**s2**: The vehicle's number of standing rooms (person). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getS2().value); -``` - -## u1 -**u1**: The vehicle's sound level (dB). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getU1().value); -``` - -## u2 -**u2**: The vehicle engine's rotation speed (RPM). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getU2().value); -``` - -## v7 -**v7**: The vehicle's CO2 emission (g/km). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getV7().value); -``` - -## x1 -**x1**: Next technical control date. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getX1().value); -``` - -## y1 -**y1**: Amount of the regional proportional tax of the registration (in euros). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getY1().value); -``` - -## y2 -**y2**: Amount of the additional parafiscal tax of the registration (in euros). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getY2().value); -``` - -## y3 -**y3**: Amount of the additional CO2 tax of the registration (in euros). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getY3().value); -``` - -## y4 -**y4**: Amount of the fee for managing the registration (in euros). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getY4().value); -``` - -## y5 -**y5**: Amount of the fee for delivery of the registration certificate in euros. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getY5().value); -``` - -## y6 -**y6**: Total amount of registration fee to be paid in euros. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getY6().value); -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/cropper_v1.md b/docs/cropper_v1.md deleted file mode 100644 index 982a3bb81..000000000 --- a/docs/cropper_v1.md +++ /dev/null @@ -1,130 +0,0 @@ ---- -title: Cropper OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-cropper-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Cropper API](https://platform.mindee.com/mindee/cropper). - -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 OCR SDK. -![Cropper sample](https://github.com/mindee/client-lib-test-data/blob/main/products/cropper/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.PredictResponse; -import com.mindee.product.cropper.CropperV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(filePath); - - // Parse the file - PredictResponse response = mindeeClient.parse( - CropperV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocument().toString()); - - // Print the page-level predictions -// response.getDocument().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - - -### PositionField -The position field `PositionField` implements: - -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **rectangle** (`Polygon`): a polygon with four points that may be oriented (even beyond canvas). -* **quadrangle** (`Polygon`): 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**: List of documents found in the image. - -```java -for (Page page : result.getDocument().getInference().getPages()) -{ - for (PositionField croppingElem : page.getCropping()) - { - System.out.println(croppingElem.polygon); - System.out.println(croppingElem.quadrangle); - System.out.println(croppingElem.rectangle); - System.out.println(croppingElem.boundingBox); - } -} -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/custom_v1.md b/docs/custom_v1.md deleted file mode 100644 index 18a4c05a6..000000000 --- a/docs/custom_v1.md +++ /dev/null @@ -1,134 +0,0 @@ ---- -title: Custom OCR Java (Deprecated) -category: 622b805aaec68102ea7fcbc2 -slug: java-api-builder -parentDoc: 631a062c3718850f3519b793 ---- -> 🚧 This product is still supported, but is considered to be deprecated. If you are looking for the docTI API documentation, you can find it [here](https://developers.mindee.com/docs/java-generated-ocr). - -## Quick Start - -```java -String path = "/path/to/the/file.ext"; -LocalInputSource inputSource = new LocalInputSource(path); -CustomEndpoint myEndpoint = new CustomEndpoint( - "wnine", - "john", - // "1.1" // optional -); - -MindeeClient mindeeClient = new MindeeClient(apiKey); - -PredictResponse response = mindeeClient - .parse(inputSource, myEndpoint); - -// Print a summary of the response -System.out.println(response.toString()); -``` - -If the `version` argument is set, you'll be required to update it every time a new model is trained. -This is probably not needed for development but essential for production use. - -## The `CustomV1` Object -The `CustomV1` object contains the results of document-level and page-level predictions. - -All the fields which are present in the API builder are available. - -The fields are defined when creating your custom API. - -### Document-Level Predictions -The document-level predictions are ultimately contained in the `CustomV1Document` object. - -The predictions are stored in two properties: `classificationFields` and `fields`. - -Both are a Map where the key is a `String` of the name of the field. - -For the values: -* `classificationFields` have a `ClassificationField` object as value, each containing a single `String` value. -* `fields` have a `ListField` object as value, each containing a list of all `String` values extracted for this field. - -Here are some example usages: -```java -String path = "/path/to/the/file.ext"; -LocalInputSource inputSource = new LocalInputSource(path); - -PredictResponse response = mindeeClient - .parse(CustomV1.class, inputSource); - -CustomV1 inference = response.getDocument().getInference(); - -// === Getting a single field === \\ - -ListField employerName = inference.getPrediction().getFields().get("employer_name"); - -// get the field as a string -System.out.println(employerName.toString()); - -// get the field as a string with a custom separator -System.out.println(employerName.getContentsString("_")); - -// get the list of string values in the field -System.out.println(employerName.getContentsList()); - -// == Getting all fields === \\ - -for (Map.Entry entry : inference.getPrediction().getFields().entrySet()) { - ListField field = entry.getValue(); - - // Not really needed, just showing that the method exists ;-) - if (field.isEmpty()) { - continue; - } - - // We can print directly as in the single field example above ... - System.out.println(field.toString()); - - // ... or go through each value - for (ListFieldValue value : field.getValues()) { - - // The actual value (word) - System.out.println(value.getContent()); - - // The page on which the value was found - System.out.println(value.getPageId()); - } -} -``` - -### Page-Level Predictions -The page-level predictions are ultimately contained in the `CustomV1Page` object. - -In the response, there is a list of these objects, each one representing a single page. - -The prediction results are stored as a key-value `HashMap`. - -Here are some example usages: -```java -String path = "/path/to/the/file.ext"; -LocalInputSource inputSource = new LocalInputSource(path); - -PredictResponse response = mindeeClient - .parse(CustomV1.class, inputSource); - -CustomV1 inference = response.getDocument().getInference(); - -for (Page page : inference.getPages()) { - CustomV1Page pagePrediction = page.getPrediction(); - - for (Map.Entry entry : pagePrediction.entrySet()) { - ListField field = entry.getValue(); - - // get the field as a string - System.out.println(field.toString()); - - // get the field as a string with a custom separator - System.out.println(field.getContentsString("_")); - - // get the list of strings in the field - System.out.println(field.getContentsList()); - } -} -``` - -## Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/delivery_notes_v1.md b/docs/delivery_notes_v1.md deleted file mode 100644 index 27a5f6291..000000000 --- a/docs/delivery_notes_v1.md +++ /dev/null @@ -1,167 +0,0 @@ ---- -title: Delivery note OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-delivery-note-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Delivery note API](https://platform.mindee.com/mindee/delivery_notes). - -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 OCR SDK. -![Delivery note sample](https://github.com/mindee/client-lib-test-data/blob/main/products/delivery_notes/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.AsyncPredictResponse; -import com.mindee.product.deliverynote.DeliveryNoteV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException, InterruptedException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(new File(filePath)); - - // Parse the file asynchronously - AsyncPredictResponse response = mindeeClient.enqueueAndParse( - DeliveryNoteV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocumentObj().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocumentObj().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocumentObj().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - -### AmountField -An amount field `AmountField` extends `BaseField`, but also implements: -* **value** (`Double`): corresponds to the field value. Can be `null` if no value was extracted. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -### DateField -The date field `DateField` extends `BaseField`, but also implements: - -* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`. - -# Attributes -The following fields are extracted for Delivery note V1: - -## Customer Address -**customerAddress**: The address of the customer receiving the goods. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCustomerAddress().value); -``` - -## Customer Name -**customerName**: The name of the customer receiving the goods. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCustomerName().value); -``` - -## Delivery Date -**deliveryDate**: The date on which the delivery is scheduled to arrive. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDeliveryDate().value); -``` - -## Delivery Number -**deliveryNumber**: A unique identifier for the delivery note. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDeliveryNumber().value); -``` - -## Supplier Address -**supplierAddress**: The address of the supplier providing the goods. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSupplierAddress().value); -``` - -## Supplier Name -**supplierName**: The name of the supplier providing the goods. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSupplierName().value); -``` - -## Total Amount -**totalAmount**: The total monetary value of the goods being delivered. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTotalAmount().value); -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/driver_license_v1.md b/docs/driver_license_v1.md deleted file mode 100644 index 65bdd8f62..000000000 --- a/docs/driver_license_v1.md +++ /dev/null @@ -1,211 +0,0 @@ ---- -title: Driver License OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-driver-license-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Driver License API](https://platform.mindee.com/mindee/driver_license). - -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 OCR SDK. -![Driver License sample](https://github.com/mindee/client-lib-test-data/blob/main/products/driver_license/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.AsyncPredictResponse; -import com.mindee.product.driverlicense.DriverLicenseV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException, InterruptedException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(new File(filePath)); - - // Parse the file asynchronously - AsyncPredictResponse response = mindeeClient.enqueueAndParse( - DriverLicenseV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocumentObj().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocumentObj().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocumentObj().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -### DateField -The date field `DateField` extends `BaseField`, but also implements: - -* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`. - -# Attributes -The following fields are extracted for Driver License V1: - -## Category -**category**: The category or class of the driver license. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCategory().value); -``` - -## Country Code -**countryCode**: The alpha-3 ISO 3166 code of the country where the driver license was issued. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCountryCode().value); -``` - -## Date of Birth -**dateOfBirth**: The date of birth of the driver license holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDateOfBirth().value); -``` - -## DD Number -**ddNumber**: The DD number of the driver license. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDdNumber().value); -``` - -## Expiry Date -**expiryDate**: The expiry date of the driver license. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getExpiryDate().value); -``` - -## First Name -**firstName**: The first name of the driver license holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getFirstName().value); -``` - -## ID -**id**: The unique identifier of the driver license. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getId().value); -``` - -## Issued Date -**issuedDate**: The date when the driver license was issued. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getIssuedDate().value); -``` - -## Issuing Authority -**issuingAuthority**: The authority that issued the driver license. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getIssuingAuthority().value); -``` - -## Last Name -**lastName**: The last name of the driver license holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getLastName().value); -``` - -## MRZ -**mrz**: The Machine Readable Zone (MRZ) of the driver license. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getMrz().value); -``` - -## Place of Birth -**placeOfBirth**: The place of birth of the driver license holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getPlaceOfBirth().value); -``` - -## State -**state**: Second part of the ISO 3166-2 code, consisting of two letters indicating the US State. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getState().value); -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/energy_bill_fra_v1.md b/docs/energy_bill_fra_v1.md deleted file mode 100644 index 1536392dd..000000000 --- a/docs/energy_bill_fra_v1.md +++ /dev/null @@ -1,344 +0,0 @@ ---- -title: FR Energy Bill OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-fr-energy-bill-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Energy Bill API](https://platform.mindee.com/mindee/energy_bill_fra). - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/energy_bill_fra/default_sample.pdf), we are going to illustrate how to extract the data that we want using the OCR SDK. -![Energy Bill sample](https://github.com/mindee/client-lib-test-data/blob/main/products/energy_bill_fra/default_sample.pdf?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.AsyncPredictResponse; -import com.mindee.product.fr.energybill.EnergyBillV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException, InterruptedException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(new File(filePath)); - - // Parse the file asynchronously - AsyncPredictResponse response = mindeeClient.enqueueAndParse( - EnergyBillV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocumentObj().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocumentObj().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocumentObj().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - -### AmountField -An amount field `AmountField` extends `BaseField`, but also implements: -* **value** (`Double`): corresponds to the field value. Can be `null` if no value was extracted. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -### DateField -The date field `DateField` extends `BaseField`, but also implements: - -* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`. - -## Specific Fields -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. - -### 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 Usage Field -Details of energy consumption. - -A `EnergyBillV1EnergyUsage` implements the following attributes: - -* **consumption** (`Double`): The price per unit of energy consumed. -* **description** (`String`): Description or details of the energy usage. -* **endDate** (`String`): The end date of the energy usage. -* **startDate** (`String`): The start date of the energy usage. -* **taxRate** (`Double`): The rate of tax applied to the total cost. -* **total** (`Double`): The total cost of energy consumed. -* **unit** (`String`): The unit of measurement for energy consumption. - -#### Possible values include: - - kWh - - m3 - - L - -* **unitPrice** (`Double`): The price per unit of energy consumed. -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: - -* **meterNumber** (`String`): The unique identifier of the energy meter. -* **meterType** (`String`): The type of energy meter. - -#### Possible values include: - - electricity - - gas - - water - - None - -* **unit** (`String`): The unit of power for energy consumption. -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. -* **endDate** (`String`): The end date of the subscription. -* **startDate** (`String`): The start date of the subscription. -* **taxRate** (`Double`): The rate of tax applied to the total cost. -* **total** (`Double`): The total cost of subscription. -* **unitPrice** (`Double`): The price per unit of subscription. -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. -* **endDate** (`String`): The end date of the Taxes and Contributions. -* **startDate** (`String`): The start date of the Taxes and Contributions. -* **taxRate** (`Double`): The rate of tax applied to the total cost. -* **total** (`Double`): The total cost of Taxes and Contributions. -* **unitPrice** (`Double`): The price per unit of Taxes and Contributions. - -# Attributes -The following fields are extracted for Energy Bill V1: - -## Contract ID -**contractId**: The unique identifier associated with a specific contract. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getContractId().value); -``` - -## Delivery Point -**deliveryPoint**: The unique identifier assigned to each electricity or gas consumption point. It specifies the exact location where the energy is delivered. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDeliveryPoint().value); -``` - -## Due Date -**dueDate**: The date by which the payment for the energy invoice is due. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDueDate().value); -``` - -## Energy Consumer -**energyConsumer**([EnergyBillV1EnergyConsumer](#energy-consumer-field)): The entity that consumes the energy. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getEnergyConsumer().value); -``` - -## Energy Supplier -**energySupplier**([EnergyBillV1EnergySupplier](#energy-supplier-field)): The company that supplies the energy. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getEnergySupplier().value); -``` - -## Energy Usage -**energyUsage**(List<[EnergyBillV1EnergyUsage](#energy-usage-field)>): Details of energy consumption. - -```java -for (energyUsageElem : result.getDocument().getInference().getPrediction().getEnergyUsage()) -{ - System.out.println(energyUsageElem.value); -} -``` - -## Invoice Date -**invoiceDate**: The date when the energy invoice was issued. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getInvoiceDate().value); -``` - -## Invoice Number -**invoiceNumber**: The unique identifier of the energy invoice. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getInvoiceNumber().value); -``` - -## Meter Details -**meterDetails**([EnergyBillV1MeterDetail](#meter-details-field)): Information about the energy meter. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getMeterDetails().value); -``` - -## Subscription -**subscription**(List<[EnergyBillV1Subscription](#subscription-field)>): The subscription details fee for the energy service. - -```java -for (subscriptionElem : result.getDocument().getInference().getPrediction().getSubscription()) -{ - System.out.println(subscriptionElem.value); -} -``` - -## Taxes and Contributions -**taxesAndContributions**(List<[EnergyBillV1TaxesAndContribution](#taxes-and-contributions-field)>): Details of Taxes and Contributions. - -```java -for (taxesAndContributionsElem : result.getDocument().getInference().getPrediction().getTaxesAndContributions()) -{ - System.out.println(taxesAndContributionsElem.value); -} -``` - -## Total Amount -**totalAmount**: The total amount to be paid for the energy invoice. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTotalAmount().value); -``` - -## Total Before Taxes -**totalBeforeTaxes**: The total amount to be paid for the energy invoice before taxes. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTotalBeforeTaxes().value); -``` - -## Total Taxes -**totalTaxes**: Total of taxes applied to the invoice. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTotalTaxes().value); -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/expense_receipts_v5.md b/docs/expense_receipts_v5.md deleted file mode 100644 index cd0c2814c..000000000 --- a/docs/expense_receipts_v5.md +++ /dev/null @@ -1,433 +0,0 @@ ---- -title: Receipt OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-receipt-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Receipt API](https://platform.mindee.com/mindee/expense_receipts). - -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 OCR SDK. -![Receipt sample](https://github.com/mindee/client-lib-test-data/blob/main/products/expense_receipts/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.PredictResponse; -import com.mindee.product.receipt.ReceiptV5; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(filePath); - - // Parse the file - PredictResponse response = mindeeClient.parse( - ReceiptV5.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocument().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocument().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocument().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -You can also call this product asynchronously: - -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.AsyncPredictResponse; -import com.mindee.product.receipt.ReceiptV5; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException, InterruptedException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(new File(filePath)); - - // Parse the file asynchronously - AsyncPredictResponse response = mindeeClient.enqueueAndParse( - ReceiptV5.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocumentObj().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocumentObj().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocumentObj().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - -### AmountField -An amount field `AmountField` extends `BaseField`, but also implements: -* **value** (`Double`): corresponds to the field value. Can be `null` if no value was extracted. - - -### ClassificationField -The classification field `ClassificationField` extends `BaseField`, but also implements: -* **value** (`strong`): corresponds to the field value. -* **confidence** (`double`): the confidence score of the field prediction. - -> Note: a classification field's `value is always a `String`. - - -### CompanyRegistrationField -Aside from the basic `BaseField` attributes, the company registration field `CompanyRegistrationField` also implements the following: - -* **type** (`String`): the type of company. -* **value** (`String`): corresponds to the field value. -* **toTableLine()**: a method that formats the data to fit in a .rst display. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -### DateField -The date field `DateField` extends `BaseField`, but also implements: - -* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`. - -### LocaleField -The locale field `LocaleField` extends `BaseField`, but also implements: - -* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`. -* **language** (`String`): ISO 639-1 language code (e.g.: `en` for English). Can be `null`. -* **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 `null`. -* **currency** (`String`): ISO 4217 code for currencies (e.g.: `USD` for "US Dollars"). Can be `null`. - -### Taxes -#### TaxField -Aside from the basic `BaseField` attributes, the tax field `TaxField` also implements the following: - -* **rate** (`Double`): the tax rate applied to an item expressed as a percentage. Can be `null`. -* **code** (`String`): tax code (or equivalent, depending on the origin of the document). -* **base** (`Double`): base amount used for the tax. Can be `null`. -* **value** (`Double`): the value of the tax. Can be `null`. - -> Note: currently `TaxField` is not used on its own, and is accessed through a parent `Taxes` object, a list-like structure. - -#### Taxes (List) -The `Taxes` field represents a List of `TaxField` objects. As it is the representation of several objects, it has access to a custom `toString` 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** (`Double`): The item quantity. -* **totalAmount** (`Double`): The item total amount. -* **unitPrice** (`Double`): The item unit price. - -# Attributes -The following fields are extracted for Receipt V5: - -## Purchase Category -**category**: The purchase category of the receipt. - -#### Possible values include: - - 'toll' - - 'food' - - 'parking' - - 'transport' - - 'accommodation' - - 'gasoline' - - 'telecom' - - 'miscellaneous' - - 'software' - - 'shopping' - - 'energy' - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCategory().value); -``` - -## Purchase Date -**date**: The date the purchase was made. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDate().value); -``` - -## Document Type -**documentType**: The type of receipt: EXPENSE RECEIPT or CREDIT CARD RECEIPT. - -#### Possible values include: - - 'EXPENSE RECEIPT' - - 'CREDIT CARD RECEIPT' - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDocumentType().value); -``` - -## Line Items -**lineItems**(List<[ReceiptV5LineItem](#line-items-field)>): List of all line items on the receipt. - -```java -for (lineItemsElem : result.getDocument().getInference().getPrediction().getLineItems()) -{ - System.out.println(lineItemsElem.value); -} -``` - -## Expense Locale -**locale**: The locale of the document. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getLocale().value); -``` - -## Receipt Number -**receiptNumber**: The receipt number or identifier. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getReceiptNumber().value); -``` - -## Purchase Subcategory -**subcategory**: 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' - - null - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSubcategory().value); -``` - -## Supplier Address -**supplierAddress**: The address of the supplier or merchant. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSupplierAddress().value); -``` - -## Supplier Company Registrations -**supplierCompanyRegistrations**: List of company registration numbers associated to the supplier. - -```java -for (supplierCompanyRegistrationsElem : result.getDocument().getInference().getPrediction().getSupplierCompanyRegistrations()) -{ - System.out.println(supplierCompanyRegistrationsElem.value); -} -``` - -## Supplier Name -**supplierName**: The name of the supplier or merchant. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSupplierName().value); -``` - -## Supplier Phone Number -**supplierPhoneNumber**: The phone number of the supplier or merchant. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSupplierPhoneNumber().value); -``` - -## Taxes -**taxes**: The list of taxes present on the receipt. - -```java -for (taxesElem : result.getDocument().getInference().getPrediction().getTaxes()) -{ - System.out.println(taxesElem.value); -} -``` - -## Purchase Time -**time**: The time the purchase was made. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTime().value); -``` - -## Tip and Gratuity -**tip**: The total amount of tip and gratuity. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTip().value); -``` - -## Total Amount -**totalAmount**: The total amount paid: includes taxes, discounts, fees, tips, and gratuity. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTotalAmount().value); -``` - -## Total Net -**totalNet**: The net amount paid: does not include taxes, fees, and discounts. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTotalNet().value); -``` - -## Total Tax -**totalTax**: The sum of all taxes. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTotalTax().value); -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/financial_document_v1.md b/docs/financial_document_v1.md deleted file mode 100644 index 457907ca7..000000000 --- a/docs/financial_document_v1.md +++ /dev/null @@ -1,627 +0,0 @@ ---- -title: Financial Document OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-financial-document-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Financial Document API](https://platform.mindee.com/mindee/financial_document). - -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 OCR SDK. -![Financial Document sample](https://github.com/mindee/client-lib-test-data/blob/main/products/financial_document/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.PredictResponse; -import com.mindee.product.financialdocument.FinancialDocumentV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(filePath); - - // Parse the file - PredictResponse response = mindeeClient.parse( - FinancialDocumentV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocument().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocument().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocument().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -You can also call this product asynchronously: - -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.AsyncPredictResponse; -import com.mindee.product.financialdocument.FinancialDocumentV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException, InterruptedException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(new File(filePath)); - - // Parse the file asynchronously - AsyncPredictResponse response = mindeeClient.enqueueAndParse( - FinancialDocumentV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocumentObj().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocumentObj().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocumentObj().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` 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: - -* **streetNumber** (`String`): String representation of the street number. Can be `null`. -* **streetName** (`String`): Name of the street. Can be `null`. -* **poBox** (`String`): String representation of the PO Box number. Can be `null`. -* **addressComplement** (`String`): Address complement. Can be `null`. -* **city** (`String`): City name. Can be `null`. -* **postalcode** (`String`): String representation of the postal code. Can be `null`. -* **state** (`String`): State name. Can be `null`. -* **country** (`String`): Country name. Can be `null`. - -Note: The `value` field of an AddressField should be a concatenation of the rest of the values. - -### AmountField -An amount field `AmountField` extends `BaseField`, but also implements: -* **value** (`Double`): corresponds to the field value. Can be `null` if no value was extracted. - - -### ClassificationField -The classification field `ClassificationField` extends `BaseField`, but also implements: -* **value** (`strong`): corresponds to the field value. -* **confidence** (`double`): the confidence score of the field prediction. - -> Note: a classification field's `value is always a `String`. - - -### CompanyRegistrationField -Aside from the basic `BaseField` attributes, the company registration field `CompanyRegistrationField` also implements the following: - -* **type** (`String`): the type of company. -* **value** (`String`): corresponds to the field value. -* **toTableLine()**: a method that formats the data to fit in a .rst display. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -### DateField -The date field `DateField` extends `BaseField`, but also implements: - -* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`. - -### LocaleField -The locale field `LocaleField` extends `BaseField`, but also implements: - -* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`. -* **language** (`String`): ISO 639-1 language code (e.g.: `en` for English). Can be `null`. -* **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 `null`. -* **currency** (`String`): ISO 4217 code for currencies (e.g.: `USD` for "US Dollars"). Can be `null`. - -### Taxes -#### TaxField -Aside from the basic `BaseField` attributes, the tax field `TaxField` also implements the following: - -* **rate** (`Double`): the tax rate applied to an item expressed as a percentage. Can be `null`. -* **code** (`String`): tax code (or equivalent, depending on the origin of the document). -* **base** (`Double`): base amount used for the tax. Can be `null`. -* **value** (`Double`): the value of the tax. Can be `null`. - -> Note: currently `TaxField` is not used on its own, and is accessed through a parent `Taxes` object, a list-like structure. - -#### Taxes (List) -The `Taxes` field represents a List of `TaxField` objects. As it is the representation of several objects, it has access to a custom `toString` 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. -* **productCode** (`String`): The product code referring to the item. -* **quantity** (`Double`): The item quantity -* **taxAmount** (`Double`): The item tax amount. -* **taxRate** (`Double`): The item tax rate in percentage. -* **totalAmount** (`Double`): The item total amount. -* **unitMeasure** (`String`): The item unit of measure. -* **unitPrice** (`Double`): The item unit price. - -# Attributes -The following fields are extracted for Financial Document V1: - -## Billing Address -**billingAddress**: The customer's address used for billing. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getBillingAddress().value); -``` - -## Purchase Category -**category**: The purchase category. - -#### Possible values include: - - 'toll' - - 'food' - - 'parking' - - 'transport' - - 'accommodation' - - 'gasoline' - - 'telecom' - - 'miscellaneous' - - 'software' - - 'shopping' - - 'energy' - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCategory().value); -``` - -## Customer Address -**customerAddress**: The address of the customer. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCustomerAddress().value); -``` - -## Customer Company Registrations -**customerCompanyRegistrations**: List of company registration numbers associated to the customer. - -```java -for (customerCompanyRegistrationsElem : result.getDocument().getInference().getPrediction().getCustomerCompanyRegistrations()) -{ - System.out.println(customerCompanyRegistrationsElem.value); -} -``` - -## Customer ID -**customerId**: The customer account number or identifier from the supplier. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCustomerId().value); -``` - -## Customer Name -**customerName**: The name of the customer. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCustomerName().value); -``` - -## Purchase Date -**date**: The date the purchase was made. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDate().value); -``` - -## Document Number -**documentNumber**: The document number or identifier (invoice number or receipt number). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDocumentNumber().value); -``` - -## Document Type -**documentType**: 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' - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDocumentType().value); -``` - -## Document Type Extended -**documentTypeExtended**: Document type extended. - -#### Possible values include: - - 'CREDIT NOTE' - - 'INVOICE' - - 'OTHER' - - 'OTHER_FINANCIAL' - - 'PAYSLIP' - - 'PURCHASE ORDER' - - 'QUOTE' - - 'RECEIPT' - - 'STATEMENT' - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDocumentTypeExtended().value); -``` - -## Due Date -**dueDate**: The date on which the payment is due. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDueDate().value); -``` - -## Invoice Number -**invoiceNumber**: The invoice number or identifier only if document is an invoice. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getInvoiceNumber().value); -``` - -## Line Items -**lineItems**(List<[FinancialDocumentV1LineItem](#line-items-field)>): List of line item present on the document. - -```java -for (lineItemsElem : result.getDocument().getInference().getPrediction().getLineItems()) -{ - System.out.println(lineItemsElem.value); -} -``` - -## Locale -**locale**: The locale of the document. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getLocale().value); -``` - -## Payment Date -**paymentDate**: The date on which the payment is due / fullfilled. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getPaymentDate().value); -``` - -## Purchase Order Number -**poNumber**: The purchase order number, only if the document is an invoice. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getPoNumber().value); -``` - -## Receipt Number -**receiptNumber**: The receipt number or identifier only if document is a receipt. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getReceiptNumber().value); -``` - -## Reference Numbers -**referenceNumbers**: List of Reference numbers, including PO number, only if the document is an invoice. - -```java -for (referenceNumbersElem : result.getDocument().getInference().getPrediction().getReferenceNumbers()) -{ - System.out.println(referenceNumbersElem.value); -} -``` - -## Shipping Address -**shippingAddress**: The customer's address used for shipping. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getShippingAddress().value); -``` - -## Purchase Subcategory -**subcategory**: 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' - - null - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSubcategory().value); -``` - -## Supplier Address -**supplierAddress**: The address of the supplier or merchant. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSupplierAddress().value); -``` - -## Supplier Company Registrations -**supplierCompanyRegistrations**: List of company registration numbers associated to the supplier. - -```java -for (supplierCompanyRegistrationsElem : result.getDocument().getInference().getPrediction().getSupplierCompanyRegistrations()) -{ - System.out.println(supplierCompanyRegistrationsElem.value); -} -``` - -## Supplier Email -**supplierEmail**: The email of the supplier or merchant. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSupplierEmail().value); -``` - -## Supplier Name -**supplierName**: The name of the supplier or merchant. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSupplierName().value); -``` - -## Supplier Payment Details -**supplierPaymentDetails**: List of payment details associated to the supplier (only for invoices). - -```java -for (supplierPaymentDetailsElem : result.getDocument().getInference().getPrediction().getSupplierPaymentDetails()) -{ - System.out.println(supplierPaymentDetailsElemvalue); - System.out.println(supplierPaymentDetailsElem.rate); - System.out.println(supplierPaymentDetailsElem.code); - System.out.println(supplierPaymentDetailsElem.base); -} -``` - -## Supplier Phone Number -**supplierPhoneNumber**: The phone number of the supplier or merchant. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSupplierPhoneNumber().value); -``` - -## Supplier Website -**supplierWebsite**: The website URL of the supplier or merchant. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSupplierWebsite().value); -``` - -## Taxes -**taxes**: List of all taxes on the document. - -```java -for (taxesElem : result.getDocument().getInference().getPrediction().getTaxes()) -{ - System.out.println(taxesElem.value); -} -``` - -## Purchase Time -**time**: The time the purchase was made (only for receipts). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTime().value); -``` - -## Tip and Gratuity -**tip**: The total amount of tip and gratuity - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTip().value); -``` - -## Total Amount -**totalAmount**: The total amount paid: includes taxes, tips, fees, and other charges. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTotalAmount().value); -``` - -## Total Net -**totalNet**: The net amount paid: does not include taxes, fees, and discounts. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTotalNet().value); -``` - -## Total Tax -**totalTax**: The sum of all taxes present on the document. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTotalTax().value); -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/french_healthcard_v1.md b/docs/french_healthcard_v1.md deleted file mode 100644 index 2c3eac7b2..000000000 --- a/docs/french_healthcard_v1.md +++ /dev/null @@ -1,142 +0,0 @@ ---- -title: FR Health Card OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-fr-health-card-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Health Card API](https://platform.mindee.com/mindee/french_healthcard). - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/french_healthcard/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK. -![Health Card sample](https://github.com/mindee/client-lib-test-data/blob/main/products/french_healthcard/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.AsyncPredictResponse; -import com.mindee.product.fr.healthcard.HealthCardV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException, InterruptedException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(new File(filePath)); - - // Parse the file asynchronously - AsyncPredictResponse response = mindeeClient.enqueueAndParse( - HealthCardV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocumentObj().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocumentObj().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocumentObj().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -### DateField -The date field `DateField` extends `BaseField`, but also implements: - -* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`. - -# Attributes -The following fields are extracted for Health Card V1: - -## Given Name(s) -**givenNames**: The given names of the card holder. - -```java -for (givenNamesElem : result.getDocument().getInference().getPrediction().getGivenNames()) -{ - System.out.println(givenNamesElem.value); -} -``` - -## Issuance Date -**issuanceDate**: The date when the carte vitale document was issued. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getIssuanceDate().value); -``` - -## Social Security Number -**socialSecurity**: The social security number of the card holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSocialSecurity().value); -``` - -## Surname -**surname**: The surname of the card holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSurname().value); -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/generated_v1.md b/docs/generated_v1.md deleted file mode 100644 index 0b3420b90..000000000 --- a/docs/generated_v1.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: Generated API Java -category: 622b805aaec68102ea7fcbc2 -slug: java-generated-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports generated APIs. -Generated APIs can theoretically support all APIs in a catch-all generic format. - -# Quick-Start - -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.AsyncPredictResponse; -import com.mindee.product.generated.GeneratedV1; -import com.mindee.http.Endpoint; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException, InterruptedException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(new File(filePath)); - - // Configure the endpoint - Endpoint endpoint = new Endpoint( - "my-endpoint", - "my-account", - "my-version" - ); - - // Parse the file asynchronously - AsyncPredictResponse response = mindeeClient.enqueueAndParse( - GeneratedV1.class, - endpoint, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocumentObj().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocumentObj().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocumentObj().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} -``` - -# Generated Endpoints - -As shown above, 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 - -## Generated Fields - -By default, GeneratedV1 implements only one attribute: -- **fields**: this attribute is retrievable through `getFields()`, which will return a `Map`. - -### Generated Feature - -A `GeneratedFeature` is a special type of custom list that extends `ArrayList<`[GeneratedObject](#generated-object-field)`>` and implements the following: - -- **asStringField()** (`StringField`): the value of the field as a `StringField`. -- **asAmountField()** (`AmountField`): the value of the field as an `AmountField`. -- **asDateField()** (`DateField`): the value of the field as a `DateField`. -- **asClassificationField()** (`ClassificationField`): the value of the field as a `ClassificationField`. - -### Generated Object Field - -By default, non-list objects will be stored in a `GeneratedObject` structure, which are an extension of simple hashmaps. These fields have access to the following: - -- **asStringField()** (`StringField`): the value of the field as a `StringField`. -- **asAmountField()** (`AmountField`): the value of the field as an `AmountField`. -- **asDateField()** (`DateField`): the value of the field as a `DateField`. -- **asClassificationField()** (`ClassificationField`): the value of the field as a `ClassificationField`. -- **getAsPolygon()** (`Polygon`): representation of the field as a `Polygon`. -- **getPageId()** (`integer`): retrieves the ID of the page the field was found on. Note: this isn't supported on some APIs. -- **getConfidence()** (`float`): retrieves the confidence score for a field, if it exists. - - -> Note: the `asXXXXField()` methods mentioned above will raise `MindeeException` if they do not correspond to the field's type. - - -# 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 eea1887ec..000000000 --- a/docs/getting_started.md +++ /dev/null @@ -1,346 +0,0 @@ ---- -title: 'Java Library: Overview' -category: 622b805aaec68102ea7fcbc2 -slug: java-ocr-getting-started -parentDoc: 631a062c3718850f3519b793 ---- - -This guide will help you get the most of the Mindee Java client library to easily extract data from your documents. - -> 📘 **Info** -> -> The library is written and compiled with Java 8. This guide assumes you have a compatible JVM language installed - -## Installation - -### Prerequisites - -Installation using [Apache Maven](https://maven.apache.org/install.html) is recommended. - -The library is tested on Java versions 8 and 11. - -Other installation methods and/or Java versions may work, but are not officially supported. - -### Maven - -The easiest way to use the Mindee client library for your project is by adding -the maven dependency in your project's POM: - -```shell - - ... - - mindee-api-java - com.mindee.sdk - ${mindee.sdk.version} - - - - ... - 3.x.x - -``` - -For the latest version of the Library please refer to our [maven central repository](https://mvnrepository.com/artifact/com.mindee.sdk/mindee-api-java) - -### Development Installation - -If you'll be modifying the source code, you'll need to follow these steps to get started. - -1. First clone the repo. - -```shell -git clone git@github.com:mindee/mindee-api-java.git -``` - -2. Navigate to the cloned directory and install all required libraries. - -```shell -mvn clean install -``` - -## Updating the Library - -When starting out it is recommended that you use the latest release version of the library from -our [maven central repository](https://mvnrepository.com/artifact/com.mindee.sdk/mindee-api-java). - -Future updates can be made using the [maven versions plugin](https://www.mojohaus.org/versions-maven-plugin/). - -```shell -mvn versions:use-next-releases -Dincludes=com.mindee.sdk:mindee-api-java -``` - -## 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-document) to Mindee's API -4. [Retrieve the response](#retrieving-the-response) -5. [Process the response](#processing-the-response) in some way - -Let's take a deep dive into how this works. - -### Initializing the Client - -The `com.mindee.MindeeClient` class centralizes document configurations into a single class. - -The `MindeeClient` 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 - -```java -import com.mindee; - -// Init a new client and passing the key directly -MindeeClient client = new MindeeClient(""); -``` - -#### Set the API key in the environment - -API keys can be set as environment variables. - -The following environment variable will set the global API key: - -```shell -MINDEE_API_KEY="my-api-key" -``` - -Then in your code: - -```java -// Init a new client without an API key -MindeeClient client = new MindeeClient(); -``` - -### HttpClient Customizations - -Mindee's API lives on the internet and many internal applications on corporate networks may therefore need to configure an HTTP proxy to access it. -This is possible by using a `MindeeClient` configured to use a user provided instance of the `com.mindee.http.MindeeApi` interface. - -There are a few layers to this: - -- The default implementation of `com.mindee.http.MindeeApi` interface is `com.mindee.http.MindeeHttpApi` -- `MindeeHttpApi` can be initialized with an Apache HttpComponents `HttpClientBuilder`. -- `HttpClientBuilder` can be configured for use cases like proxying requests, custom authentication schemes, setting SSL Context etc. - -To Configure a `MindeeClient` to use a proxy, the following code can be referenced. - -```java - -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.PredictResponse; -import com.mindee.product.invoice.InvoiceV4; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - public static void main(String[] args) throws IOException { - - // You can also configure things like caching, custom HTTPS certs, - // timeouts and connection pool sizes here. - // See: https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/org/apache/hc/client5/http/impl/classic/HttpClientBuilder.html - String proxyHost = "myproxy.local"; - int proxyPort = 8181; - HttpHost proxy = new HttpHost(proxyHost, proxyPort); - - DefaultProxyRoutePlanner routePlanner = new DefaultProxyRoutePlanner(proxy); - HttpClientBuilder httpclientBuilder = HttpClients.custom().setRoutePlanner(routePlanner); - - // Build MindeeHttpAPI using the HtppClientBuilder - MindeeHttpApi mindeeHttpApi = MindeeHttpApi.builder() - .mindeeSettings(new MindeeSettings("my-api-key")) - .httpClientBuilder(httpclientBuilder) - .build(); - - // Inject the MindeeHttpAPI instance directly into the MindeeClient - MindeeClient mindeeClient = new MindeeClient(mindeeHttpApi); - - // Parse a file as usual - PredictResponse invoiceDocument = mindeeClient.parse( - InvoiceV4.class, - LocalInputSource(new File("/path/to/the/file.ext")) - ); - } -} -``` - -### Loading a Source File - -Before being able to send a file 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 file is loaded, interacting with it is done in exactly the same way, regardless -of how it was loaded. - -Loading a file allows performing PDF operations on it. - -There are a few different ways of loading a document file, depending on your use case: - -- [File](#file-object) -- [Base64](#base64) -- [Byte Array](#bytes) - -You can also send distant files. -However, in this case nothing is done or can be done locally. - -- [URL](#URL) - -#### File Object - -Load a `java.io.File` object. -When using this option you do not need to pass in a file name - the API uses the `file.getName()` method to get the file name. - -**Note:** the server will not accept URLs containing a redirection. If your file is hidden behind one, you can download it and load it into a LocalInputSource using: - -```java -URLInputSource remoteSource = URLInputSource.builder( - "https://example.com/path/to/my/file.ext" -).build(); -remoteSource.fetchFile(); -LocalInputSource localSource = remoteSource.toLocalInputSource(); -``` - -```java -LocalInputSource localInputSource = new LocalInputSource( - new File("path/to/document/document.pdf") -); -``` - -#### Base64 - -Load file contents from a base64-encoded string. - -**Note**: The filename of the encoded file is required when calling the method. - -```java -String b64String = "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLD...."; -LocalInputSource localInputSource = new LocalInputSource(b64String, "document.pdf"); -``` - -#### Bytes - -Load file contents from a byte array. - -**Note**: The original filename of the encoded file is required when calling the method. - -```java -// Get Byte Array from a File, Multipart File, Input Stream, or as a method parameter -byte[] fileAsBytes = ....; -LocalInputSource localInputSource = new LocalInputSource(fileAsBytes, "document.pdf"); -PredictResponse response = mindeeClient.parse(InvoiceV4.class, LocalInputSource); -``` - -### URL - -Alternatively, an HTTPS URL can be loaded: - -```java -URL documentUrl = new URL("https://path/to/document"); -PredictResponse response = mindeeClient.parse(InvoiceV4.class, documentUrl); -``` - -### Parsing a Document - -The `MindeeClient` has multiple overloaded `parse` methods available for parsing the documents -and you will get `LocalInputSource`. - -This can be done by implicitly by calling the `parse(Class type)` method with the expected response type from -the parse method (`InvoiceResponse`, `ReceiptResponse`, `PassportResponse`, or even you custom class). - -Each document type available in the library has its corresponding `Response` class. -This is detailed in each document-specific guide. - -#### Off-the-Shelf Documents - -Simply setting the correct class is enough: - -```java -// After the document has been loaded -PredictResponse receiptV4Inference = mindeeClient.parse(ReceiptV4.class, localInputSource); -``` - -For more fine-grained control over parsing the documents you can have a look on the `parse` override method. - -#### Custom Documents (docTI) - -In this case, you will have two ways to handle them. - -The first one enables the possibility to use a class object which represents a kind of dictionary where, -keys will be the name of each field define in your Custom API model (`docTI` section on the Mindee platform). - -It also requires that you instantiate a new `Endpoint` object to define the information of your custom API built. - -```java -CustomEndpoint endpoint = new CustomEndpoint( - "wnine", - "john", - "1.0" // optional -); - -PredictResponse customDocument = mindeeClient.enqueueAndParse(localInputSource, endpoint); -``` - -The second one is using your own class. -See more information [here](#java-api-builder) - -### Processing the Response - -Regardless of the model, it will be encapsulated in a `Document` object and therefore will have the following attributes: - -- `inference` — [Inference](#inference) - -#### Inference - -Regroup the prediction on all the pages of the document and the prediction for all the document. - -- `documentPrediction` — [Document level prediction](#document-level-prediction) -- `pages` — [Page level prediction](#page-level-prediction) - -#### Document Level Prediction - -The Response object for each document type has an attribute that represents data extracted from the entire document. -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). - -```java -PredictResponse response = documentClient.parse( - InvoiceV4.class, - localInputSource -); - -// print the complete response -System.out.println(response.toString()); - -// print all prediction data -System.out.println(response.getDocument().toString()); - -// print the document-level prediction -System.out.println( - response.getDocument().getInference().getPrediction().toString() -); - -// print the page-level predictions -response.getDocument().getInference().getPages().forEach( - page -> System.out.println(page.toString()) -); -``` - -Each inference specific class will have its own specific attributes, these correspond to the various fields extracted from the document. - -#### Page Level Prediction - -The `pagesPrediction` attribute is a list of `prediction` objects, often of the same class as the [`documentPrediction` attribute](#document-level-prediction). -But sometimes, it could have a different class which would extend the `documentPrediction` class. - -Each page element contains the data extracted for a particular page of the document. - -# Questions? - -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/idcard_fr_v2.md b/docs/idcard_fr_v2.md deleted file mode 100644 index f97670121..000000000 --- a/docs/idcard_fr_v2.md +++ /dev/null @@ -1,297 +0,0 @@ ---- -title: FR Carte Nationale d'Identité OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-fr-carte-nationale-didentite-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Carte Nationale d'Identité API](https://platform.mindee.com/mindee/idcard_fr). - -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 OCR SDK. -![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 -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.PredictResponse; -import com.mindee.product.fr.idcard.IdCardV2; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(filePath); - - // Parse the file - PredictResponse response = mindeeClient.parse( - IdCardV2.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocument().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocument().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocument().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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<`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - - -### ClassificationField -The classification field `ClassificationField` extends `BaseField`, but also implements: -* **value** (`strong`): corresponds to the field value. -* **confidence** (`double`): the confidence score of the field prediction. - -> Note: a classification field's `value is always a `String`. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -### DateField -The date field `DateField` extends `BaseField`, but also implements: - -* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`. - -## 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 -**alternateName**: The alternate name of the card holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getAlternateName().value); -``` - -## Issuing Authority -**authority**: The name of the issuing authority. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getAuthority().value); -``` - -## Date of Birth -**birthDate**: The date of birth of the card holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getBirthDate().value); -``` - -## Place of Birth -**birthPlace**: The place of birth of the card holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getBirthPlace().value); -``` - -## Card Access Number -**cardAccessNumber**: The card access number (CAN). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCardAccessNumber().value); -``` - -## Document Number -**documentNumber**: The document number. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDocumentNumber().value); -``` - -## Document Sides -[📄](#page-level-fields "This field is only present on individual pages.")**documentSide**: The sides of the document which are visible. - -#### Possible values include: - - 'RECTO' - - 'VERSO' - - 'RECTO & VERSO' - -```java -for (ClassificationField documentSideElem : result.getDocument().getInference().getPrediction().getDocumentSide()) -{ - System.out.println(documentSideElem) - .value; -} -``` - -## Document Type -[📄](#page-level-fields "This field is only present on individual pages.")**documentType**: The document type or format. - -#### Possible values include: - - 'NEW' - - 'OLD' - -```java -for (ClassificationField documentTypeElem : result.getDocument().getInference().getPrediction().getDocumentType()) -{ - System.out.println(documentTypeElem) - .value; -} -``` - -## Expiry Date -**expiryDate**: The expiry date of the identification card. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getExpiryDate().value); -``` - -## Gender -**gender**: The gender of the card holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getGender().value); -``` - -## Given Name(s) -**givenNames**: The given name(s) of the card holder. - -```java -for (givenNamesElem : result.getDocument().getInference().getPrediction().getGivenNames()) -{ - System.out.println(givenNamesElem.value); -} -``` - -## Date of Issue -**issueDate**: The date of issue of the identification card. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getIssueDate().value); -``` - -## Mrz Line 1 -**mrz1**: The Machine Readable Zone, first line. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getMrz1().value); -``` - -## Mrz Line 2 -**mrz2**: The Machine Readable Zone, second line. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getMrz2().value); -``` - -## Mrz Line 3 -**mrz3**: The Machine Readable Zone, third line. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getMrz3().value); -``` - -## Nationality -**nationality**: The nationality of the card holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getNationality().value); -``` - -## Surname -**surname**: The surname of the card holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSurname().value); -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/ind_passport_v1.md b/docs/ind_passport_v1.md deleted file mode 100644 index 0a373545f..000000000 --- a/docs/ind_passport_v1.md +++ /dev/null @@ -1,307 +0,0 @@ ---- -title: IND Passport - India OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-ind-passport---india-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Passport - India API](https://platform.mindee.com/mindee/ind_passport). - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/ind_passport/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK. -![Passport - India sample](https://github.com/mindee/client-lib-test-data/blob/main/products/ind_passport/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.AsyncPredictResponse; -import com.mindee.product.ind.indianpassport.IndianPassportV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException, InterruptedException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(new File(filePath)); - - // Parse the file asynchronously - AsyncPredictResponse response = mindeeClient.enqueueAndParse( - IndianPassportV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocumentObj().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocumentObj().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocumentObj().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - - -### ClassificationField -The classification field `ClassificationField` extends `BaseField`, but also implements: -* **value** (`strong`): corresponds to the field value. -* **confidence** (`double`): the confidence score of the field prediction. - -> Note: a classification field's `value is always a `String`. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -### DateField -The date field `DateField` extends `BaseField`, but also implements: - -* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`. - -# Attributes -The following fields are extracted for Passport - India V1: - -## Address Line 1 -**address1**: The first line of the address of the passport holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getAddress1().value); -``` - -## Address Line 2 -**address2**: The second line of the address of the passport holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getAddress2().value); -``` - -## Address Line 3 -**address3**: The third line of the address of the passport holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getAddress3().value); -``` - -## Birth Date -**birthDate**: The birth date of the passport holder, ISO format: YYYY-MM-DD. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getBirthDate().value); -``` - -## Birth Place -**birthPlace**: The birth place of the passport holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getBirthPlace().value); -``` - -## Country -**country**: ISO 3166-1 alpha-3 country code (3 letters format). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCountry().value); -``` - -## Expiry Date -**expiryDate**: The date when the passport will expire, ISO format: YYYY-MM-DD. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getExpiryDate().value); -``` - -## File Number -**fileNumber**: The file number of the passport document. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getFileNumber().value); -``` - -## Gender -**gender**: The gender of the passport holder. - -#### Possible values include: - - 'M' - - 'F' - -```java -System.out.println(result.getDocument().getInference().getPrediction().getGender().value); -``` - -## Given Names -**givenNames**: The given names of the passport holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getGivenNames().value); -``` - -## ID Number -**idNumber**: The identification number of the passport document. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getIdNumber().value); -``` - -## Issuance Date -**issuanceDate**: The date when the passport was issued, ISO format: YYYY-MM-DD. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getIssuanceDate().value); -``` - -## Issuance Place -**issuancePlace**: The place where the passport was issued. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getIssuancePlace().value); -``` - -## Legal Guardian -**legalGuardian**: The name of the legal guardian of the passport holder (if applicable). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getLegalGuardian().value); -``` - -## MRZ Line 1 -**mrz1**: The first line of the machine-readable zone (MRZ) of the passport document. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getMrz1().value); -``` - -## MRZ Line 2 -**mrz2**: The second line of the machine-readable zone (MRZ) of the passport document. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getMrz2().value); -``` - -## Name of Mother -**nameOfMother**: The name of the mother of the passport holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getNameOfMother().value); -``` - -## Name of Spouse -**nameOfSpouse**: The name of the spouse of the passport holder (if applicable). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getNameOfSpouse().value); -``` - -## Old Passport Date of Issue -**oldPassportDateOfIssue**: The date of issue of the old passport (if applicable), ISO format: YYYY-MM-DD. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getOldPassportDateOfIssue().value); -``` - -## Old Passport Number -**oldPassportNumber**: The number of the old passport (if applicable). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getOldPassportNumber().value); -``` - -## Old Passport Place of Issue -**oldPassportPlaceOfIssue**: The place of issue of the old passport (if applicable). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getOldPassportPlaceOfIssue().value); -``` - -## Page Number -**pageNumber**: The page number of the passport document. - -#### Possible values include: - - '1' - - '2' - -```java -System.out.println(result.getDocument().getInference().getPrediction().getPageNumber().value); -``` - -## Surname -**surname**: The surname of the passport holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSurname().value); -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/international_id_v2.md b/docs/international_id_v2.md deleted file mode 100644 index 324b9ae94..000000000 --- a/docs/international_id_v2.md +++ /dev/null @@ -1,266 +0,0 @@ ---- -title: International ID OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-international-id-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [International ID API](https://platform.mindee.com/mindee/international_id). - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/international_id/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK. -![International ID sample](https://github.com/mindee/client-lib-test-data/blob/main/products/international_id/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.AsyncPredictResponse; -import com.mindee.product.internationalid.InternationalIdV2; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException, InterruptedException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(new File(filePath)); - - // Parse the file asynchronously - AsyncPredictResponse response = mindeeClient.enqueueAndParse( - InternationalIdV2.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocumentObj().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocumentObj().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocumentObj().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - - -### ClassificationField -The classification field `ClassificationField` extends `BaseField`, but also implements: -* **value** (`strong`): corresponds to the field value. -* **confidence** (`double`): the confidence score of the field prediction. - -> Note: a classification field's `value is always a `String`. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -### DateField -The date field `DateField` extends `BaseField`, but also implements: - -* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`. - -# Attributes -The following fields are extracted for International ID V2: - -## Address -**address**: The physical address of the document holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getAddress().value); -``` - -## Birth Date -**birthDate**: The date of birth of the document holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getBirthDate().value); -``` - -## Birth Place -**birthPlace**: The place of birth of the document holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getBirthPlace().value); -``` - -## Country of Issue -**countryOfIssue**: The country where the document was issued. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCountryOfIssue().value); -``` - -## Document Number -**documentNumber**: The unique identifier assigned to the document. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDocumentNumber().value); -``` - -## Document Type -**documentType**: The type of personal identification document. - -#### Possible values include: - - 'IDENTIFICATION_CARD' - - 'PASSPORT' - - 'DRIVER_LICENSE' - - 'VISA' - - 'RESIDENCY_CARD' - - 'VOTER_REGISTRATION' - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDocumentType().value); -``` - -## Expiration Date -**expiryDate**: The date when the document becomes invalid. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getExpiryDate().value); -``` - -## Given Names -**givenNames**: The list of the document holder's given names. - -```java -for (givenNamesElem : result.getDocument().getInference().getPrediction().getGivenNames()) -{ - System.out.println(givenNamesElem.value); -} -``` - -## Issue Date -**issueDate**: The date when the document was issued. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getIssueDate().value); -``` - -## MRZ Line 1 -**mrzLine1**: The Machine Readable Zone, first line. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getMrzLine1().value); -``` - -## MRZ Line 2 -**mrzLine2**: The Machine Readable Zone, second line. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getMrzLine2().value); -``` - -## MRZ Line 3 -**mrzLine3**: The Machine Readable Zone, third line. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getMrzLine3().value); -``` - -## Nationality -**nationality**: The country of citizenship of the document holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getNationality().value); -``` - -## Personal Number -**personalNumber**: The unique identifier assigned to the document holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getPersonalNumber().value); -``` - -## Sex -**sex**: The biological sex of the document holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSex().value); -``` - -## State of Issue -**stateOfIssue**: The state or territory where the document was issued. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getStateOfIssue().value); -``` - -## Surnames -**surnames**: The list of the document holder's family names. - -```java -for (surnamesElem : result.getDocument().getInference().getPrediction().getSurnames()) -{ - System.out.println(surnamesElem.value); -} -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/invoice_splitter_v1.md b/docs/invoice_splitter_v1.md deleted file mode 100644 index e966f0f9f..000000000 --- a/docs/invoice_splitter_v1.md +++ /dev/null @@ -1,125 +0,0 @@ ---- -title: Invoice Splitter OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-invoice-splitter-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Invoice Splitter API](https://platform.mindee.com/mindee/invoice_splitter). - -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 OCR SDK. -![Invoice Splitter sample](https://github.com/mindee/client-lib-test-data/blob/main/products/invoice_splitter/default_sample.pdf?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.AsyncPredictResponse; -import com.mindee.product.invoicesplitter.InvoiceSplitterV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException, InterruptedException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(new File(filePath)); - - // Parse the file asynchronously - AsyncPredictResponse response = mindeeClient.enqueueAndParse( - InvoiceSplitterV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocumentObj().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocumentObj().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocumentObj().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` 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: - -* **pageIndexes** (`List`): List of page indexes that belong to the same invoice (group). - -# Attributes -The following fields are extracted for Invoice Splitter V1: - -## Invoice Page Groups -**invoicePageGroups**(List<[InvoiceSplitterV1InvoicePageGroup](#invoice-page-groups-field)>): List of page groups. Each group represents a single invoice within a multi-invoice document. - -```java -for (invoicePageGroupsElem : result.getDocument().getInference().getPrediction().getInvoicePageGroups()) -{ - System.out.println(invoicePageGroupsElem.value); -} -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/invoices_v4.md b/docs/invoices_v4.md deleted file mode 100644 index 6927bdf49..000000000 --- a/docs/invoices_v4.md +++ /dev/null @@ -1,588 +0,0 @@ ---- -title: Invoice OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-invoice-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Invoice API](https://platform.mindee.com/mindee/invoices). - -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 OCR SDK. -![Invoice sample](https://github.com/mindee/client-lib-test-data/blob/main/products/invoices/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.PredictResponse; -import com.mindee.product.invoice.InvoiceV4; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(filePath); - - // Parse the file - PredictResponse response = mindeeClient.parse( - InvoiceV4.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocument().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocument().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocument().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -You can also call this product asynchronously: - -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.AsyncPredictResponse; -import com.mindee.product.invoice.InvoiceV4; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException, InterruptedException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(new File(filePath)); - - // Parse the file asynchronously - AsyncPredictResponse response = mindeeClient.enqueueAndParse( - InvoiceV4.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocumentObj().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocumentObj().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocumentObj().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` 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: - -* **streetNumber** (`String`): String representation of the street number. Can be `null`. -* **streetName** (`String`): Name of the street. Can be `null`. -* **poBox** (`String`): String representation of the PO Box number. Can be `null`. -* **addressComplement** (`String`): Address complement. Can be `null`. -* **city** (`String`): City name. Can be `null`. -* **postalcode** (`String`): String representation of the postal code. Can be `null`. -* **state** (`String`): State name. Can be `null`. -* **country** (`String`): Country name. Can be `null`. - -Note: The `value` field of an AddressField should be a concatenation of the rest of the values. - -### AmountField -An amount field `AmountField` extends `BaseField`, but also implements: -* **value** (`Double`): corresponds to the field value. Can be `null` if no value was extracted. - - -### ClassificationField -The classification field `ClassificationField` extends `BaseField`, but also implements: -* **value** (`strong`): corresponds to the field value. -* **confidence** (`double`): the confidence score of the field prediction. - -> Note: a classification field's `value is always a `String`. - - -### CompanyRegistrationField -Aside from the basic `BaseField` attributes, the company registration field `CompanyRegistrationField` also implements the following: - -* **type** (`String`): the type of company. -* **value** (`String`): corresponds to the field value. -* **toTableLine()**: a method that formats the data to fit in a .rst display. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -### DateField -The date field `DateField` extends `BaseField`, but also implements: - -* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`. - -### LocaleField -The locale field `LocaleField` extends `BaseField`, but also implements: - -* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`. -* **language** (`String`): ISO 639-1 language code (e.g.: `en` for English). Can be `null`. -* **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 `null`. -* **currency** (`String`): ISO 4217 code for currencies (e.g.: `USD` for "US Dollars"). Can be `null`. - -### Taxes -#### TaxField -Aside from the basic `BaseField` attributes, the tax field `TaxField` also implements the following: - -* **rate** (`Double`): the tax rate applied to an item expressed as a percentage. Can be `null`. -* **code** (`String`): tax code (or equivalent, depending on the origin of the document). -* **base** (`Double`): base amount used for the tax. Can be `null`. -* **value** (`Double`): the value of the tax. Can be `null`. - -> Note: currently `TaxField` is not used on its own, and is accessed through a parent `Taxes` object, a list-like structure. - -#### Taxes (List) -The `Taxes` field represents a List of `TaxField` objects. As it is the representation of several objects, it has access to a custom `toString` 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. -* **productCode** (`String`): The product code of the item. -* **quantity** (`Double`): The item quantity -* **taxAmount** (`Double`): The item tax amount. -* **taxRate** (`Double`): The item tax rate in percentage. -* **totalAmount** (`Double`): The item total amount. -* **unitMeasure** (`String`): The item unit of measure. -* **unitPrice** (`Double`): The item unit price. - -# Attributes -The following fields are extracted for Invoice V4: - -## Billing Address -**billingAddress**: The customer billing address. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getBillingAddress().value); -``` - -## Purchase Category -**category**: The purchase category. - -#### Possible values include: - - 'toll' - - 'food' - - 'parking' - - 'transport' - - 'accommodation' - - 'telecom' - - 'miscellaneous' - - 'software' - - 'shopping' - - 'energy' - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCategory().value); -``` - -## Customer Address -**customerAddress**: The address of the customer. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCustomerAddress().value); -``` - -## Customer Company Registrations -**customerCompanyRegistrations**: List of company registration numbers associated to the customer. - -```java -for (customerCompanyRegistrationsElem : result.getDocument().getInference().getPrediction().getCustomerCompanyRegistrations()) -{ - System.out.println(customerCompanyRegistrationsElem.value); -} -``` - -## Customer ID -**customerId**: The customer account number or identifier from the supplier. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCustomerId().value); -``` - -## Customer Name -**customerName**: The name of the customer or client. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCustomerName().value); -``` - -## Purchase Date -**date**: The date the purchase was made. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDate().value); -``` - -## Document Type -**documentType**: Document type: INVOICE or CREDIT NOTE. - -#### Possible values include: - - 'INVOICE' - - 'CREDIT NOTE' - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDocumentType().value); -``` - -## Document Type Extended -**documentTypeExtended**: Document type extended. - -#### Possible values include: - - 'CREDIT NOTE' - - 'INVOICE' - - 'OTHER' - - 'OTHER_FINANCIAL' - - 'PAYSLIP' - - 'PURCHASE ORDER' - - 'QUOTE' - - 'RECEIPT' - - 'STATEMENT' - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDocumentTypeExtended().value); -``` - -## Due Date -**dueDate**: The date on which the payment is due. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDueDate().value); -``` - -## Invoice Number -**invoiceNumber**: The invoice number or identifier. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getInvoiceNumber().value); -``` - -## Line Items -**lineItems**(List<[InvoiceV4LineItem](#line-items-field)>): List of all the line items present on the invoice. - -```java -for (lineItemsElem : result.getDocument().getInference().getPrediction().getLineItems()) -{ - System.out.println(lineItemsElem.value); -} -``` - -## Locale -**locale**: The locale of the document. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getLocale().value); -``` - -## Payment Date -**paymentDate**: The date on which the payment is due / was full-filled. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getPaymentDate().value); -``` - -## Purchase Order Number -**poNumber**: The purchase order number. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getPoNumber().value); -``` - -## Reference Numbers -**referenceNumbers**: List of all reference numbers on the invoice, including the purchase order number. - -```java -for (referenceNumbersElem : result.getDocument().getInference().getPrediction().getReferenceNumbers()) -{ - System.out.println(referenceNumbersElem.value); -} -``` - -## Shipping Address -**shippingAddress**: Customer's delivery address. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getShippingAddress().value); -``` - -## Purchase Subcategory -**subcategory**: 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' - - null - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSubcategory().value); -``` - -## Supplier Address -**supplierAddress**: The address of the supplier or merchant. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSupplierAddress().value); -``` - -## Supplier Company Registrations -**supplierCompanyRegistrations**: List of company registration numbers associated to the supplier. - -```java -for (supplierCompanyRegistrationsElem : result.getDocument().getInference().getPrediction().getSupplierCompanyRegistrations()) -{ - System.out.println(supplierCompanyRegistrationsElem.value); -} -``` - -## Supplier Email -**supplierEmail**: The email address of the supplier or merchant. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSupplierEmail().value); -``` - -## Supplier Name -**supplierName**: The name of the supplier or merchant. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSupplierName().value); -``` - -## Supplier Payment Details -**supplierPaymentDetails**: List of payment details associated to the supplier of the invoice. - -```java -for (supplierPaymentDetailsElem : result.getDocument().getInference().getPrediction().getSupplierPaymentDetails()) -{ - System.out.println(supplierPaymentDetailsElemvalue); - System.out.println(supplierPaymentDetailsElem.rate); - System.out.println(supplierPaymentDetailsElem.code); - System.out.println(supplierPaymentDetailsElem.base); -} -``` - -## Supplier Phone Number -**supplierPhoneNumber**: The phone number of the supplier or merchant. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSupplierPhoneNumber().value); -``` - -## Supplier Website -**supplierWebsite**: The website URL of the supplier or merchant. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSupplierWebsite().value); -``` - -## Taxes -**taxes**: List of taxes. Each item contains the detail of the tax. - -```java -for (taxesElem : result.getDocument().getInference().getPrediction().getTaxes()) -{ - System.out.println(taxesElem.value); -} -``` - -## Total Amount -**totalAmount**: The total amount of the invoice: includes taxes, tips, fees, and other charges. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTotalAmount().value); -``` - -## Total Net -**totalNet**: The net amount of the invoice: does not include taxes, fees, and discounts. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTotalNet().value); -``` - -## Total Tax -**totalTax**: The total tax: the sum of all the taxes for this invoice. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTotalTax().value); -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/java-field.md b/docs/java-field.md deleted file mode 100644 index 26ea32d5f..000000000 --- a/docs/java-field.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: 'Java Library: Output Fields' -category: 622b805aaec68102ea7fcbc2 -slug: java-field -parentDoc: 631a062c3718850f3519b793 ---- - -# Field Objects -Each `Field` contains attributes representing the data that is returned from the API. -The exact data structure depends on the type of the field. Most `Field` classes have an attribute named `value`. -The data type of the `value` attribute varies between field types. - -All Field classes contain some common data types - -* `confidence` (Double): - The confidence score of the field prediction. -* `polygon` (`Polygon` containing a `List`): - Contains the relative vertices coordinates (points) of a polygon containing the field in the image. -* `reconstructed` (Boolean): - True if the field was reconstructed or computed using other fields. -* `rawValue` (String): - A string representing the field that was returned. -* `boundingBox` (`Polygon` containing a `List`): Represents the [bounding box](https://en.wikipedia.org/wiki/Minimum_bounding_box) containing the field in the image - -The library uses the following classes to represents common field types -* [Amount](#amount) -* [Date](#date) -* [Field](#field) -* [Locale](#locale) -* [Orientation](#orientation) -* [PaymentDetails](#payment-details) -* [Tax](#tax) -* [Time](#time) - -### Amount -Used to represent sum totals, monetary value etc. The `value` attribute is of type `java.lang.Double` - -### Date -The `value` attribute is of type `java.Time.LocalDate` - -### Field -Used to represent text fields and fields whose value is captured as `String`. -This type also has a map attribute `extraFields` that represents any additional fields returned from the api. - -* The `value` attribute is of type `java.lang.String`\ -* The `extraFields` is a map of type `Map` - -### Locale -The `value` attribute is of type `java.util.Locale`\ -This class also contains additional attributes containing String representations of the available locale information returned by the API. - -* `language` of type `java.lang.String` - Language code in [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format as seen on the document. - The following language codes are supported: `ca`, `de`, `en`, `es`, `fr`, `it`, `nl` and `pt`. -* `country` of type `java.lang.String` - Currency code in [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format as seen on the document. - The following country codes are supported: `CAD`, `CHF`, `GBP`, `EUR`, `USD`. -* `currency` of type `java.lang.String` - Country code in [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) alpha-2 format as seen on the document. - The following country codes are supported: `CA`, `CH`, `DE`, `ES`, `FR,` `GB`, `IT`, `NL`, `PT` and `US`. - -### 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 - -The `value` attribute of type `java.lang.Integer` is set to one of 0, 90, or 270 - -### Payment Details -This field type captures information related to the payment details for vendors -* `iban` of type `java.lang.String` -* `swift` of type `java.lang.String` -* `routingNumber` of type `java.lang.String` -* `accountNumber` of type `java.lang.String` - -### Tax -This field type captures tax information - -* `value` of type `java.lang.Double` represents the tax amount. -* `code` of type `java.lang.String` represents The tax code (HST, GST, City Tax, State tax for US, etc..). -* `rate` of type `java.lang.Double` represents the tax rate. - -### Time -The `value` attribute is of type `java.time.LocalTime` - -## Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/multi_receipts_detector_v1.md b/docs/multi_receipts_detector_v1.md deleted file mode 100644 index dee11e93a..000000000 --- a/docs/multi_receipts_detector_v1.md +++ /dev/null @@ -1,137 +0,0 @@ ---- -title: Multi Receipts Detector OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-multi-receipts-detector-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Multi Receipts Detector API](https://platform.mindee.com/mindee/multi_receipts_detector). - -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 OCR SDK. -![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 -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.PredictResponse; -import com.mindee.product.multireceiptsdetector.MultiReceiptsDetectorV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(filePath); - - // Parse the file - PredictResponse response = mindeeClient.parse( - MultiReceiptsDetectorV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocument().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocument().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocument().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - - -### PositionField -The position field `PositionField` implements: - -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **rectangle** (`Polygon`): a polygon with four points that may be oriented (even beyond canvas). -* **quadrangle** (`Polygon`): a free polygon made up of four points. - -# Attributes -The following fields are extracted for Multi Receipts Detector V1: - -## List of Receipts -**receipts**: Positions of the receipts on the document. - -```java -for (receiptsElem : result.getDocument().getInference().getPrediction().getReceipts()) -{ - System.out.println(receiptsElem.polygon); - System.out.println(receiptsElem.quadrangle); - System.out.println(receiptsElem.rectangle); - System.out.println(receiptsElem.boundingBox); -} -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/nutrition_facts_v1.md b/docs/nutrition_facts_v1.md deleted file mode 100644 index bf49ff5e6..000000000 --- a/docs/nutrition_facts_v1.md +++ /dev/null @@ -1,397 +0,0 @@ ---- -title: Nutrition Facts Label OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-nutrition-facts-label-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Nutrition Facts Label API](https://platform.mindee.com/mindee/nutrition_facts). - -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 OCR SDK. -![Nutrition Facts Label sample](https://github.com/mindee/client-lib-test-data/blob/main/products/nutrition_facts/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.AsyncPredictResponse; -import com.mindee.product.nutritionfactslabel.NutritionFactsLabelV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException, InterruptedException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(new File(filePath)); - - // Parse the file asynchronously - AsyncPredictResponse response = mindeeClient.enqueueAndParse( - NutritionFactsLabelV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocumentObj().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocumentObj().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocumentObj().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - -### AmountField -An amount field `AmountField` extends `BaseField`, but also implements: -* **value** (`Double`): corresponds to the field value. Can be `null` if no value was extracted. - -## Specific Fields -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: - -* **dailyValue** (`Double`): DVs are the recommended amounts of added sugars to consume or not to exceed each day. -* **per100G** (`Double`): The amount of added sugars per 100g of the product. -* **perServing** (`Double`): 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. - -### Calories Field -The amount of calories in the product. - -A `NutritionFactsLabelV1Calorie` implements the following attributes: - -* **dailyValue** (`Double`): DVs are the recommended amounts of calories to consume or not to exceed each day. -* **per100G** (`Double`): The amount of calories per 100g of the product. -* **perServing** (`Double`): The amount of calories 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: - -* **dailyValue** (`Double`): DVs are the recommended amounts of cholesterol to consume or not to exceed each day. -* **per100G** (`Double`): The amount of cholesterol per 100g of the product. -* **perServing** (`Double`): The amount of cholesterol 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: - -* **dailyValue** (`Double`): DVs are the recommended amounts of dietary fiber to consume or not to exceed each day. -* **per100G** (`Double`): The amount of dietary fiber per 100g of the product. -* **perServing** (`Double`): 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. - -### nutrients Field -The amount of nutrients in the product. - -A `NutritionFactsLabelV1Nutrient` implements the following attributes: - -* **dailyValue** (`Double`): DVs are the recommended amounts of nutrients to consume or not to exceed each day. -* **name** (`String`): The name of nutrients of the product. -* **per100G** (`Double`): The amount of nutrients per 100g of the product. -* **perServing** (`Double`): The amount of nutrients per serving of the product. -* **unit** (`String`): The unit of measurement for the amount of nutrients. -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: - -* **dailyValue** (`Double`): DVs are the recommended amounts of protein to consume or not to exceed each day. -* **per100G** (`Double`): The amount of protein per 100g of the product. -* **perServing** (`Double`): The amount of protein 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: - -* **dailyValue** (`Double`): DVs are the recommended amounts of saturated fat to consume or not to exceed each day. -* **per100G** (`Double`): The amount of saturated fat per 100g of the product. -* **perServing** (`Double`): 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. - -### Serving Size Field -The size of a single serving of the product. - -A `NutritionFactsLabelV1ServingSize` implements the following attributes: - -* **amount** (`Double`): 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. - -### sodium Field -The amount of sodium in the product. - -A `NutritionFactsLabelV1Sodium` implements the following attributes: - -* **dailyValue** (`Double`): DVs are the recommended amounts of sodium to consume or not to exceed each day. -* **per100G** (`Double`): The amount of sodium per 100g of the product. -* **perServing** (`Double`): 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. - -### Total Carbohydrate Field -The total amount of carbohydrates in the product. - -A `NutritionFactsLabelV1TotalCarbohydrate` implements the following attributes: - -* **dailyValue** (`Double`): DVs are the recommended amounts of total carbohydrates to consume or not to exceed each day. -* **per100G** (`Double`): The amount of total carbohydrates per 100g of the product. -* **perServing** (`Double`): 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. - -### Total Fat Field -The total amount of fat in the product. - -A `NutritionFactsLabelV1TotalFat` implements the following attributes: - -* **dailyValue** (`Double`): DVs are the recommended amounts of total fat to consume or not to exceed each day. -* **per100G** (`Double`): The amount of total fat per 100g of the product. -* **perServing** (`Double`): 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. - -### Total Sugars Field -The total amount of sugars in the product. - -A `NutritionFactsLabelV1TotalSugar` implements the following attributes: - -* **dailyValue** (`Double`): DVs are the recommended amounts of total sugars to consume or not to exceed each day. -* **per100G** (`Double`): The amount of total sugars per 100g of the product. -* **perServing** (`Double`): 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. - -### Trans Fat Field -The amount of trans fat in the product. - -A `NutritionFactsLabelV1TransFat` implements the following attributes: - -* **dailyValue** (`Double`): DVs are the recommended amounts of trans fat to consume or not to exceed each day. -* **per100G** (`Double`): The amount of trans fat per 100g of the product. -* **perServing** (`Double`): The amount of trans fat per serving of the product. - -# Attributes -The following fields are extracted for Nutrition Facts Label V1: - -## Added Sugars -**addedSugars**([NutritionFactsLabelV1AddedSugar](#added-sugars-field)): The amount of added sugars in the product. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getAddedSugars().value); -``` - -## Calories -**calories**([NutritionFactsLabelV1Calorie](#calories-field)): The amount of calories in the product. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCalories().value); -``` - -## Cholesterol -**cholesterol**([NutritionFactsLabelV1Cholesterol](#cholesterol-field)): The amount of cholesterol in the product. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCholesterol().value); -``` - -## Dietary Fiber -**dietaryFiber**([NutritionFactsLabelV1DietaryFiber](#dietary-fiber-field)): The amount of dietary fiber in the product. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDietaryFiber().value); -``` - -## nutrients -**nutrients**(List<[NutritionFactsLabelV1Nutrient](#nutrients-field)>): The amount of nutrients in the product. - -```java -for (nutrientsElem : result.getDocument().getInference().getPrediction().getNutrients()) -{ - System.out.println(nutrientsElem.value); -} -``` - -## Protein -**protein**([NutritionFactsLabelV1Protein](#protein-field)): The amount of protein in the product. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getProtein().value); -``` - -## Saturated Fat -**saturatedFat**([NutritionFactsLabelV1SaturatedFat](#saturated-fat-field)): The amount of saturated fat in the product. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSaturatedFat().value); -``` - -## Serving per Box -**servingPerBox**: The number of servings in each box of the product. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getServingPerBox().value); -``` - -## Serving Size -**servingSize**([NutritionFactsLabelV1ServingSize](#serving-size-field)): The size of a single serving of the product. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getServingSize().value); -``` - -## sodium -**sodium**([NutritionFactsLabelV1Sodium](#sodium-field)): The amount of sodium in the product. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSodium().value); -``` - -## Total Carbohydrate -**totalCarbohydrate**([NutritionFactsLabelV1TotalCarbohydrate](#total-carbohydrate-field)): The total amount of carbohydrates in the product. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTotalCarbohydrate().value); -``` - -## Total Fat -**totalFat**([NutritionFactsLabelV1TotalFat](#total-fat-field)): The total amount of fat in the product. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTotalFat().value); -``` - -## Total Sugars -**totalSugars**([NutritionFactsLabelV1TotalSugar](#total-sugars-field)): The total amount of sugars in the product. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTotalSugars().value); -``` - -## Trans Fat -**transFat**([NutritionFactsLabelV1TransFat](#trans-fat-field)): The amount of trans fat in the product. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getTransFat().value); -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/passport_v1.md b/docs/passport_v1.md deleted file mode 100644 index 74873db6d..000000000 --- a/docs/passport_v1.md +++ /dev/null @@ -1,215 +0,0 @@ ---- -title: Passport OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-passport-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Passport API](https://platform.mindee.com/mindee/passport). - -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 OCR SDK. -![Passport sample](https://github.com/mindee/client-lib-test-data/blob/main/products/passport/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.PredictResponse; -import com.mindee.product.passport.PassportV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(filePath); - - // Parse the file - PredictResponse response = mindeeClient.parse( - PassportV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocument().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocument().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocument().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -### DateField -The date field `DateField` extends `BaseField`, but also implements: - -* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`. - -# Attributes -The following fields are extracted for Passport V1: - -## Date of Birth -**birthDate**: The date of birth of the passport holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getBirthDate().value); -``` - -## Place of Birth -**birthPlace**: The place of birth of the passport holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getBirthPlace().value); -``` - -## Country Code -**country**: The country's 3 letter code (ISO 3166-1 alpha-3). - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCountry().value); -``` - -## Expiry Date -**expiryDate**: The expiry date of the passport. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getExpiryDate().value); -``` - -## Gender -**gender**: The gender of the passport holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getGender().value); -``` - -## Given Name(s) -**givenNames**: The given name(s) of the passport holder. - -```java -for (givenNamesElem : result.getDocument().getInference().getPrediction().getGivenNames()) -{ - System.out.println(givenNamesElem.value); -} -``` - -## ID Number -**idNumber**: The passport's identification number. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getIdNumber().value); -``` - -## Date of Issue -**issuanceDate**: The date the passport was issued. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getIssuanceDate().value); -``` - -## MRZ Line 1 -**mrz1**: Machine Readable Zone, first line - -```java -System.out.println(result.getDocument().getInference().getPrediction().getMrz1().value); -``` - -## MRZ Line 2 -**mrz2**: Machine Readable Zone, second line - -```java -System.out.println(result.getDocument().getInference().getPrediction().getMrz2().value); -``` - -## Surname -**surname**: The surname of the passport holder. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSurname().value); -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/payslip_fra_v3.md b/docs/payslip_fra_v3.md deleted file mode 100644 index 72d1f6d02..000000000 --- a/docs/payslip_fra_v3.md +++ /dev/null @@ -1,343 +0,0 @@ ---- -title: FR Payslip OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-fr-payslip-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Payslip API](https://platform.mindee.com/mindee/payslip_fra). - -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 OCR SDK. -![Payslip sample](https://github.com/mindee/client-lib-test-data/blob/main/products/payslip_fra/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.AsyncPredictResponse; -import com.mindee.product.fr.payslip.PayslipV3; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException, InterruptedException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(new File(filePath)); - - // Parse the file asynchronously - AsyncPredictResponse response = mindeeClient.enqueueAndParse( - PayslipV3.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocumentObj().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocumentObj().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocumentObj().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` 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. - -### Bank Account Details Field -Information about the employee's bank account. - -A `PayslipV3BankAccountDetail` implements the following attributes: - -* **bankName** (`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. - -### Employee Field -Information about the employee. - -A `PayslipV3Employee` implements the following attributes: - -* **address** (`String`): The address of the employee. -* **dateOfBirth** (`String`): The date of birth of the employee. -* **firstName** (`String`): The first name of the employee. -* **lastName** (`String`): The last name of the employee. -* **phoneNumber** (`String`): The phone number of the employee. -* **registrationNumber** (`String`): The registration number of the employee. -* **socialSecurityNumber** (`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. -* **companyId** (`String`): The company ID of the employer. -* **companySite** (`String`): The site of the company. -* **nafCode** (`String`): The NAF code of the employer. -* **name** (`String`): The name of the employer. -* **phoneNumber** (`String`): The phone number of the employer. -* **urssafNumber** (`String`): The URSSAF number of the employer. -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. -* **collectiveAgreement** (`String`): The collective agreement of the employment. -* **jobTitle** (`String`): The job title of the employee. -* **positionLevel** (`String`): The position level of the employment. -* **seniorityDate** (`String`): The seniority date of the employment. -* **startDate** (`String`): The start date of the employment. -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** (`Double`): 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 - -* **ptoType** (`String`): The type of paid time off. - -#### Possible values include: - - VACATION - - RTT - - COMPENSATORY - -* **remaining** (`Double`): The remaining amount of paid time off at the end of the period. -* **used** (`Double`): The amount of paid time off used in the period. -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: - -* **grossSalary** (`Double`): The gross salary of the employee. -* **grossSalaryYtd** (`Double`): The year-to-date gross salary of the employee. -* **incomeTaxRate** (`Double`): The income tax rate of the employee. -* **incomeTaxWithheld** (`Double`): The income tax withheld from the employee's pay. -* **netPaid** (`Double`): The net paid amount of the employee. -* **netPaidBeforeTax** (`Double`): The net paid amount before tax of the employee. -* **netTaxable** (`Double`): The net taxable amount of the employee. -* **netTaxableYtd** (`Double`): The year-to-date net taxable amount of the employee. -* **totalCostEmployer** (`Double`): The total cost to the employer. -* **totalTaxesAndDeductions** (`Double`): The total taxes and deductions of the employee. -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: - -* **endDate** (`String`): The end date of the pay period. -* **month** (`String`): The month of the pay period. -* **paymentDate** (`String`): The date of payment for the pay period. -* **startDate** (`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. - -### Salary Details Field -Detailed information about the earnings. - -A `PayslipV3SalaryDetail` implements the following attributes: - -* **amount** (`Double`): The amount of the earning. -* **base** (`Double`): The base rate value of the earning. -* **description** (`String`): The description of the earnings. -* **number** (`Double`): The number of units in the earning. -* **rate** (`Double`): The rate of the earning. - -# Attributes -The following fields are extracted for Payslip V3: - -## Bank Account Details -**bankAccountDetails**([PayslipV3BankAccountDetail](#bank-account-details-field)): Information about the employee's bank account. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getBankAccountDetails().value); -``` - -## Employee -**employee**([PayslipV3Employee](#employee-field)): Information about the employee. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getEmployee().value); -``` - -## Employer -**employer**([PayslipV3Employer](#employer-field)): Information about the employer. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getEmployer().value); -``` - -## Employment -**employment**([PayslipV3Employment](#employment-field)): Information about the employment. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getEmployment().value); -``` - -## Paid Time Off -**paidTimeOff**(List<[PayslipV3PaidTimeOff](#paid-time-off-field)>): Information about paid time off. - -```java -for (paidTimeOffElem : result.getDocument().getInference().getPrediction().getPaidTimeOff()) -{ - System.out.println(paidTimeOffElem.value); -} -``` - -## Pay Detail -**payDetail**([PayslipV3PayDetail](#pay-detail-field)): Detailed information about the pay. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getPayDetail().value); -``` - -## Pay Period -**payPeriod**([PayslipV3PayPeriod](#pay-period-field)): Information about the pay period. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getPayPeriod().value); -``` - -## Salary Details -**salaryDetails**(List<[PayslipV3SalaryDetail](#salary-details-field)>): Detailed information about the earnings. - -```java -for (salaryDetailsElem : result.getDocument().getInference().getPrediction().getSalaryDetails()) -{ - System.out.println(salaryDetailsElem.value); -} -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/resume_v1.md b/docs/resume_v1.md deleted file mode 100644 index 82eebe3a2..000000000 --- a/docs/resume_v1.md +++ /dev/null @@ -1,393 +0,0 @@ ---- -title: Resume OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-resume-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Resume API](https://platform.mindee.com/mindee/resume). - -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 OCR SDK. -![Resume sample](https://github.com/mindee/client-lib-test-data/blob/main/products/resume/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.AsyncPredictResponse; -import com.mindee.product.resume.ResumeV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException, InterruptedException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(new File(filePath)); - - // Parse the file asynchronously - AsyncPredictResponse response = mindeeClient.enqueueAndParse( - ResumeV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocumentObj().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocumentObj().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocumentObj().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - - -### ClassificationField -The classification field `ClassificationField` extends `BaseField`, but also implements: -* **value** (`strong`): corresponds to the field value. -* **confidence** (`double`): the confidence score of the field prediction. - -> Note: a classification field's `value is always a `String`. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -## Specific Fields -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. -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: - -* **degreeDomain** (`String`): The area of study or specialization. -* **degreeType** (`String`): The type of degree obtained, such as Bachelor's, Master's, or Doctorate. -* **endMonth** (`String`): The month when the education program or course was completed. -* **endYear** (`String`): The year when the education program or course was completed. -* **school** (`String`): The name of the school. -* **startMonth** (`String`): The month when the education program or course began. -* **startYear** (`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. - -### 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. - -### Professional Experiences Field -The list of the candidate's professional experiences. - -A `ResumeV1ProfessionalExperience` implements the following attributes: - -* **contractType** (`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. -* **endMonth** (`String`): The month when the professional experience ended. -* **endYear** (`String`): The year when the professional experience ended. -* **role** (`String`): The position or job title held by the candidate. -* **startMonth** (`String`): The month when the professional experience began. -* **startYear** (`String`): The year when the professional experience began. -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. - -# Attributes -The following fields are extracted for Resume V1: - -## Address -**address**: The location information of the candidate, including city, state, and country. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getAddress().value); -``` - -## Certificates -**certificates**(List<[ResumeV1Certificate](#certificates-field)>): The list of certificates obtained by the candidate. - -```java -for (certificatesElem : result.getDocument().getInference().getPrediction().getCertificates()) -{ - System.out.println(certificatesElem.value); -} -``` - -## Document Language -**documentLanguage**: The ISO 639 code of the language in which the document is written. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDocumentLanguage().value); -``` - -## Document Type -**documentType**: The type of the document sent. - -#### Possible values include: - - 'RESUME' - - 'MOTIVATION_LETTER' - - 'RECOMMENDATION_LETTER' - -```java -System.out.println(result.getDocument().getInference().getPrediction().getDocumentType().value); -``` - -## Education -**education**(List<[ResumeV1Education](#education-field)>): The list of the candidate's educational background. - -```java -for (educationElem : result.getDocument().getInference().getPrediction().getEducation()) -{ - System.out.println(educationElem.value); -} -``` - -## Email Address -**emailAddress**: The email address of the candidate. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getEmailAddress().value); -``` - -## Given Names -**givenNames**: The candidate's first or given names. - -```java -for (givenNamesElem : result.getDocument().getInference().getPrediction().getGivenNames()) -{ - System.out.println(givenNamesElem.value); -} -``` - -## Hard Skills -**hardSkills**: The list of the candidate's technical abilities and knowledge. - -```java -for (hardSkillsElem : result.getDocument().getInference().getPrediction().getHardSkills()) -{ - System.out.println(hardSkillsElem.value); -} -``` - -## Job Applied -**jobApplied**: The position that the candidate is applying for. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getJobApplied().value); -``` - -## Languages -**languages**(List<[ResumeV1Language](#languages-field)>): The list of languages that the candidate is proficient in. - -```java -for (languagesElem : result.getDocument().getInference().getPrediction().getLanguages()) -{ - System.out.println(languagesElem.value); -} -``` - -## Nationality -**nationality**: The ISO 3166 code for the country of citizenship of the candidate. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getNationality().value); -``` - -## Phone Number -**phoneNumber**: The phone number of the candidate. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getPhoneNumber().value); -``` - -## Profession -**profession**: The candidate's current profession. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getProfession().value); -``` - -## Professional Experiences -**professionalExperiences**(List<[ResumeV1ProfessionalExperience](#professional-experiences-field)>): The list of the candidate's professional experiences. - -```java -for (professionalExperiencesElem : result.getDocument().getInference().getPrediction().getProfessionalExperiences()) -{ - System.out.println(professionalExperiencesElem.value); -} -``` - -## Social Networks -**socialNetworksUrls**(List<[ResumeV1SocialNetworksUrl](#social-networks-field)>): The list of social network profiles of the candidate. - -```java -for (socialNetworksUrlsElem : result.getDocument().getInference().getPrediction().getSocialNetworksUrls()) -{ - System.out.println(socialNetworksUrlsElem.value); -} -``` - -## Soft Skills -**softSkills**: The list of the candidate's interpersonal and communication abilities. - -```java -for (softSkillsElem : result.getDocument().getInference().getPrediction().getSoftSkills()) -{ - System.out.println(softSkillsElem.value); -} -``` - -## Surnames -**surnames**: The candidate's last names. - -```java -for (surnamesElem : result.getDocument().getInference().getPrediction().getSurnames()) -{ - System.out.println(surnamesElem.value); -} -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/us_healthcare_cards_v1.md b/docs/us_healthcare_cards_v1.md deleted file mode 100644 index e0f403248..000000000 --- a/docs/us_healthcare_cards_v1.md +++ /dev/null @@ -1,259 +0,0 @@ ---- -title: US Healthcare Card OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-us-healthcare-card-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [Healthcare Card API](https://platform.mindee.com/mindee/us_healthcare_cards). - -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 OCR SDK. -![Healthcare Card sample](https://github.com/mindee/client-lib-test-data/blob/main/products/us_healthcare_cards/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.AsyncPredictResponse; -import com.mindee.product.us.healthcarecard.HealthcareCardV1; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException, InterruptedException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(new File(filePath)); - - // Parse the file asynchronously - AsyncPredictResponse response = mindeeClient.enqueueAndParse( - HealthcareCardV1.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocumentObj().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocumentObj().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocumentObj().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**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. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -### DateField -The date field `DateField` extends `BaseField`, but also implements: - -* **value** (`LocalDate`): an accessible representation of the value as a Java object. Can be `null`. - -## 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: - -* **serviceFees** (`Double`): The price of the service. -* **serviceName** (`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 -**companyName**: The name of the company that provides the healthcare plan. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getCompanyName().value); -``` - -## Copays -**copays**(List<[HealthcareCardV1Copay](#copays-field)>): Copayments for covered services. - -```java -for (copaysElem : result.getDocument().getInference().getPrediction().getCopays()) -{ - System.out.println(copaysElem.value); -} -``` - -## Dependents -**dependents**: The list of dependents covered by the healthcare plan. - -```java -for (dependentsElem : result.getDocument().getInference().getPrediction().getDependents()) -{ - System.out.println(dependentsElem.value); -} -``` - -## Enrollment Date -**enrollmentDate**: The date when the member enrolled in the healthcare plan. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getEnrollmentDate().value); -``` - -## Group Number -**groupNumber**: The group number associated with the healthcare plan. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getGroupNumber().value); -``` - -## Issuer 80840 -**issuer80840**: The organization that issued the healthcare plan. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getIssuer80840().value); -``` - -## Member ID -**memberId**: The unique identifier for the member in the healthcare system. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getMemberId().value); -``` - -## Member Name -**memberName**: The name of the member covered by the healthcare plan. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getMemberName().value); -``` - -## Payer ID -**payerId**: The unique identifier for the payer in the healthcare system. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getPayerId().value); -``` - -## Plan Name -**planName**: The name of the healthcare plan. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getPlanName().value); -``` - -## RX BIN -**rxBin**: The BIN number for prescription drug coverage. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getRxBin().value); -``` - -## RX GRP -**rxGrp**: The group number for prescription drug coverage. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getRxGrp().value); -``` - -## RX ID -**rxId**: The ID number for prescription drug coverage. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getRxId().value); -``` - -## RX PCN -**rxPcn**: The PCN number for prescription drug coverage. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getRxPcn().value); -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g) diff --git a/docs/us_mail_v3.md b/docs/us_mail_v3.md deleted file mode 100644 index d2a086b8e..000000000 --- a/docs/us_mail_v3.md +++ /dev/null @@ -1,191 +0,0 @@ ---- -title: US US Mail OCR Java -category: 622b805aaec68102ea7fcbc2 -slug: java-us-us-mail-ocr -parentDoc: 631a062c3718850f3519b793 ---- -The Java OCR SDK supports the [US Mail API](https://platform.mindee.com/mindee/us_mail). - -Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/us_mail/default_sample.jpg), we are going to illustrate how to extract the data that we want using the OCR SDK. -![US Mail sample](https://github.com/mindee/client-lib-test-data/blob/main/products/us_mail/default_sample.jpg?raw=true) - -# Quick-Start -```java -import com.mindee.MindeeClient; -import com.mindee.input.LocalInputSource; -import com.mindee.parsing.common.AsyncPredictResponse; -import com.mindee.product.us.usmail.UsMailV3; -import java.io.File; -import java.io.IOException; - -public class SimpleMindeeClient { - - public static void main(String[] args) throws IOException, InterruptedException { - String apiKey = "my-api-key"; - String filePath = "/path/to/the/file.ext"; - - // Init a new client - MindeeClient mindeeClient = new MindeeClient(apiKey); - - // Load a file from disk - LocalInputSource inputSource = new LocalInputSource(new File(filePath)); - - // Parse the file asynchronously - AsyncPredictResponse response = mindeeClient.enqueueAndParse( - UsMailV3.class, - inputSource - ); - - // Print a summary of the response - System.out.println(response.toString()); - - // Print a summary of the predictions -// System.out.println(response.getDocumentObj().toString()); - - // Print the document-level predictions -// System.out.println(response.getDocumentObj().getInference().getPrediction().toString()); - - // Print the page-level predictions -// response.getDocumentObj().getInference().getPages().forEach( -// page -> System.out.println(page.toString()) -// ); - } - -} - -``` - -**Output (RST):** -```rst -######## -Document -######## -:Mindee ID: f9c36f59-977d-4ddc-9f2d-31c294c456ac -:Filename: default_sample.jpg - -Inference -######### -:Product: mindee/us_mail v3.0 -:Rotation applied: Yes - -Prediction -========== -:Sender Name: company zed -:Sender Address: - :City: Dallas - :Complete Address: 54321 Elm Street, Dallas, Texas 54321 - :Postal Code: 54321 - :State: TX - :Street: 54321 Elm Street -:Recipient Names: Jane Doe -:Recipient Addresses: - +-----------------+-------------------------------------+-------------------+-------------+------------------------+-------+---------------------------+-----------------+ - | City | Complete Address | Is Address Change | Postal Code | Private Mailbox Number | State | Street | Unit | - +=================+=====================================+===================+=============+========================+=======+===========================+=================+ - | Detroit | 1234 Market Street PMB 4321, Det... | False | 12345 | 4321 | MI | 1234 Market Street | | - +-----------------+-------------------------------------+-------------------+-------------+------------------------+-------+---------------------------+-----------------+ -:Return to Sender: False -``` - -# Field Types -## Standard Fields -These fields are generic and used in several products. - -### BaseField -Each prediction object contains a set of fields that inherit from the generic `BaseField` class. -A typical `BaseField` object will have the following attributes: - -* **confidence** (`Double`): the confidence score of the field prediction. -* **boundingBox** (`Polygon`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document. -* **polygon** (`Polygon`): contains the relative vertices coordinates (`polygon` extends `List`) of a polygon containing the field in the image. -* **pageId** (`Integer`): the ID of the page, always `null` when at document-level. - -> **Note:** A `Point` simply refers to a List of `Double`. - - -Aside from the previous attributes, all basic fields have access to a custom `toString` method that can be used to print their value as a string. - -### StringField -The text field `StringField` extends `BaseField`, but also implements: -* **value** (`String`): corresponds to the field value. -* **rawValue** (`String`): corresponds to the raw value as it appears on the document. - -### BooleanField -The boolean field `BooleanField` extends BaseField, but also implements: -* **value** (`Boolean`): corresponds to the value of the field. - -## Specific Fields -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. -* **isAddressChange** (`Boolean`): Indicates if the recipient's address is a change of address. -* **postalCode** (`String`): The postal code of the recipient's address. -* **privateMailboxNumber** (`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. -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. -* **postalCode** (`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. - -# Attributes -The following fields are extracted for US Mail V3: - -## Return to Sender -**isReturnToSender**: Whether the mailing is marked as return to sender. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getIsReturnToSender().value); -``` - -## Recipient Addresses -**recipientAddresses**(List<[UsMailV3RecipientAddress](#recipient-addresses-field)>): The addresses of the recipients. - -```java -for (recipientAddressesElem : result.getDocument().getInference().getPrediction().getRecipientAddresses()) -{ - System.out.println(recipientAddressesElem.value); -} -``` - -## Recipient Names -**recipientNames**: The names of the recipients. - -```java -for (recipientNamesElem : result.getDocument().getInference().getPrediction().getRecipientNames()) -{ - System.out.println(recipientNamesElem.value); -} -``` - -## Sender Address -**senderAddress**([UsMailV3SenderAddress](#sender-address-field)): The address of the sender. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSenderAddress().value); -``` - -## Sender Name -**senderName**: The name of the sender. - -```java -System.out.println(result.getDocument().getInference().getPrediction().getSenderName().value); -``` - -# Questions? -[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)