Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
---
|
4 |
+
|
5 |
+
Model Architecture:
|
6 |
+
|
7 |
+
The mychen76/invoice-and-receipts_donut_v1 (LLM) is a finetuned for convert Invoice or Receipt Image to XML or Json data strucutre task. this experimental model is based on Donut model.
|
8 |
+
|
9 |
+
Motivation:
|
10 |
+
|
11 |
+
Remove OCR engine, use only LLM model to convert an invoice or receipt json object could reduce the conversion step and reduce resource utilization and deployment dependencies. Result, better performance.
|
12 |
+
|
13 |
+
Model Usage:
|
14 |
+
|
15 |
+
Take following an invoice receipt image and get an output Json or xml like this:
|
16 |
+
|
17 |
+
***JSON OUTPUT***
|
18 |
+
```json
|
19 |
+
|
20 |
+
{
|
21 |
+
'header': {
|
22 |
+
'invoice_no': '13194726',
|
23 |
+
'invoice_date': '05/29/2021',
|
24 |
+
'seller': 'Hopkins and Sons 62283 Flores Tunnel North Luis, IA 69983',
|
25 |
+
'client': 'Sims PLC USS Kramer FPO AA 81651',
|
26 |
+
'seller_tax_id': '952-73-7223',
|
27 |
+
'client_tax_id': '995-88-9495',
|
28 |
+
'iban': 'GB31LZX520242755934691'
|
29 |
+
},
|
30 |
+
'items': [
|
31 |
+
{
|
32 |
+
'item_desc': 'Beach Lunch Lounge Striped Shirt Dress Large Navy Blue White Long Sleeve Casual',
|
33 |
+
'item_qty': '1,00',
|
34 |
+
'item_net_price': '16,99',
|
35 |
+
'item_net_worth': '16,99',
|
36 |
+
'item_vat': '10%',
|
37 |
+
'item_gross_worth': '18,69'
|
38 |
+
},
|
39 |
+
{
|
40 |
+
'item_desc': 'Jams World Hawaiian 0 Dress Rayon SZ.L',
|
41 |
+
'item_qty': '5,00',
|
42 |
+
'item_net_price': '65,00',
|
43 |
+
'item_net_worth': '325,00',
|
44 |
+
'item_vat': '10%',
|
45 |
+
'item_gross_worth': '357,50'
|
46 |
+
},
|
47 |
+
{
|
48 |
+
'item_desc': 'LuLaRoe Nicole Dress Size Large 26',
|
49 |
+
'item_qty': '2,00',
|
50 |
+
'item_net_price': '1,99',
|
51 |
+
'item_net_worth': '3,98',
|
52 |
+
'item_vat': '10%',
|
53 |
+
'item_gross_worth': '4,38'
|
54 |
+
},
|
55 |
+
{
|
56 |
+
'item_desc': 'phynny Was Medium Linen Wrap Dress Dessert Rose Embroidered Bohemian',
|
57 |
+
'item_qty': '2,00',
|
58 |
+
'item_net_price': '89,99',
|
59 |
+
'item_net_worth': '179,98',
|
60 |
+
'item_vat': '10%',
|
61 |
+
'item_gross_worth': '197,98'
|
62 |
+
},
|
63 |
+
{
|
64 |
+
'item_desc': "Eileen Fisher Women's Long Sleeve Fleece Lined Front Pockets Dress XS Gray",
|
65 |
+
'item_qty': '2,00',
|
66 |
+
'item_net_price': '15,99',
|
67 |
+
'item_net_worth': '31,98',
|
68 |
+
'item_vat': '10%',
|
69 |
+
'item_gross_worth': '35,18'
|
70 |
+
},
|
71 |
+
{
|
72 |
+
'item_desc': "Hanna Anderson Women's L Large Coral Short Sleeve Casual Fall Tee Shirt Dress",
|
73 |
+
'item_qty': '1,00',
|
74 |
+
'item_net_price': '24,00',
|
75 |
+
'item_net_worth': '24,00',
|
76 |
+
'item_vat': '10%',
|
77 |
+
'item_gross_worth': '26,40'
|
78 |
+
}
|
79 |
+
],
|
80 |
+
'summary': {'total_net_worth': '$581,93', 'total_vat': '$58,19', 'total_gross_worth': '$ 640,12'}
|
81 |
+
}
|
82 |
+
|
83 |
+
```
|
84 |
+
|
85 |
+
***XML OUTPUT***
|
86 |
+
|
87 |
+
```xml
|
88 |
+
<s_header>
|
89 |
+
<s_invoice_no> 13194726</s_invoice_no>
|
90 |
+
<s_invoice_date> 05/29/2021</s_invoice_date>
|
91 |
+
<s_seller> Hopkins and
|
92 |
+
Sons 62283 Flores Tunnel North Luis, IA 69983</s_seller>
|
93 |
+
<s_client> Sims PLC USS Kramer FPO AA
|
94 |
+
81651</s_client>
|
95 |
+
<s_seller_tax_id> 952-73-7223</s_seller_tax_id>
|
96 |
+
<s_client_tax_id>
|
97 |
+
995-88-9495</s_client_tax_id>
|
98 |
+
<s_iban> GB31LZX520242755934691</s_iban>
|
99 |
+
</s_header>
|
100 |
+
<s_items>
|
101 |
+
<s_item_desc> Beach Lunch
|
102 |
+
Lounge Striped Shirt Dress Large Navy Blue White Long Sleeve Casual</s_item_desc>
|
103 |
+
<s_item_qty>
|
104 |
+
1,00</s_item_qty>
|
105 |
+
<s_item_net_price> 16,99</s_item_net_price>
|
106 |
+
<s_item_net_worth> 16,99</s_item_net_worth>
|
107 |
+
<s_item_vat>
|
108 |
+
10%</s_item_vat>
|
109 |
+
<s_item_gross_worth> 18,69</s_item_gross_worth>
|
110 |
+
<sep/>
|
111 |
+
<s_item_desc> Jams World Hawaiian 0 Dress
|
112 |
+
Rayon SZ.L</s_item_desc>
|
113 |
+
<s_item_qty> 5,00</s_item_qty>
|
114 |
+
<s_item_net_price> 65,00</s_item_net_price>
|
115 |
+
<s_item_net_worth>
|
116 |
+
325,00</s_item_net_worth>
|
117 |
+
<s_item_vat> 10%</s_item_vat>
|
118 |
+
<s_item_gross_worth>
|
119 |
+
357,50</s_item_gross_worth>
|
120 |
+
<sep/>
|
121 |
+
<s_item_desc> LuLaRoe Nicole Dress Size Large 26</s_item_desc>
|
122 |
+
<s_item_qty>
|
123 |
+
2,00</s_item_qty>
|
124 |
+
<s_item_net_price> 1,99</s_item_net_price>
|
125 |
+
<s_item_net_worth> 3,98</s_item_net_worth>
|
126 |
+
<s_item_vat>
|
127 |
+
10%</s_item_vat>
|
128 |
+
<s_item_gross_worth> 4,38</s_item_gross_worth>
|
129 |
+
<sep/>
|
130 |
+
<s_item_desc> phynny Was Medium Linen Wrap
|
131 |
+
Dress Dessert Rose Embroidered Bohemian</s_item_desc>
|
132 |
+
<s_item_qty> 2,00</s_item_qty>
|
133 |
+
<s_item_net_price>
|
134 |
+
89,99</s_item_net_price>
|
135 |
+
<s_item_net_worth> 179,98</s_item_net_worth>
|
136 |
+
<s_item_vat>
|
137 |
+
10%</s_item_vat>
|
138 |
+
<s_item_gross_worth> 197,98</s_item_gross_worth>
|
139 |
+
<sep/>
|
140 |
+
<s_item_desc> Eileen Fisher Women's Long
|
141 |
+
Sleeve Fleece Lined Front Pockets Dress XS Gray</s_item_desc>
|
142 |
+
<s_item_qty> 2,00</s_item_qty>
|
143 |
+
<s_item_net_price>
|
144 |
+
15,99</s_item_net_price>
|
145 |
+
<s_item_net_worth> 31,98</s_item_net_worth>
|
146 |
+
<s_item_vat>
|
147 |
+
10%</s_item_vat>
|
148 |
+
<s_item_gross_worth> 35,18</s_item_gross_worth>
|
149 |
+
<sep/>
|
150 |
+
<s_item_desc> Hanna Anderson Women's L Large
|
151 |
+
Coral Short Sleeve Casual Fall Tee Shirt Dress</s_item_desc>
|
152 |
+
<s_item_qty> 1,00</s_item_qty>
|
153 |
+
<s_item_net_price>
|
154 |
+
24,00</s_item_net_price>
|
155 |
+
<s_item_net_worth> 24,00</s_item_net_worth>
|
156 |
+
<s_item_vat>
|
157 |
+
10%</s_item_vat>
|
158 |
+
<s_item_gross_worth> 26,40</s_item_gross_worth>
|
159 |
+
</s_items>
|
160 |
+
<s_summary>
|
161 |
+
<s_total_net_worth>
|
162 |
+
$581,93</s_total_net_worth>
|
163 |
+
<s_total_vat> $58,19</s_total_vat>
|
164 |
+
<s_total_gross_worth> $
|
165 |
+
640,12</s_total_gross_worth>
|
166 |
+
</s_summary>
|
167 |
+
|
168 |
+
```
|