Skip to content

Commit b3eb469

Browse files
committed
deploy: f57ba8d
1 parent 7492382 commit b3eb469

15 files changed

Lines changed: 206 additions & 81 deletions

code_samples/workflow_ots_rag.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#
2+
# Install the Python client library by running:
3+
# pip install mindee
4+
#
5+
6+
from mindee import Client, product, AsyncPredictResponse
7+
8+
# Init a new client
9+
mindee_client = Client(api_key="my-api-key")
10+
11+
# Load a file from disk
12+
input_doc = mindee_client.source_from_path("/path/to/the/file.ext")
13+
14+
# Load a file from disk and enqueue it.
15+
result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
16+
product.FinancialDocumentV1,
17+
input_doc,
18+
# Set the workflow ID
19+
workflow_id="workflow-id",
20+
# Enable RAG on the workflow
21+
rag=True,
22+
)
23+
24+
# Print a brief summary of the parsed data
25+
print(result.document)

genindex.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,8 @@ <h2 id="C">C</h2>
588588

589589
<ul>
590590
<li><a href="product/financial_document_v1.html#mindee.product.financial_document.financial_document_v1_document.FinancialDocumentV1Document.category">(FinancialDocumentV1Document attribute)</a>
591+
</li>
592+
<li><a href="product/invoice_v4.html#mindee.product.invoice.invoice_v4_document.InvoiceV4Document.category">(InvoiceV4Document attribute)</a>
591593
</li>
592594
<li><a href="product/fr/payslip_v2.html#mindee.product.fr.payslip.payslip_v2_employment.PayslipV2Employment.category">(PayslipV2Employment attribute)</a>
593595
</li>
@@ -2806,6 +2808,8 @@ <h2 id="P">P</h2>
28062808
<li><a href="product/driver_license_v1.html#mindee.product.driver_license.driver_license_v1_document.DriverLicenseV1Document.place_of_birth">place_of_birth (DriverLicenseV1Document attribute)</a>
28072809
</li>
28082810
<li><a href="product/bill_of_lading_v1.html#mindee.product.bill_of_lading.bill_of_lading_v1_document.BillOfLadingV1Document.place_of_delivery">place_of_delivery (BillOfLadingV1Document attribute)</a>
2811+
</li>
2812+
<li><a href="product/us/healthcare_card_v1.html#mindee.product.us.healthcare_card.healthcare_card_v1_document.HealthcareCardV1Document.plan_name">plan_name (HealthcareCardV1Document attribute)</a>
28092813
</li>
28102814
<li><a href="product/financial_document_v1.html#mindee.product.financial_document.financial_document_v1_document.FinancialDocumentV1Document.po_number">po_number (FinancialDocumentV1Document attribute)</a>
28112815

@@ -3474,6 +3478,8 @@ <h2 id="S">S</h2>
34743478
<li><a href="product/financial_document_v1.html#mindee.product.financial_document.financial_document_v1_document.FinancialDocumentV1Document.subcategory">subcategory (FinancialDocumentV1Document attribute)</a>
34753479

34763480
<ul>
3481+
<li><a href="product/invoice_v4.html#mindee.product.invoice.invoice_v4_document.InvoiceV4Document.subcategory">(InvoiceV4Document attribute)</a>
3482+
</li>
34773483
<li><a href="product/receipt_v5.html#mindee.product.receipt.receipt_v5_document.ReceiptV5Document.subcategory">(ReceiptV5Document attribute)</a>
34783484
</li>
34793485
</ul></li>

guide/expense_receipts_v5.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@ The following fields are extracted for Receipt V5:
237237
- 'gasoline'
238238
- 'telecom'
239239
- 'miscellaneous'
240+
- 'software'
241+
- 'shopping'
242+
- 'energy'
240243

241244
```py
242245
print(result.document.inference.prediction.category.value)
@@ -291,6 +294,15 @@ print(result.document.inference.prediction.receipt_number.value)
291294
- 'train'
292295
- 'restaurant'
293296
- 'shopping'
297+
- 'other'
298+
- 'groceries'
299+
- 'cultural'
300+
- 'electronics'
301+
- 'office_supplies'
302+
- 'micromobility'
303+
- 'car_rental'
304+
- 'public'
305+
- 'delivery'
294306
- None
295307

296308
```py

guide/financial_document_v1.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ print(result.document)
7070
########
7171
Document
7272
########
73-
:Mindee ID: f52333ab-811e-4647-993e-ad79e072afa3
73+
:Mindee ID: 6dd26385-719b-4527-bf6f-87d9da619de5
7474
:Filename: default_sample.jpg
7575
7676
Inference
7777
#########
78-
:Product: mindee/financial_document v1.12
78+
:Product: mindee/financial_document v1.14
7979
:Rotation applied: Yes
8080
8181
Prediction
@@ -203,6 +203,21 @@ A typical `BaseField` object will have the following attributes:
203203
Aside from the previous attributes, all basic fields have access to a custom `__str__` method that can be used to print their value as a string.
204204

205205

206+
### AddressField
207+
Aside from the basic `BaseField` attributes, the address field `AddressField` also implements the following:
208+
209+
* **street_number** (`str`): String representation of the street number. Can be `None`.
210+
* **street_name** (`str`): Name of the street. Can be `None`.
211+
* **po_box** (`str`): String representation of the PO Box number. Can be `None`.
212+
* **address_complement** (`str`): Address complement. Can be `None`.
213+
* **city** (`str`): City name. Can be `None`.
214+
* **postal_code** (`str`): String representation of the postal code. Can be `None`.
215+
* **state** (`str`): State name. Can be `None`.
216+
* **country** (`str`): Country name. Can be `None`.
217+
218+
Note: The `value` field of an AddressField should be a concatenation of the rest of the values.
219+
220+
206221
### AmountField
207222
The amount field `AmountField` only has one constraint: its **value** is an `Optional[float]`.
208223

@@ -276,14 +291,14 @@ A `FinancialDocumentV1LineItem` implements the following attributes:
276291
The following fields are extracted for Financial Document V1:
277292

278293
## Billing Address
279-
**billing_address** ([StringField](#stringfield)): The customer's address used for billing.
294+
**billing_address** ([AddressField](#addressfield)): The customer's address used for billing.
280295

281296
```py
282297
print(result.document.inference.prediction.billing_address.value)
283298
```
284299

285300
## Purchase Category
286-
**category** ([ClassificationField](#classificationfield)): The purchase category, only for receipts.
301+
**category** ([ClassificationField](#classificationfield)): The purchase category.
287302

288303
#### Possible values include:
289304
- 'toll'
@@ -294,13 +309,16 @@ print(result.document.inference.prediction.billing_address.value)
294309
- 'gasoline'
295310
- 'telecom'
296311
- 'miscellaneous'
312+
- 'software'
313+
- 'shopping'
314+
- 'energy'
297315

298316
```py
299317
print(result.document.inference.prediction.category.value)
300318
```
301319

302320
## Customer Address
303-
**customer_address** ([StringField](#stringfield)): The address of the customer.
321+
**customer_address** ([AddressField](#addressfield)): The address of the customer.
304322

305323
```py
306324
print(result.document.inference.prediction.customer_address.value)
@@ -432,29 +450,38 @@ for reference_numbers_elem in result.document.inference.prediction.reference_num
432450
```
433451

434452
## Shipping Address
435-
**shipping_address** ([StringField](#stringfield)): The customer's address used for shipping.
453+
**shipping_address** ([AddressField](#addressfield)): The customer's address used for shipping.
436454

437455
```py
438456
print(result.document.inference.prediction.shipping_address.value)
439457
```
440458

441459
## Purchase Subcategory
442-
**subcategory** ([ClassificationField](#classificationfield)): The purchase subcategory for transport and food, only for receipts.
460+
**subcategory** ([ClassificationField](#classificationfield)): The purchase subcategory for transport, food and shooping.
443461

444462
#### Possible values include:
445463
- 'plane'
446464
- 'taxi'
447465
- 'train'
448466
- 'restaurant'
449467
- 'shopping'
468+
- 'other'
469+
- 'groceries'
470+
- 'cultural'
471+
- 'electronics'
472+
- 'office_supplies'
473+
- 'micromobility'
474+
- 'car_rental'
475+
- 'public'
476+
- 'delivery'
450477
- None
451478

452479
```py
453480
print(result.document.inference.prediction.subcategory.value)
454481
```
455482

456483
## Supplier Address
457-
**supplier_address** ([StringField](#stringfield)): The address of the supplier or merchant.
484+
**supplier_address** ([AddressField](#addressfield)): The address of the supplier or merchant.
458485

459486
```py
460487
print(result.document.inference.prediction.supplier_address.value)

guide/ind_passport_v1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Document
4545
4646
Inference
4747
#########
48-
:Product: mindee/ind_passport v1.0
48+
:Product: mindee/ind_passport v1.2
4949
:Rotation applied: Yes
5050
5151
Prediction
@@ -68,10 +68,10 @@ Prediction
6868
:Name of Mother:
6969
:Old Passport Date of Issue:
7070
:Old Passport Number:
71+
:Old Passport Place of Issue:
7172
:Address Line 1:
7273
:Address Line 2:
7374
:Address Line 3:
74-
:Old Passport Place of Issue:
7575
:File Number:
7676
```
7777

guide/invoices_v4.md

Lines changed: 68 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ print(result.document)
7070
########
7171
Document
7272
########
73-
:Mindee ID: 3e524d26-f7dc-4852-9bbf-833a127a9570
73+
:Mindee ID: 744748d5-9051-461c-b70c-bbf81f5ff943
7474
:Filename: default_sample.jpg
7575
7676
Inference
7777
#########
78-
:Product: mindee/invoices v4.10
78+
:Product: mindee/invoices v4.11
7979
:Rotation applied: Yes
8080
8181
Prediction
@@ -111,6 +111,8 @@ Prediction
111111
:Billing Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
112112
:Document Type: INVOICE
113113
:Document Type Extended: INVOICE
114+
:Purchase Subcategory:
115+
:Purchase Category: miscellaneous
114116
:Line Items:
115117
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
116118
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit of measure | Unit Price |
@@ -158,6 +160,8 @@ Page 0
158160
:Billing Address: 1954 Bloor Street West Toronto, ON, M6P 3K9 Canada
159161
:Document Type: INVOICE
160162
:Document Type Extended: INVOICE
163+
:Purchase Subcategory:
164+
:Purchase Category: miscellaneous
161165
:Line Items:
162166
+--------------------------------------+--------------+----------+------------+--------------+--------------+-----------------+------------+
163167
| Description | Product code | Quantity | Tax Amount | Tax Rate (%) | Total Amount | Unit of measure | Unit Price |
@@ -191,6 +195,21 @@ A typical `BaseField` object will have the following attributes:
191195
Aside from the previous attributes, all basic fields have access to a custom `__str__` method that can be used to print their value as a string.
192196

193197

198+
### AddressField
199+
Aside from the basic `BaseField` attributes, the address field `AddressField` also implements the following:
200+
201+
* **street_number** (`str`): String representation of the street number. Can be `None`.
202+
* **street_name** (`str`): Name of the street. Can be `None`.
203+
* **po_box** (`str`): String representation of the PO Box number. Can be `None`.
204+
* **address_complement** (`str`): Address complement. Can be `None`.
205+
* **city** (`str`): City name. Can be `None`.
206+
* **postal_code** (`str`): String representation of the postal code. Can be `None`.
207+
* **state** (`str`): State name. Can be `None`.
208+
* **country** (`str`): Country name. Can be `None`.
209+
210+
Note: The `value` field of an AddressField should be a concatenation of the rest of the values.
211+
212+
194213
### AmountField
195214
The amount field `AmountField` only has one constraint: its **value** is an `Optional[float]`.
196215

@@ -264,14 +283,33 @@ A `InvoiceV4LineItem` implements the following attributes:
264283
The following fields are extracted for Invoice V4:
265284

266285
## Billing Address
267-
**billing_address** ([StringField](#stringfield)): The customer billing address.
286+
**billing_address** ([AddressField](#addressfield)): The customer billing address.
268287

269288
```py
270289
print(result.document.inference.prediction.billing_address.value)
271290
```
272291

292+
## Purchase Category
293+
**category** ([ClassificationField](#classificationfield)): The purchase category.
294+
295+
#### Possible values include:
296+
- 'toll'
297+
- 'food'
298+
- 'parking'
299+
- 'transport'
300+
- 'accommodation'
301+
- 'telecom'
302+
- 'miscellaneous'
303+
- 'software'
304+
- 'shopping'
305+
- 'energy'
306+
307+
```py
308+
print(result.document.inference.prediction.category.value)
309+
```
310+
273311
## Customer Address
274-
**customer_address** ([StringField](#stringfield)): The address of the customer.
312+
**customer_address** ([AddressField](#addressfield)): The address of the customer.
275313

276314
```py
277315
print(result.document.inference.prediction.customer_address.value)
@@ -387,14 +425,38 @@ for reference_numbers_elem in result.document.inference.prediction.reference_num
387425
```
388426

389427
## Shipping Address
390-
**shipping_address** ([StringField](#stringfield)): Customer's delivery address.
428+
**shipping_address** ([AddressField](#addressfield)): Customer's delivery address.
391429

392430
```py
393431
print(result.document.inference.prediction.shipping_address.value)
394432
```
395433

434+
## Purchase Subcategory
435+
**subcategory** ([ClassificationField](#classificationfield)): The purchase subcategory for transport, food and shopping.
436+
437+
#### Possible values include:
438+
- 'plane'
439+
- 'taxi'
440+
- 'train'
441+
- 'restaurant'
442+
- 'shopping'
443+
- 'other'
444+
- 'groceries'
445+
- 'cultural'
446+
- 'electronics'
447+
- 'office_supplies'
448+
- 'micromobility'
449+
- 'car_rental'
450+
- 'public'
451+
- 'delivery'
452+
- None
453+
454+
```py
455+
print(result.document.inference.prediction.subcategory.value)
456+
```
457+
396458
## Supplier Address
397-
**supplier_address** ([StringField](#stringfield)): The address of the supplier or merchant.
459+
**supplier_address** ([AddressField](#addressfield)): The address of the supplier or merchant.
398460

399461
```py
400462
print(result.document.inference.prediction.supplier_address.value)

0 commit comments

Comments
 (0)