--- title: Extract Document To Markdown emoji: 🌖 colorFrom: yellow colorTo: gray sdk: gradio sdk_version: 5.32.1 app_file: app.py pinned: false license: mit short_description: extract a document from pdf/docx to md tags: - mcp-server-track --- # Document Extraction Tool - Simplified Version A streamlined tool that extracts text from PDF and DOCX files and converts it to Markdown format. The extractor is initialized at startup and ready to process documents on demand. ## Features - **Fast startup** - Extractor pre-initialized and ready to use - **PDF & DOCX support** - Extract text from common document formats - **Markdown output** - Clean, structured markdown format - **Enhanced extraction** - Uses Docling when available, PyPDF2 as fallback - **Error handling** - Graceful handling of corrupted or problematic files - **Simple interface** - Clean, easy-to-use web interface ## Quick Start ```bash # Install dependencies pip install -r requirements.txt # Run the application python app.py ``` Access the tool at: `http://localhost:7860` ## Usage 1. Upload a PDF or DOCX document 2. Click "Extract Text" 3. View the extracted Markdown content 4. Download the results if needed ## Technology - **Gradio** - Web interface - **Docling** - Advanced document extraction (optional) - **PyPDF2** - PDF processing fallback - **python-docx** - DOCX processing ## Architecture The tool uses a singleton pattern with a pre-initialized extractor: - Faster response times (no initialization delay) - Automatic fallback between extraction methods - Enhanced error handling for edge cases ## License MIT Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference