# LayoutLMv3 Document Classifier Demo This is a Gradio demo for the `jmparejaz/layoutlmv3-base-expedientes` model - a fine-tuned LayoutLMv3 model for classifying Colombian legal documents (expedientes). ## 📋 Overview This demo provides an interactive interface to test the document classification capabilities of the LayoutLMv3 model. The demo is designed to run on CPU for accessibility, though this means inference may be slower than with GPU acceleration. ## 🚀 Quick Start ### Local Development ```bash # Clone this repository git clone https://huggingface.co/spaces/jmparejaz/layoutlmv3-demo cd layoutlmv3-demo # Install dependencies pip install -r requirements.txt # Run the demo python app.py ``` The demo will be available at `http://localhost:7860` ## 📦 Features - **Interactive Classification**: Upload document images via URL and get instant classification - **Mock Pipeline**: Demonstrates the expected behavior (replace with actual model for production) - **Comprehensive Documentation**: Includes usage examples and implementation notes - **Responsive UI**: Clean, user-friendly interface with Gradio ## 🔧 Configuration The demo uses a mock inference pipeline for demonstration purposes. To use the actual model: 1. Replace the `MockInferencePipeline` class with the real implementation 2. Load the actual LayoutLMv3 model from Hugging Face 3. Use the LayoutLMv3Processor for proper preprocessing ## 📊 Model Information - **Model Name**: `jmparejaz/layoutlmv3-base-expedientes` - **Version**: 0.1.0 - **Status**: Under active development - **License**: Apache 2.0 - **Framework**: Transformers + LayoutLMv3 ## ⚠️ Limitations - **Version 0.1.0**: This is an early development version - **CPU Inference**: Demo runs on CPU (slower than GPU) - **Mock Implementation**: Uses mock results for demonstration - **Not Production-Ready**: Model is still undergoing improvements ## 🎯 Roadmap - [ ] Replace mock pipeline with actual model loading - [ ] Add GPU acceleration support - [ ] Implement batch processing - [ ] Add more document examples - [ ] Improve error handling and validation ## 🤝 Contributing Contributions are welcome! Please open issues or pull requests on the Hugging Face Space. ## 📜 License This project is licensed under the Apache 2.0 License.