File size: 19,715 Bytes
d7a70d8
 
 
 
 
ffc3152
d7a70d8
 
 
ffc3152
d7a70d8
ffc3152
d7a70d8
ffc3152
 
d7a70d8
 
 
 
ffc3152
 
 
 
 
 
d7a70d8
ffc3152
 
d7a70d8
 
 
ffc3152
d7a70d8
ffc3152
 
 
 
 
d7a70d8
ffc3152
 
 
 
d7a70d8
ffc3152
 
d7a70d8
 
ffc3152
 
 
d7a70d8
ffc3152
 
d7a70d8
 
ffc3152
 
 
d7a70d8
ffc3152
 
d7a70d8
 
 
ffc3152
d7a70d8
ffc3152
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d7a70d8
 
 
ffc3152
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d7a70d8
 
ffc3152
 
 
 
 
 
d7a70d8
ffc3152
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d7a70d8
 
 
ffc3152
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d7a70d8
ffc3152
 
 
 
 
 
d7a70d8
ffc3152
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d7a70d8
 
 
ffc3152
 
 
 
 
 
 
 
 
d7a70d8
 
ffc3152
d7a70d8
ffc3152
 
 
 
 
 
 
 
 
 
 
 
d7a70d8
ffc3152
 
d7a70d8
ffc3152
d7a70d8
ffc3152
d7a70d8
ffc3152
 
d7a70d8
 
ffc3152
d7a70d8
ffc3152
 
 
d7a70d8
 
ffc3152
 
d7a70d8
ffc3152
 
 
 
 
 
 
 
d7a70d8
 
 
ffc3152
 
d7a70d8
 
 
 
 
ffc3152
 
 
d7a70d8
ffc3152
 
 
d7a70d8
ffc3152
 
 
 
 
 
 
d3de409
d7a70d8
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>LayoutLMv3 Invoice Annotation Guide</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        .annotation-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }
        .diagram-container {
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
        }
    </style>
</head>
<body class="bg-gray-50 font-sans">
    <header class="bg-blue-600 text-white shadow-lg">
        <div class="container mx-auto px-4 py-6">
            <div class="flex justify-between items-center">
                <div>
                    <h1 class="text-3xl font-bold">Invoice Annotation for LayoutLMv3</h1>
                    <p class="mt-2">A comprehensive guide to preparing your dataset</p>
                </div>
                <div class="hidden md:block">
                    <img src="https://via.placeholder.com/80" alt="AI Icon" class="h-16 w-16 rounded-full border-2 border-white">
                </div>
            </div>
        </div>
    </header>

    <main class="container mx-auto px-4 py-8">
        <section class="mb-12">
            <div class="bg-white rounded-xl shadow-md p-6 mb-8">
                <h2 class="text-2xl font-semibold text-blue-700 mb-4">Getting Started with Annotation</h2>
                <p class="text-gray-700 mb-4">Proper annotation is crucial for training LayoutLMv3 to understand invoices. This guide walks you through the process of creating a high-quality dataset.</p>
                
                <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mt-6">
                    <div class="annotation-card bg-white border border-gray-200 rounded-lg p-6 transition-all duration-300">
                        <div class="text-blue-500 mb-4">
                            <i class="fas fa-file-invoice-dollar text-4xl"></i>
                        </div>
                        <h3 class="text-xl font-semibold mb-2">1. Collect Samples</h3>
                        <p class="text-gray-600">Gather 50 diverse invoice samples representing different layouts, languages, and formats you expect to process.</p>
                    </div>
                    
                    <div class="annotation-card bg-white border border-gray-200 rounded-lg p-6 transition-all duration-300">
                        <div class="text-green-500 mb-4">
                            <i class="fas fa-tags text-4xl"></i>
                        </div>
                        <h3 class="text-xl font-semibold mb-2">2. Define Labels</h3>
                        <p class="text-gray-600">Create a consistent label schema (e.g., vendor_name, invoice_date, total_amount) that covers all relevant fields.</p>
                    </div>
                    
                    <div class="annotation-card bg-white border border-gray-200 rounded-lg p-6 transition-all duration-300">
                        <div class="text-purple-500 mb-4">
                            <i class="fas fa-mouse-pointer text-4xl"></i>
                        </div>
                        <h3 class="text-xl font-semibold mb-2">3. Choose Tools</h3>
                        <p class="text-gray-600">Select annotation tools like Label Studio, VGG Image Annotator, or custom solutions that support bounding boxes and text.</p>
                    </div>
                </div>
            </div>
        </section>

        <section class="mb-12">
            <div class="bg-white rounded-xl shadow-md p-6">
                <h2 class="text-2xl font-semibold text-blue-700 mb-4">Annotation Process Details</h2>
                
                <div class="diagram-container rounded-lg p-6 mb-6">
                    <div class="flex flex-col md:flex-row items-center">
                        <div class="md:w-1/2 mb-6 md:mb-0 md:pr-6">
                            <h3 class="text-xl font-semibold mb-3">Key Annotation Steps</h3>
                            <ol class="list-decimal list-inside space-y-3 text-gray-700">
                                <li class="font-medium">Draw bounding boxes around each relevant text element</li>
                                <li>Assign the appropriate label to each box</li>
                                <li>Include the OCR-extracted text content</li>
                                <li>Mark relationships between elements (optional)</li>
                                <li>Validate annotations for consistency</li>
                            </ol>
                        </div>
                        <div class="md:w-1/2">
                            <img src="https://via.placeholder.com/500x300" alt="Annotation Example" class="w-full rounded-lg border border-gray-200">
                        </div>
                    </div>
                </div>
                
                <div class="mt-6">
                    <h3 class="text-xl font-semibold mb-3">Common Invoice Fields to Annotate</h3>
                    <div class="grid grid-cols-2 md:grid-cols-4 gap-4">
                        <div class="bg-blue-50 p-3 rounded-lg">
                            <h4 class="font-medium text-blue-700">Header Fields</h4>
                            <ul class="mt-2 text-sm text-gray-600">
                                <li>Invoice Number</li>
                                <li>Invoice Date</li>
                                <li>Due Date</li>
                                <li>Vendor Name</li>
                            </ul>
                        </div>
                        <div class="bg-green-50 p-3 rounded-lg">
                            <h4 class="font-medium text-green-700">Customer Info</h4>
                            <ul class="mt-2 text-sm text-gray-600">
                                <li>Customer Name</li>
                                <li>Customer Address</li>
                                <li>Customer ID</li>
                                <li>Tax ID</li>
                            </ul>
                        </div>
                        <div class="bg-yellow-50 p-3 rounded-lg">
                            <h4 class="font-medium text-yellow-700">Line Items</h4>
                            <ul class="mt-2 text-sm text-gray-600">
                                <li>Description</li>
                                <li>Quantity</li>
                                <li>Unit Price</li>
                                <li>Line Total</li>
                            </ul>
                        </div>
                        <div class="bg-purple-50 p-3 rounded-lg">
                            <h4 class="font-medium text-purple-700">Totals</h4>
                            <ul class="mt-2 text-sm text-gray-600">
                                <li>Subtotal</li>
                                <li>Tax Amount</li>
                                <li>Discount</li>
                                <li>Total Amount</li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <section class="mb-12">
            <div class="bg-white rounded-xl shadow-md p-6">
                <h2 class="text-2xl font-semibold text-blue-700 mb-4">Tools & Resources</h2>
                
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                    <div class="border border-gray-200 rounded-lg p-5">
                        <h3 class="text-xl font-semibold mb-3 flex items-center">
                            <i class="fas fa-tools text-blue-500 mr-2"></i>
                            Annotation Tools
                        </h3>
                        <ul class="space-y-2">
                            <li>
                                <a href="https://labelstud.io/" target="_blank" class="text-blue-600 hover:underline flex items-center">
                                    <i class="fas fa-external-link-alt mr-2 text-sm"></i>
                                    Label Studio - Open source annotation tool
                                </a>
                            </li>
                            <li>
                                <a href="https://www.robots.ox.ac.uk/~vgg/software/via/" target="_blank" class="text-blue-600 hover:underline flex items-center">
                                    <i class="fas fa-external-link-alt mr-2 text-sm"></i>
                                    VGG Image Annotator (VIA)
                                </a>
                            </li>
                            <li>
                                <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/form-recognizer/label-tool" target="_blank" class="text-blue-600 hover:underline flex items-center">
                                    <i class="fas fa-external-link-alt mr-2 text-sm"></i>
                                    Azure Form Recognizer Labeling Tool
                                </a>
                            </li>
                        </ul>
                    </div>
                    
                    <div class="border border-gray-200 rounded-lg p-5">
                        <h3 class="text-xl font-semibold mb-3 flex items-center">
                            <i class="fas fa-book text-green-500 mr-2"></i>
                            Documentation
                        </h3>
                        <ul class="space-y-2">
                            <li>
                                <a href="https://huggingface.co/docs/transformers/model_doc/layoutlmv3" target="_blank" class="text-blue-600 hover:underline flex items-center">
                                    <i class="fas fa-external-link-alt mr-2 text-sm"></i>
                                    LayoutLMv3 Official Documentation
                                </a>
                            </li>
                            <li>
                                <a href="https://arxiv.org/abs/2204.08387" target="_blank" class="text-blue-600 hover:underline flex items-center">
                                    <i class="fas fa-external-link-alt mr-2 text-sm"></i>
                                    LayoutLMv3 Research Paper
                                </a>
                            </li>
                            <li>
                                <a href="https://github.com/microsoft/unilm/tree/master/layoutlmv3" target="_blank" class="text-blue-600 hover:underline flex items-center">
                                    <i class="fas fa-external-link-alt mr-2 text-sm"></i>
                                    GitHub Repository
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
                
                <div class="mt-6 bg-blue-50 rounded-lg p-5">
                    <h3 class="text-xl font-semibold mb-3 text-blue-700">Sample Annotation Format</h3>
                    <pre class="bg-white p-4 rounded-md overflow-x-auto text-sm">
{
    "image_path": "invoice_001.jpg",
    "width": 2480,
    "height": 3508,
    "annotations": [
        {
            "label": "vendor_name",
            "bbox": [320, 120, 800, 160],
            "text": "ACME Corporation"
        },
        {
            "label": "invoice_number",
            "bbox": [1600, 120, 2000, 160],
            "text": "INV-2023-0042"
        },
        {
            "label": "invoice_date",
            "bbox": [1600, 180, 2000, 220],
            "text": "2023-06-15"
        }
    ]
}</pre>
                    <p class="mt-3 text-sm text-gray-600">This JSON structure shows how annotated data should be formatted for LayoutLMv3 training.</p>
                </div>
            </div>
        </section>

        <section class="mb-12">
            <div class="bg-white rounded-xl shadow-md p-6">
                <h2 class="text-2xl font-semibold text-blue-700 mb-4">Next Steps After Annotation</h2>
                
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                    <div class="bg-gradient-to-r from-blue-50 to-purple-50 rounded-lg p-6">
                        <h3 class="text-xl font-semibold mb-3 flex items-center">
                            <i class="fas fa-cogs text-purple-500 mr-2"></i>
                            Training Process
                        </h3>
                        <ol class="list-decimal list-inside space-y-2 text-gray-700">
                            <li>Split your dataset (70% train, 15% validation, 15% test)</li>
                            <li>Configure LayoutLMv3 model parameters</li>
                            <li>Start with a small learning rate (e.g., 5e-5)</li>
                            <li>Monitor loss and accuracy metrics</li>
                            <li>Adjust hyperparameters as needed</li>
                        </ol>
                    </div>
                    
                    <div class="bg-gradient-to-r from-green-50 to-blue-50 rounded-lg p-6">
                        <h3 class="text-xl font-semibold mb-3 flex items-center">
                            <i class="fas fa-chart-line text-green-500 mr-2"></i>
                            Evaluation Metrics
                        </h3>
                        <ul class="space-y-2 text-gray-700">
                            <li><span class="font-medium">Field-level F1 score:</span> Precision and recall for each field type</li>
                            <li><span class="font-medium">Exact match accuracy:</span> Percentage of perfectly extracted fields</li>
                            <li><span class="font-medium">Partial match accuracy:</span> For numeric fields with small deviations</li>
                            <li><span class="font-medium">OCR quality impact:</span> Compare with ground truth OCR</li>
                        </ul>
                    </div>
                </div>
                
                <div class="mt-6 bg-yellow-50 rounded-lg p-5">
                    <h3 class="text-xl font-semibold mb-3 text-yellow-700">Scaling Up</h3>
                    <p class="text-gray-700">Once you validate the approach with your 50-sample dataset, consider:</p>
                    <ul class="list-disc list-inside mt-2 space-y-1 text-gray-700">
                        <li>Creating annotation guidelines for your team</li>
                        <li>Implementing quality control processes</li>
                        <li>Exploring semi-supervised learning techniques</li>
                        <li>Using data augmentation for layout variations</li>
                    </ul>
                </div>
            </div>
        </section>

        <section class="bg-blue-600 text-white rounded-xl shadow-lg p-8">
            <div class="max-w-3xl mx-auto text-center">
                <h2 class="text-3xl font-bold mb-4">Ready to Start Annotating?</h2>
                <p class="text-xl mb-6">Get started with your invoice annotation project today and unlock the power of LayoutLMv3 for document understanding.</p>
                <div class="flex flex-col sm:flex-row justify-center gap-4">
                    <a href="#contact" class="bg-white text-blue-600 font-semibold px-6 py-3 rounded-lg hover:bg-blue-50 transition duration-300">
                        <i class="fas fa-envelope mr-2"></i> Contact for Help
                    </a>
                    <a href="https://github.com/microsoft/unilm/tree/master/layoutlmv3" target="_blank" class="bg-blue-800 text-white font-semibold px-6 py-3 rounded-lg hover:bg-blue-700 transition duration-300">
                        <i class="fab fa-github mr-2"></i> View GitHub Repo
                    </a>
                </div>
            </div>
        </section>
    </main>

    <footer class="bg-gray-800 text-white py-8">
        <div class="container mx-auto px-4">
            <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
                <div>
                    <h3 class="text-xl font-semibold mb-4">About LayoutLMv3</h3>
                    <p class="text-gray-300">LayoutLMv3 is a state-of-the-art multimodal pre-trained model for document understanding, combining text, layout, and image information.</p>
                </div>
                <div>
                    <h3 class="text-xl font-semibold mb-4">Quick Links</h3>
                    <ul class="space-y-2">
                        <li><a href="https://huggingface.co/docs/transformers/model_doc/layoutlmv3" target="_blank" class="text-gray-300 hover:text-white">Model Documentation</a></li>
                        <li><a href="https://arxiv.org/abs/2204.08387" target="_blank" class="text-gray-300 hover:text-white">Research Paper</a></li>
                        <li><a href="https://github.com/microsoft/unilm/tree/master/layoutlmv3" target="_blank" class="text-gray-300 hover:text-white">GitHub Repository</a></li>
                    </ul>
                </div>
                <div id="contact">
                    <h3 class="text-xl font-semibold mb-4">Contact</h3>
                    <ul class="space-y-2">
                        <li class="flex items-center">
                            <i class="fas fa-envelope mr-2 text-blue-300"></i>
                            <a href="mailto:support@documentai.example" class="text-gray-300 hover:text-white">support@documentai.example</a>
                        </li>
                        <li class="flex items-center">
                            <i class="fab fa-github mr-2 text-blue-300"></i>
                            <a href="https://github.com/microsoft/unilm" target="_blank" class="text-gray-300 hover:text-white">microsoft/unilm</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="border-t border-gray-700 mt-8 pt-6 text-center text-gray-400">
                <p>&copy; 2023 Document AI Solutions. All rights reserved.</p>
            </div>
        </div>
    </footer>

    <script>
        // Smooth scrolling for anchor links
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();
                document.querySelector(this.getAttribute('href')).scrollIntoView({
                    behavior: 'smooth'
                });
            });
        });

        // Track outbound links
        document.querySelectorAll('a[target="_blank"]').forEach(link => {
            link.addEventListener('click', function() {
                console.log('Outbound link clicked:', this.href);
                // Here you could add analytics tracking
            });
        });
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Jobwengi/object-detection-model" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>