@@ -21,7 +21,7 @@ input_doc = mindee_client.source_from_path("/path/to/the/file.ext")
2121
2222# Load a file from disk and enqueue it.
2323result: AsyncPredictResponse = mindee_client.enqueue_and_parse(
24- product.us.UsMailV2 ,
24+ product.us.UsMailV3 ,
2525 input_doc,
2626)
2727
@@ -32,7 +32,20 @@ print(result.document)
3232
3333** Output (RST):**
3434``` rst
35- :Sender Name: zed
35+ ########
36+ Document
37+ ########
38+ :Mindee ID: f9c36f59-977d-4ddc-9f2d-31c294c456ac
39+ :Filename: default_sample.jpg
40+
41+ Inference
42+ #########
43+ :Product: mindee/us_mail v3.0
44+ :Rotation applied: Yes
45+
46+ Prediction
47+ ==========
48+ :Sender Name: company zed
3649:Sender Address:
3750 :City: Dallas
3851 :Complete Address: 54321 Elm Street, Dallas, Texas 54321
@@ -41,11 +54,12 @@ print(result.document)
4154 :Street: 54321 Elm Street
4255:Recipient Names: Jane Doe
4356:Recipient Addresses:
44- +-----------------+-------------------------------------+-------------------+-------------+------------------------+-------+---------------------------+
45- | City | Complete Address | Is Address Change | Postal Code | Private Mailbox Number | State | Street |
46- +=================+=====================================+===================+=============+========================+=======+===========================+
47- | Detroit | 1234 Market Street PMB 4321, Det... | | 12345 | 4321 | MI | 1234 Market Street |
48- +-----------------+-------------------------------------+-------------------+-------------+------------------------+-------+---------------------------+
57+ +-----------------+-------------------------------------+-------------------+-------------+------------------------+-------+---------------------------+-----------------+
58+ | City | Complete Address | Is Address Change | Postal Code | Private Mailbox Number | State | Street | Unit |
59+ +=================+=====================================+===================+=============+========================+=======+===========================+=================+
60+ | Detroit | 1234 Market Street PMB 4321, Det... | False | 12345 | 4321 | MI | 1234 Market Street | |
61+ +-----------------+-------------------------------------+-------------------+-------------+------------------------+-------+---------------------------+-----------------+
62+ :Return to Sender: False
4963```
5064
5165# Field Types
@@ -77,7 +91,7 @@ Fields which are specific to this product; they are not used in any other produc
7791### Recipient Addresses Field
7892The addresses of the recipients.
7993
80- A ` UsMailV2RecipientAddress ` implements the following attributes:
94+ A ` UsMailV3RecipientAddress ` implements the following attributes:
8195
8296* ** city** (` str ` ): The city of the recipient's address.
8397* ** complete** (` str ` ): The complete address of the recipient.
@@ -86,12 +100,13 @@ A `UsMailV2RecipientAddress` implements the following attributes:
86100* ** private_mailbox_number** (` str ` ): The private mailbox number of the recipient's address.
87101* ** state** (` str ` ): Second part of the ISO 3166-2 code, consisting of two letters indicating the US State.
88102* ** street** (` str ` ): The street of the recipient's address.
103+ * ** unit** (` str ` ): The unit number of the recipient's address.
89104Fields which are specific to this product; they are not used in any other product.
90105
91106### Sender Address Field
92107The address of the sender.
93108
94- A ` UsMailV2SenderAddress ` implements the following attributes:
109+ A ` UsMailV3SenderAddress ` implements the following attributes:
95110
96111* ** city** (` str ` ): The city of the sender's address.
97112* ** complete** (` str ` ): The complete address of the sender.
@@ -100,10 +115,17 @@ A `UsMailV2SenderAddress` implements the following attributes:
100115* ** street** (` str ` ): The street of the sender's address.
101116
102117# Attributes
103- The following fields are extracted for US Mail V2:
118+ The following fields are extracted for US Mail V3:
119+
120+ ## Return to Sender
121+ ** is_return_to_sender** ([ BooleanField] ( #booleanfield ) ): Whether the mailing is marked as return to sender.
122+
123+ ``` py
124+ print (result.document.inference.prediction.is_return_to_sender.value)
125+ ```
104126
105127## Recipient Addresses
106- ** recipient_addresses** (List[[ UsMailV2RecipientAddress ] ( #recipient-addresses-field )] ): The addresses of the recipients.
128+ ** recipient_addresses** (List[[ UsMailV3RecipientAddress ] ( #recipient-addresses-field )] ): The addresses of the recipients.
107129
108130``` py
109131for recipient_addresses_elem in result.document.inference.prediction.recipient_addresses:
@@ -119,7 +141,7 @@ for recipient_names_elem in result.document.inference.prediction.recipient_names
119141```
120142
121143## Sender Address
122- ** sender_address** ([ UsMailV2SenderAddress ] ( #sender-address-field ) ): The address of the sender.
144+ ** sender_address** ([ UsMailV3SenderAddress ] ( #sender-address-field ) ): The address of the sender.
123145
124146``` py
125147print (result.document.inference.prediction.sender_address.value)
0 commit comments