IDP-Machine-learning / SETUP_INSTRUCTIONS.md
mrrobot2610's picture
Initial commit: IDP (Intelligent Document Processing) System
1a7ee60
|
Raw History Blame Contribute Delete
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