File tree Expand file tree Collapse file tree 6 files changed +16
-12
lines changed Expand file tree Collapse file tree 6 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class BankCheck(Document):
13
13
"""Date the check was issued"""
14
14
amount : Amount
15
15
"""Total including taxes"""
16
- payees : List [Field ] = []
16
+ payees : List [Field ]
17
17
"""List of payees (full name or company name)"""
18
18
check_number : Field
19
19
"""Check number"""
@@ -23,7 +23,7 @@ class BankCheck(Document):
23
23
"""Payer's bank account number"""
24
24
check_position : Field
25
25
"""Check's position in the image"""
26
- signatures_positions : List [Field ] = []
26
+ signatures_positions : List [Field ]
27
27
"""Signatures' positions in the image"""
28
28
# orientation is only present on page-level, not document-level
29
29
orientation : Optional [Orientation ] = None
Original file line number Diff line number Diff line change 4
4
5
5
6
6
class CustomDocument (Document ):
7
- fields : Dict [str , dict ] = {}
7
+ fields : Dict [str , dict ]
8
8
"""Dictionary of all fields in the document"""
9
9
10
10
def __init__ (
@@ -38,6 +38,7 @@ def _build_from_api_prediction(
38
38
:param api_prediction: Raw prediction from HTTP response
39
39
:param page_n: Page number for multi pages pdf input
40
40
"""
41
+ self .fields = {}
41
42
for field_name in api_prediction :
42
43
field = api_prediction [field_name ]
43
44
field ["page_n" ] = page_n
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class FinancialDocument(Document):
28
28
"""Invoice number"""
29
29
due_date : Date
30
30
"""Date the invoice is due"""
31
- taxes : List [Tax ] = []
31
+ taxes : List [Tax ]
32
32
"""List of all taxes"""
33
33
merchant_name : Field
34
34
"""Merchant/Supplier's name"""
@@ -38,11 +38,11 @@ class FinancialDocument(Document):
38
38
"""Customer's name"""
39
39
customer_address : Field
40
40
"""Customer's address"""
41
- customer_company_registration : List [TypedField ] = []
41
+ customer_company_registration : List [TypedField ]
42
42
"""Customer company registration numbers"""
43
- payment_details : List [PaymentDetails ] = []
43
+ payment_details : List [PaymentDetails ]
44
44
"""Payment details"""
45
- company_number : List [TypedField ] = []
45
+ company_number : List [TypedField ]
46
46
"""Company numbers"""
47
47
total_tax : Amount
48
48
"""Sum total of all taxes"""
@@ -115,6 +115,9 @@ def _build_from_api_prediction(
115
115
self .merchant_name = receipt .merchant_name
116
116
self .time = receipt .time
117
117
self .total_tax = receipt .total_tax
118
+ self .customer_company_registration = []
119
+ self .company_number = []
120
+ self .payment_details = []
118
121
self .invoice_number = Field ({"value" : None , "confidence" : 0.0 })
119
122
self .supplier_address = Field ({"value" : None , "confidence" : 0.0 })
120
123
self .customer_name = Field ({"value" : None , "confidence" : 0.0 })
Original file line number Diff line number Diff line change @@ -35,11 +35,11 @@ class Invoice(Document):
35
35
"""Customer's name"""
36
36
customer_address : Field
37
37
"""Customer's address"""
38
- customer_company_registration : List [TypedField ] = []
38
+ customer_company_registration : List [TypedField ]
39
39
"""Customer company registration numbers"""
40
- payment_details : List [PaymentDetails ] = []
40
+ payment_details : List [PaymentDetails ]
41
41
"""Payment details"""
42
- company_number : List [TypedField ] = []
42
+ company_number : List [TypedField ]
43
43
"""Company numbers"""
44
44
# orientation is only present on page-level, not document-level
45
45
orientation : Optional [Orientation ] = None
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class Passport(Document):
17
17
"""Date the passport was issued"""
18
18
surname : Field
19
19
"""Holder's last name (surname)"""
20
- given_names : List [Field ] = []
20
+ given_names : List [Field ]
21
21
"""Holder's list of first (given) names"""
22
22
full_name : Field
23
23
"""
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class Receipt(Document):
22
22
"""Service category"""
23
23
merchant_name : Field
24
24
"""Merchant's name"""
25
- taxes : List [Tax ] = []
25
+ taxes : List [Tax ]
26
26
"""List of all taxes"""
27
27
total_tax : Amount
28
28
"""Sum total of all taxes"""
You can’t perform that action at this time.
0 commit comments