READMEmain
We couldn't render this README. Read it on GitHub
🧠 SmartDoc MCP - Document Intelligence App
A powerful multi-function document analysis tool built with Gradio, supporting:
- 📄 Document Summarization (Nebius Qwen / Pegasus fallback)
- ❓ Question Answering
- 🌐 Flowchart (Graphviz DOT code) generation
🚀 Features
| Functionality | Description |
|---|---|
| 📂 File Upload | Supports .pdf, .docx, .txt |
| 📝 Direct Text Input | Summarize or ask questions on raw text |
| 📄 AI Summarization | Uses Qwen 2.5 32B (via Nebius) or Google Pegasus |
| ❓ QA on Text | Uses roberta-base-squad2 from HuggingFace |
| 🌐 Flowchart Builder | Visual summary of key points via Graphviz |
| 🔁 Fallback Logic | Automatically switches to Pegasus if Nebius fails |
⚙️ Technologies Used
- Gradio — UI Framework
- Nebius AI Studio — Qwen summarization
- Transformers (Hugging Face) — For Pegasus & QA
- Graphviz — Flowchart rendering
- PyMuPDF (
fitz) — PDF text extraction - python-docx — Word file reader
- OpenAI Python SDK — Nebius-compatible
🔐 .env Configuration
Create a .env file in your root directory with:
NEBIUS_API_KEY=your_actual_api_key_here
MODEL_ID=Qwen/Qwen2.5-32B-Instruct
- Clone the repository:
git clone <your-repo-url>
cd Smart_Document_Helper_MCP
- Install dependencies:
pip install -r requirements.txt
- Install system dependencies (Ubuntu/Debian):
sudo apt-get update && sudo apt-get install -y graphviz libgl1-mesa-glx libglib2.0-0
- Launch the application:
python main.py
Server Deployment
- Make the launch script executable:
chmod +x launch.sh
- Run the launch script:
./launch.sh
System Requirements
- Python 3.8+
- 8GB RAM minimum
- GPU recommended for better performance
