Spaces:
Running
Running
<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>© 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> |