Spaces:
Runtime error
Runtime error
Update README.md
Browse files
README.md
CHANGED
|
@@ -9,22 +9,30 @@ app_file: app.py
|
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
-
#
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
-
|
| 18 |
-
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
##
|
| 27 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
|
| 30 |
|
|
|
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# SPM Exam Simulator (local PDF → JSON → SQLite → Simulator)
|
| 13 |
+
|
| 14 |
+
This repo provides:
|
| 15 |
+
- `ocr_agent.py` — PDF → JSON (extracts text + images).
|
| 16 |
+
- `merge_questions.py` — merge processed JSONs into `questions.json` and populate `exam.db`.
|
| 17 |
+
- `app.py` — Gradio-based Paper 2 (MCQ) simulator that shows questions + diagrams, lets students select A/B/C/D, and reveals score + AI advice after submission.
|
| 18 |
+
- `agents.py` — Analyzer & Coach (ZhipuAI) wrappers.
|
| 19 |
+
|
| 20 |
+
## Quick overview
|
| 21 |
+
1. Put your PDFs under a local folder (recommended: `data/raw/<subject>/<year>/paper2.pdf`).
|
| 22 |
+
2. Run OCR to produce processed JSONs.
|
| 23 |
+
3. Run `merge_questions.py` to create `questions.json` and populate `exam.db`.
|
| 24 |
+
4. Start the simulator: `python app.py`.
|
| 25 |
+
|
| 26 |
+
## Requirements
|
| 27 |
+
- Python 3.10+ (the Docker image used Python 3.10)
|
| 28 |
+
- Install Tesseract OCR (system binary).
|
| 29 |
+
- **Windows**: download and install [Tesseract for Windows] (e.g. from UB Mannheim)
|
| 30 |
+
- **Linux (Debian/Ubuntu)**: `sudo apt-get install tesseract-ocr`
|
| 31 |
+
- **macOS**: `brew install tesseract`
|
| 32 |
+
- Install Python packages:
|
| 33 |
+
```bash
|
| 34 |
+
python -m pip install -r requirements.txt
|
| 35 |
+
|
| 36 |
|
| 37 |
|
| 38 |
|