Skip to content

✨ add support for full address fields #325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 28, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions docs/extras/guide/delivery_notes_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,21 @@ A typical `BaseField` object will have the following attributes:
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.


### AddressField
Aside from the basic `BaseField` attributes, the address field `AddressField` also implements the following:

* **street_number** (`str`): String representation of the string number. Can be `None`.
* **street_name** (`str`): Name of the street. Can be `None`.
* **po_box** (`str`): String representation of the PO Box number. Can be `None`.
* **address_complement** (`str`): Address complement. Can be `None`.
* **city** (`str`): City name. Can be `None`.
* **postal_code** (`str`): String representation of the postal code. Can be `None`.
* **state** (`str`): State name. Can be `None`.
* **country** (`str`): Country name. Can be `None`.

Note: The `value` field of an AddressField should be a concatenation of the rest of the values.


### AmountField
The amount field `AmountField` only has one constraint: its **value** is an `Optional[float]`.

Expand All @@ -95,7 +110,7 @@ The text field `StringField` only has one constraint: its **value** is an `Optio
The following fields are extracted for Delivery note V1:

## Customer Address
**customer_address** ([StringField](#stringfield)): The address of the customer receiving the goods.
**customer_address** ([AddressField](#addressfield)): The address of the customer receiving the goods.

```py
print(result.document.inference.prediction.customer_address.value)
Expand Down Expand Up @@ -123,7 +138,7 @@ print(result.document.inference.prediction.delivery_number.value)
```

## Supplier Address
**supplier_address** ([StringField](#stringfield)): The address of the supplier providing the goods.
**supplier_address** ([AddressField](#addressfield)): The address of the supplier providing the goods.

```py
print(result.document.inference.prediction.supplier_address.value)
Expand Down
29 changes: 28 additions & 1 deletion docs/extras/guide/expense_receipts_v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,21 @@ A typical `BaseField` object will have the following attributes:
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.


### AddressField
Aside from the basic `BaseField` attributes, the address field `AddressField` also implements the following:

* **street_number** (`str`): String representation of the string number. Can be `None`.
* **street_name** (`str`): Name of the street. Can be `None`.
* **po_box** (`str`): String representation of the PO Box number. Can be `None`.
* **address_complement** (`str`): Address complement. Can be `None`.
* **city** (`str`): City name. Can be `None`.
* **postal_code** (`str`): String representation of the postal code. Can be `None`.
* **state** (`str`): State name. Can be `None`.
* **country** (`str`): Country name. Can be `None`.

Note: The `value` field of an AddressField should be a concatenation of the rest of the values.


### AmountField
The amount field `AmountField` only has one constraint: its **value** is an `Optional[float]`.

Expand Down Expand Up @@ -237,6 +252,9 @@ The following fields are extracted for Receipt V5:
- 'gasoline'
- 'telecom'
- 'miscellaneous'
- 'software'
- 'shopping'
- 'energy'

```py
print(result.document.inference.prediction.category.value)
Expand Down Expand Up @@ -291,14 +309,23 @@ print(result.document.inference.prediction.receipt_number.value)
- 'train'
- 'restaurant'
- 'shopping'
- 'other'
- 'groceries'
- 'cultural'
- 'electronics'
- 'office_supplies'
- 'micromobility'
- 'car_rental'
- 'public'
- 'delivery'
- None

```py
print(result.document.inference.prediction.subcategory.value)
```

## Supplier Address
**supplier_address** ([StringField](#stringfield)): The address of the supplier or merchant.
**supplier_address** ([AddressField](#addressfield)): The address of the supplier or merchant.

```py
print(result.document.inference.prediction.supplier_address.value)
Expand Down
43 changes: 35 additions & 8 deletions docs/extras/guide/financial_document_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ print(result.document)
########
Document
########
:Mindee ID: f52333ab-811e-4647-993e-ad79e072afa3
:Mindee ID: 6dd26385-719b-4527-bf6f-87d9da619de5
:Filename: default_sample.jpg

Inference
#########
:Product: mindee/financial_document v1.12
:Product: mindee/financial_document v1.14
:Rotation applied: Yes

Prediction
Expand Down Expand Up @@ -203,6 +203,21 @@ A typical `BaseField` object will have the following attributes:
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.


### AddressField
Aside from the basic `BaseField` attributes, the address field `AddressField` also implements the following:

* **street_number** (`str`): String representation of the string number. Can be `None`.
* **street_name** (`str`): Name of the street. Can be `None`.
* **po_box** (`str`): String representation of the PO Box number. Can be `None`.
* **address_complement** (`str`): Address complement. Can be `None`.
* **city** (`str`): City name. Can be `None`.
* **postal_code** (`str`): String representation of the postal code. Can be `None`.
* **state** (`str`): State name. Can be `None`.
* **country** (`str`): Country name. Can be `None`.

Note: The `value` field of an AddressField should be a concatenation of the rest of the values.


### AmountField
The amount field `AmountField` only has one constraint: its **value** is an `Optional[float]`.

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

## Billing Address
**billing_address** ([StringField](#stringfield)): The customer's address used for billing.
**billing_address** ([AddressField](#addressfield)): The customer's address used for billing.

```py
print(result.document.inference.prediction.billing_address.value)
```

## Purchase Category
**category** ([ClassificationField](#classificationfield)): The purchase category, only for receipts.
**category** ([ClassificationField](#classificationfield)): The purchase category.

#### Possible values include:
- 'toll'
Expand All @@ -294,13 +309,16 @@ print(result.document.inference.prediction.billing_address.value)
- 'gasoline'
- 'telecom'
- 'miscellaneous'
- 'software'
- 'shopping'
- 'energy'

```py
print(result.document.inference.prediction.category.value)
```

## Customer Address
**customer_address** ([StringField](#stringfield)): The address of the customer.
**customer_address** ([AddressField](#addressfield)): The address of the customer.

```py
print(result.document.inference.prediction.customer_address.value)
Expand Down Expand Up @@ -432,29 +450,38 @@ for reference_numbers_elem in result.document.inference.prediction.reference_num
```

## Shipping Address
**shipping_address** ([StringField](#stringfield)): The customer's address used for shipping.
**shipping_address** ([AddressField](#addressfield)): The customer's address used for shipping.

```py
print(result.document.inference.prediction.shipping_address.value)
```

## Purchase Subcategory
**subcategory** ([ClassificationField](#classificationfield)): The purchase subcategory for transport and food, only for receipts.
**subcategory** ([ClassificationField](#classificationfield)): 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'
- None

```py
print(result.document.inference.prediction.subcategory.value)
```

## Supplier Address
**supplier_address** ([StringField](#stringfield)): The address of the supplier or merchant.
**supplier_address** ([AddressField](#addressfield)): The address of the supplier or merchant.

```py
print(result.document.inference.prediction.supplier_address.value)
Expand Down
4 changes: 2 additions & 2 deletions docs/extras/guide/ind_passport_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Document

Inference
#########
:Product: mindee/ind_passport v1.0
:Product: mindee/ind_passport v1.2
:Rotation applied: Yes

Prediction
Expand All @@ -68,10 +68,10 @@ Prediction
:Name of Mother:
:Old Passport Date of Issue:
:Old Passport Number:
:Old Passport Place of Issue:
:Address Line 1:
:Address Line 2:
:Address Line 3:
:Old Passport Place of Issue:
:File Number:
```

Expand Down
74 changes: 68 additions & 6 deletions docs/extras/guide/invoices_v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ print(result.document)
########
Document
########
:Mindee ID: 3e524d26-f7dc-4852-9bbf-833a127a9570
:Mindee ID: 744748d5-9051-461c-b70c-bbf81f5ff943
:Filename: default_sample.jpg

Inference
#########
:Product: mindee/invoices v4.10
:Product: mindee/invoices v4.11
:Rotation applied: Yes

Prediction
Expand Down Expand Up @@ -111,6 +111,8 @@ Prediction
: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 |
Expand Down Expand Up @@ -158,6 +160,8 @@ Page 0
: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 |
Expand Down Expand Up @@ -191,6 +195,21 @@ A typical `BaseField` object will have the following attributes:
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.


### AddressField
Aside from the basic `BaseField` attributes, the address field `AddressField` also implements the following:

* **street_number** (`str`): String representation of the string number. Can be `None`.
* **street_name** (`str`): Name of the street. Can be `None`.
* **po_box** (`str`): String representation of the PO Box number. Can be `None`.
* **address_complement** (`str`): Address complement. Can be `None`.
* **city** (`str`): City name. Can be `None`.
* **postal_code** (`str`): String representation of the postal code. Can be `None`.
* **state** (`str`): State name. Can be `None`.
* **country** (`str`): Country name. Can be `None`.

Note: The `value` field of an AddressField should be a concatenation of the rest of the values.


### AmountField
The amount field `AmountField` only has one constraint: its **value** is an `Optional[float]`.

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

## Billing Address
**billing_address** ([StringField](#stringfield)): The customer billing address.
**billing_address** ([AddressField](#addressfield)): The customer billing address.

```py
print(result.document.inference.prediction.billing_address.value)
```

## Purchase Category
**category** ([ClassificationField](#classificationfield)): The purchase category.

#### Possible values include:
- 'toll'
- 'food'
- 'parking'
- 'transport'
- 'accommodation'
- 'telecom'
- 'miscellaneous'
- 'software'
- 'shopping'
- 'energy'

```py
print(result.document.inference.prediction.category.value)
```

## Customer Address
**customer_address** ([StringField](#stringfield)): The address of the customer.
**customer_address** ([AddressField](#addressfield)): The address of the customer.

```py
print(result.document.inference.prediction.customer_address.value)
Expand Down Expand Up @@ -387,14 +425,38 @@ for reference_numbers_elem in result.document.inference.prediction.reference_num
```

## Shipping Address
**shipping_address** ([StringField](#stringfield)): Customer's delivery address.
**shipping_address** ([AddressField](#addressfield)): Customer's delivery address.

```py
print(result.document.inference.prediction.shipping_address.value)
```

## Purchase Subcategory
**subcategory** ([ClassificationField](#classificationfield)): 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'
- None

```py
print(result.document.inference.prediction.subcategory.value)
```

## Supplier Address
**supplier_address** ([StringField](#stringfield)): The address of the supplier or merchant.
**supplier_address** ([AddressField](#addressfield)): The address of the supplier or merchant.

```py
print(result.document.inference.prediction.supplier_address.value)
Expand Down
Loading