Document Question Answering
Transformers
PyTorch
English
document-processing
ocr
ner
text-classification
information-extraction
invoice
receipt
form
Instructions to use mrrobot2610/IDP-Machine-learning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mrrobot2610/IDP-Machine-learning with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("document-question-answering", model="mrrobot2610/IDP-Machine-learning")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mrrobot2610/IDP-Machine-learning", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download SETUP_INSTRUCTIONS.md from mrrobot2610/IDP-Machine-learning: direct link, hf CLI and curl.
- Browser
- Download file 2.3 kB
-
https://huggingface.co/mrrobot2610/IDP-Machine-learning/resolve/main/SETUP_INSTRUCTIONS.md
- Command line
-
hf download hf://mrrobot2610/IDP-Machine-learning/SETUP_INSTRUCTIONS.md
-
curl -L -o SETUP_INSTRUCTIONS.md https://huggingface.co/mrrobot2610/IDP-Machine-learning/resolve/main/SETUP_INSTRUCTIONS.md
2.3 kB
| # IDP System - Manual Setup Instructions (CMD Shell) | |
| ## Quick Start Commands | |
| Since you're using CMD shell, here are the exact commands to run: | |
| ### Step 1: Install Frontend Dependencies | |
| Open **Command Prompt (cmd)** and run: | |
| ```cmd | |
| cd C:\Users\Harsh-Stu\IDP[ML]\frontend | |
| npm install | |
| ``` | |
| If you still get permission errors, try: | |
| ```cmd | |
| npm install --legacy-peer-deps | |
| ``` | |
| --- | |
| ### Step 2: Start Backend Server | |
| Open a **new Command Prompt window** and run: | |
| ```cmd | |
| cd C:\Users\Harsh-Stu\IDP[ML] | |
| python api_server.py | |
| ``` | |
| You should see: | |
| - ✓ Pipeline initialized successfully! | |
| - ⚠ Using demo mode (rule-based) classifier (this is expected - no trained classifier yet) | |
| - ✓ Loaded trained NER model | |
| - Server running on http://0.0.0.0:7860 | |
| --- | |
| ### Step 3: Start Frontend Dev Server | |
| Open a **third Command Prompt window** and run: | |
| ```cmd | |
| cd C:\Users\Harsh-Stu\IDP[ML]\frontend | |
| npm run dev | |
| ``` | |
| Frontend will be available at: **http://localhost:3000** | |
| --- | |
| ## Testing the System | |
| 1. **Open browser**: Navigate to http://localhost:3000 | |
| 2. **Upload a document**: Drag and drop or click to select an invoice/receipt image or PDF | |
| 3. **Process**: Click "Process Document" | |
| 4. **View results**: See extracted document type and entities | |
| --- | |
| ## Current System Status | |
| ✅ **Backend Ready** | |
| - FastAPI server configured | |
| - Demo mode classifier (rule-based) | |
| - Trained NER model (F1: 0.6247) | |
| - OCR engine (PaddleOCR) | |
| ✅ **Frontend Ready** | |
| - Next.js application | |
| - API integration configured | |
| - File upload with validation | |
| - Results display | |
| ⚠️ **Note**: Currently using demo mode for document classification. For better accuracy, you can train the classifier later by running: | |
| ```cmd | |
| cd C:\Users\Harsh-Stu\IDP[ML] | |
| python train_classifier.py | |
| ``` | |
| --- | |
| ## Troubleshooting | |
| ### Backend won't start | |
| - Check if port 7860 is already in use | |
| - Verify Python dependencies: `pip list | findstr "fastapi torch paddleocr"` | |
| ### Frontend won't start | |
| - Delete `node_modules` and `package-lock.json`, then reinstall | |
| - Try: `npm install --force` | |
| - Check if port 3000 is already in use | |
| ### CORS errors | |
| - Backend is configured to allow all origins for development | |
| - Make sure backend is running before starting frontend | |