# Intelligent Answer Script Evaluation & Automated Mark Assignment
> AI-powered platform for evaluating handwritten student answer scripts,
> comparing answers against faculty-provided references, assigning marks,
> and allowing teacher verification before finalization.
---
## 📌 Project Overview
**Answer_Eval_Platform** is an AI-powered examination evaluation platform
designed to automate the evaluation of handwritten student answer scripts.
The system accepts:
1. A **Question Paper**
2. A **Faculty Model Answer / Answer Key**
3. A **Student Handwritten Answer Script**
It then:
```text
Question Paper
│
▼
Question Extraction
│
▼
Model Answers / Rubrics
│
│
│
Student Answer Script
│
▼
PDF / Image Processing
│
▼
Page Extraction
│
▼
Handwriting Line Segmentation
│
▼
Local TrOCR
│
▼
OCR Text
│
▼
Question Association
│
▼
Answer Evaluation
│
├── MCQ → Exact Option Matching
│
└── Descriptive → Semantic + Keyword/Rubric Matching
│
▼
AI Marks
│
▼
Confidence Evaluation
│
├── High Confidence → Auto Approval
│
└── Low / Uncertain → Teacher Review
│
▼
Teacher Verification / Override
│
▼
Final Marks
│
▼
Reports / AnalyticsThe goal is not to blindly replace teachers.
The system is designed as:
AI-assisted evaluation with teacher verification.
The platform is being developed to achieve the following:
- Automatically read handwritten answer scripts.
- Convert handwriting into machine-readable text.
- Identify which answer belongs to which question.
- Compare student answers with faculty-provided answers.
- Evaluate MCQ and descriptive questions differently.
- Assign AI-generated marks.
- Estimate evaluation confidence.
- Automatically flag uncertain evaluations.
- Allow teachers to review and override AI marks.
- Generate final examination reports.
- Learn from teacher corrections in future iterations.
┌─────────────────────┐
│ Question Paper │
│ PDF / DOCX │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Question Paper │
│ Parser │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Questions + Marks │
│ + Question Type │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Faculty Model │
│ Answers / Rubrics │
└──────────┬──────────┘
│
│
│
┌───────────────────┐ │
│ Student Answer │ │
│ Script PDF/Image │ │
└─────────┬─────────┘ │
│ │
▼ │
┌───────────────────┐ │
│ PDF Page │ │
│ Extraction │ │
└─────────┬─────────┘ │
│ │
▼ │
┌───────────────────┐ │
│ Image │ │
│ Preprocessing │ │
└─────────┬─────────┘ │
│ │
▼ │
┌───────────────────┐ │
│ Line Segmentation │ │
└─────────┬─────────┘ │
│ │
▼ │
┌───────────────────┐
│ Local TrOCR │
│ Handwriting OCR │
└─────────┬─────────┘
│
▼
┌───────────────────┐
│ OCR Text + │
│ Confidence │
└─────────┬─────────┘
│
▼
┌────────────────────────────┐
│ Question Marker Association│
└────────────┬───────────────┘
│
▼
┌───────────────┐
│ Evaluation │
│ Pipeline │
└───────┬───────┘
│
┌──────┴────────┐
▼ ▼
MCQ Descriptive
│ │
▼ ▼
Exact Option Semantic +
Matching Keyword/Rubric
│ │
└───────┬───────┘
▼
┌──────────────┐
│ AI Marks │
└──────┬───────┘
│
▼
┌──────────────┐
│ Confidence │
└──────┬───────┘
│
┌───────┴─────────┐
▼ ▼
Approved Teacher Review
│
▼
Teacher Override
│
▼
Final Marks
Answer_Eval_Platform/
│
├── backend/
│ │
│ ├── ai/
│ │ ├── ocr/
│ │ │ ├── ocr_service.py
│ │ │ ├── trocr_service.py
│ │ │ └── handwriting_segmentation.py
│ │ │
│ │ ├── nlp/
│ │ │ └── nlp_service.py
│ │ │
│ │ └── ml/
│ │ └── ml_service.py
│ │
│ ├── api/
│ │ ├── auth.py
│ │ ├── subjects.py
│ │ ├── students.py
│ │ ├── faculty.py
│ │ ├── question_papers.py
│ │ ├── model_answers.py
│ │ ├── examinations.py
│ │ ├── answer_scripts.py
│ │ ├── evaluations.py
│ │ ├── teacher_review.py
│ │ └── reports.py
│ │
│ ├── models/
│ │ ├── exam.py
│ │ └── ...
│ │
│ ├── services/
│ │ ├── evaluation_pipeline.py
│ │ ├── document_parser.py
│ │ ├── storage_service.py
│ │ └── celery_app.py
│ │
│ ├── scripts/
│ │ ├── seed_admin.py
│ │ └── migrate_add_trocr_columns.py
│ │
│ ├── tests/
│ │ ├── conftest.py
│ │ ├── test_document_parser.py
│ │ ├── test_final_marks.py
│ │ ├── test_handwriting_segmentation.py
│ │ ├── test_mcq_scoring.py
│ │ └── test_trocr_model_loading.py
│ │
│ ├── requirements.txt
│ ├── requirements-lite.txt
│ └── main.py
│
├── frontend/
│ │
│ ├── src/
│ │ ├── pages/
│ │ ├── components/
│ │ ├── services/
│ │ └── ...
│ │
│ ├── package.json
│ └── vite.config.ts
│
├── models/
│ └── handwriting/
│ └── trocr-base-handwritten/
│
├── dataset/
│ ├── train.parquet
│ ├── test.parquet
│ └── validation.parquet
│
├── datasets/
│ └── handwriting/
│ └── benchmark_results/
│ └── trocr_test_results.csv
│
├── training/
│ └── handwriting/
│ └── test_trocr_dataset.py
│
├── scripts/
│ └── ...
│
├── .gitignore
├── main.py
└── README.md
The faculty uploads a:
- DOCX
The document parser extracts:
- Question number
- Question text
- Maximum marks
- MCQ options
- Question type
Question types are detected generically.
The system does not assume:
Q1-Q20 = MCQ
Q21-Q35 = descriptive
Instead, question types are detected from the document.
This allows mixed question papers such as:
Q1 → MCQ
Q2 → Descriptive
Q3 → MCQ
Q4 → Descriptive
Q5 → MCQ
Each question can have a model answer.
Example:
Question:
Which of the following is an assumption of Linear Regression?
A. High multicollinearity
B. Little or no autocorrelation
C. Heteroscedasticity
D. All of the mentioned
Correct Option:
B
The system uses normalized exact option matching.
No semantic model is required for MCQs.
Example:
Question:
Define Supervised Learning.
Reference Answer:
A type of ML where the model is trained on
labeled data with known inputs and outputs.
Keywords:
labeled data
known inputs
known outputs
machine learning
The evaluator can use:
- Semantic similarity
- Keyword matching
- Rubric information
Student answer scripts can be:
- JPG
- PNG
The pipeline is:
Student PDF
↓
PDF Page Extraction
↓
Image Preprocessing
↓
Horizontal Projection
↓
Line Detection
↓
Line Crops
↓
TrOCR
↓
Recognized Text
The project uses:
microsoft/trocr-base-handwritten
The model is executed locally.
The application uses:
local_files_only=True
Therefore:
- No cloud OCR API is required.
- No handwriting data is sent to an external OCR provider.
- The model is not downloaded during evaluation.
- Missing model files produce an explicit error.
TrOCR is designed for text-line recognition.
It should NOT receive an entire handwritten exam page.
Incorrect:
Full Page
↓
TrOCR
Correct:
Full Page
↓
Line Segmentation
↓
Individual Line
↓
TrOCR
This distinction is extremely important for this project.
Testing confirmed that line-level recognition is significantly more useful than directly passing an entire answer page.
Expected location:
models/
└── handwriting/
└── trocr-base-handwritten/
├── config.json
├── generation_config.json
├── merges.txt
├── preprocessor_config.json
├── special_tokens_map.json
├── tokenizer_config.json
├── vocab.json
└── model.safetensors
The actual model weights are intentionally not part of normal Git source management.
The model can be configured through:
TROCR_MODEL_DIR=../models/handwriting/trocr-base-handwrittenBackend .env example:
DATABASE_URL=postgresql://postgres:password@localhost:5432/answer_eval
OCR_ENGINE=trocr
TROCR_MODEL_DIR=../models/handwriting/trocr-base-handwritten
TROCR_DEVICE=auto
SCAN_DPI=300
LOW_CONFIDENCE_LINE_THRESHOLD=0.35
AUTO_APPROVE_CONFIDENCE_THRESHOLD=0.85The project currently uses a handwriting dataset stored as:
dataset/
├── train.parquet
├── test.parquet
└── validation.parquet
The dataset contains:
text
image
The text field provides the ground-truth transcription.
This is important because it allows objective OCR evaluation.
Before attempting fine-tuning, the existing TrOCR model was tested against the ground-truth handwriting dataset.
The benchmark script is:
training/handwriting/test_trocr_dataset.py
Run:
.\backend\venv\Scripts\python.exe training\handwriting\test_trocr_dataset.pyThe benchmark evaluates:
- Successful OCR runs
- Exact matches
- Character Error Rate (CER)
- Word Error Rate (WER)
The current 100-sample benchmark produced:
Samples tested : 100
Successful : 100
Exact matches : 18 / 100
Average CER : 7.14%
Average WER : 28.92%
Results:
datasets/
└── handwriting/
└── benchmark_results/
└── trocr_test_results.csv
Character Error Rate measures character-level mistakes.
Current:
CER = 7.14%
This indicates that the model is recognizing most individual characters correctly.
Word Error Rate measures word-level mistakes.
Current:
WER = 28.92%
This is considerably higher than CER.
This means the model can recognize characters reasonably well while still producing incorrect word boundaries or complete words.
Current:
18 / 100
Only 18 samples matched the reference transcription exactly.
Therefore, the current OCR should not yet be considered perfect.
The next step is to inspect the failed predictions rather than immediately fine-tuning.
Use:
.\backend\venv\Scripts\python.exe -c "import pandas as pd; f=r'.\datasets\handwriting\benchmark_results\trocr_test_results.csv'; df=pd.read_csv(f); print(df.sort_values('wer',ascending=False)[['sample','reference','prediction','cer','wer']].head(10).to_string(index=False))"This displays the worst predictions.
The purpose is to determine whether errors come from:
- Poor handwriting
- Incorrect line segmentation
- Image quality
- Cropping
- Skew
- Noise
- Text normalization
- TrOCR recognition
- Dataset characteristics
Do not immediately fine-tune the model.
Use this order:
Existing TrOCR
↓
Benchmark
↓
Inspect Errors
↓
Improve Image Preprocessing
↓
Improve Line Segmentation
↓
Benchmark Again
↓
Test Real Exam Pages
↓
Benchmark Again
↓
Only Then Consider Fine-Tuning
Fine-tuning should be performed only if the existing model plus preprocessing cannot provide sufficient accuracy.
The project also contains a real examination dataset.
The intended structure is:
datasets/
└── exam_dataset/
├── Student_Pdf/
├── Corrected_Pdf/
├── AnswerKey/
└── Question/
The dataset contains handwritten student answer scripts together with corrected papers and faculty evaluation information.
This dataset is especially useful for evaluating the complete grading pipeline.
Unlike the handwriting OCR dataset, it does not necessarily provide exact handwriting transcriptions for every answer.
Therefore:
Handwriting Dataset
↓
OCR accuracy evaluation
Student Examination Dataset
↓
End-to-end evaluation / grading accuracy
These are two different evaluation problems.
OCR text alone is not enough.
The system must determine:
Which question does this answer belong to?
For example:
Q21
Define Supervised Learning.
Student:
"Supervised learning is a machine learning algorithm..."
The pipeline should associate the recognized block with:
Question 21
Question-marker detection follows a safety rule:
Confident question marker
↓
Assign question
If the system cannot confidently identify the question:
Unknown / ambiguous marker
↓
uncertain
↓
Teacher Review
The system must never silently guess the question number.
This prevents an OCR mistake from causing an answer to be evaluated against the wrong question.
Example:
Reference:
B
Student:
D
Result:
0 marks
If:
Reference:
B
Student:
b
Normalization allows:
B == b
and the answer is considered correct.
Descriptive answers use:
Student Answer
+
Reference Answer
+
Keywords / Rubric
↓
Semantic Similarity
+
Keyword Matching
↓
AI Score
The purpose is to evaluate meaning rather than exact wording.
For example:
Reference:
A type of ML where the model is trained
on labeled data with known inputs and outputs.
Student:
Supervised learning trains a model using
data where the correct output is already known.
These answers use different words but communicate similar meaning.
AI evaluation is not always trusted automatically.
The system has a teacher-review stage.
AI Evaluation
│
▼
Confidence Check
│
┌────┴─────┐
│ │
High Low
│ │
▼ ▼
Approve Review
│
▼
Teacher Decision
If a question marker is uncertain, the evaluation is forced into review.
Teacher marks always take priority.
Conceptually:
if teacher_marks exists:
final_marks = teacher_marks
else:
final_marks = ai_marks
Therefore reports should never accidentally display the old AI score after a teacher correction.
The Evaluation.final_marks property is used for this purpose.
The platform supports report generation including:
- Student information
- Examination
- Question
- AI marks
- Final marks
- Maximum marks
- Evaluation status
Final marks are used after teacher corrections.
The frontend is built using:
- React 19
- Vite
- TypeScript
- TailwindCSS
- Framer Motion
- React Router
- React Hook Form
- Zod
- Axios
- Recharts
- Lucide
Major areas include:
Dashboard
Subjects
Students
Faculty
Question Papers
Model Answers
Examinations
Answer Scripts
AI Evaluation
Teacher Review
Reports
Settings
Backend technologies:
- FastAPI
- SQLAlchemy
- PostgreSQL
- JWT authentication
- Celery
- Redis
- OpenCV
- PyTorch
- Transformers
- TrOCR
- PaddleOCR
- Sentence-Transformers
- scikit-learn
The platform uses JWT authentication.
Roles currently include:
Admin
Teacher
Default development account:
username: admin
password: ChangeMe@123
Change this immediately for any real deployment.
Recommended:
Python 3.11 / 3.12
Node.js
npm
PostgreSQL
Redis
Git
For local handwriting OCR:
PyTorch
Transformers
Pillow
SentencePiece
TrOCR model weights
Faster alternative using uv (works on any Linux distro):
cd backend
uv venv venv --python 3.12 # pinned deps target Python 3.12
uv pip install --python venv/bin/python -r requirements-lite.txt pytest httpx
# AI stack (torch CPU + transformers + sentence-transformers + opencv + pymupdf):
uv pip install --python venv/bin/python torch --index-url https://download.pytorch.org/whl/cpu
uv pip install --python venv/bin/python "transformers==4.44.2" "sentence-transformers==3.1.1" "opencv-python-headless==4.10.0.84" "pymupdf==1.24.10"SQLite needs no server — backend/.env uses DATABASE_URL=sqlite:///./local_dev.db.
Seed and run:
venv/bin/python -m scripts.seed_admin
venv/bin/python -m uvicorn main:app --host 127.0.0.1 --port 8000Full end-to-end verification (48 checks incl. the real OCR pipeline) against a running backend:
venv/bin/python scripts/smoke_test_api.pyNote: the checked-in backend/venv from a Windows machine cannot run on Linux
(the python.exe binaries are PE executables). Recreate the venv with the
steps above when switching OS.
From the project root:
cd backendCreate the virtual environment:
python -m venv venvActivate it:
.\venv\Scripts\Activate.ps1Upgrade pip:
python -m pip install --upgrade pipInstall dependencies:
pip install -r requirements.txtThis project may have multiple Python environments.
Always verify which Python is being used:
python --versionor:
.\backend\venv\Scripts\python.exe --versionFor project commands, the safest approach is:
.\backend\venv\Scripts\python.exeDo not accidentally run the project using:
C:\Python313\python.exe
if the required dependencies are installed in the project virtual environment.
Configure:
backend/.env
Example:
DATABASE_URL=postgresql://postgres:password@localhost:5432/answer_evalThen seed the administrator:
cd backend
python -m scripts.seed_adminIf the database already existed before the TrOCR changes:
cd backend
python -m scripts.migrate_add_trocr_columnsThe migration is additive.
It does not intentionally delete existing examination data.
cd backend
.\venv\Scripts\Activate.ps1
uvicorn main:app --reloadBackend:
http://localhost:8000
API documentation:
http://localhost:8000/api/docs
Open another terminal:
cd frontend
npm install
npm run devFrontend:
http://localhost:5173
The repository contains a root-level launcher that boots the whole stack with one command — no Docker, no Postgres, no manual steps:
python main.py # quick start: SQLite + lite backend deps
python main.py --full-ai # also install the OCR/NLP/ML stack (torch, transformers, ...)
python main.py --reset-db # wipe backend/local_dev.db and reseed (refused while the backend is running)
python main.py --backend-only
python main.py --frontend-only
python main.py --helpWhat it does, in order:
- Creates
backend/venvwith a suitable Python (3.10–3.12). It prefersuv(which can fetch a managed Python 3.12), falls back topython3.12/python3.11/python3.10on PATH, then to the interpreter running the launcher. A venv that exists but cannot run (e.g. one created on Windows and reused from Linux/WSL) is detected and rebuilt automatically. - Installs backend requirements —
requirements-lite.txtby default,requirements.txtwith--full-ai— but skips pip entirely when the key packages are already importable, so re-runs are instant. - Writes
backend/.envin SQLite mode if missing, and createsfrontend/.envpointing at the API. - Seeds the admin user (
admin / ChangeMe@123, idempotent) and applies the additive schema migration (safe no-op when up to date). - Starts FastAPI on
:8000and the Vite frontend on:5173— skipping either one if its port is already serving — and shuts both down cleanly on Ctrl+C.
Stop everything and reset to a clean slate:
# stop the launcher with Ctrl+C, then:
python main.py --reset-dbNote: the full-AI evaluation pipeline needs the model weights under
models/handwriting/trocr-base-handwritten/— with--full-aiinstalled and the weights present, uploaded scanned scripts are graded by the real local TrOCR + semantic scoring pipeline. Without them, the core app (auth, CRUD, uploads, dashboards) still works and evaluation requests fail gracefully. Celery/Redis workers are not required and are not started by the launcher.
Docker support may be added/maintained as deployment work progresses.
The intended architecture is:
Frontend
│
▼
FastAPI Backend
│
┌──┴─────────────┐
▼ ▼
PostgreSQL Redis
│
▼
Celery
│
▼
AI Evaluation
From the backend:
cd backend
pytest tests/ -vTests cover areas including:
Question parsing
MCQ parsing
MCQ scoring
Answer normalization
Line segmentation
Question marker detection
Uncertain question handling
Teacher mark precedence
TrOCR model loading
TrOCR model tests may skip when the local model weights are unavailable.
Once the model is installed, run:
pytest tests/test_trocr_model_loading.py -vUse this sequence:
cd backend
pytest tests/ -vcd ..
.\backend\venv\Scripts\python.exe training\handwriting\test_trocr_dataset.py.\backend\venv\Scripts\python.exe -c "import pandas as pd; f=r'.\datasets\handwriting\benchmark_results\trocr_test_results.csv'; df=pd.read_csv(f); print(df.sort_values('wer',ascending=False)[['sample','reference','prediction','cer','wer']].head(10).to_string(index=False))"Run the actual evaluation pipeline against a student answer script.
Check:
PDF extraction
↓
Line segmentation
↓
OCR
↓
Question association
↓
Answer extraction
↓
Scoring
↓
Confidence
↓
Teacher review
For every question:
AI Marks
Teacher Marks
Difference
Calculate:
Average absolute error
Exact agreement
Within ±0.5 marks
Within ±1 mark
This is more important for the final system than OCR accuracy alone.
The project should eventually track two separate groups of metrics.
CER
WER
Exact Match
Line Detection Accuracy
Question Marker Accuracy
Mean Absolute Error
Mean Absolute Percentage Error
Exact Mark Agreement
Within ±0.5 Marks
Within ±1 Mark
Correlation with Teacher Marks
Question-level Accuracy
Total-paper Accuracy
The project contains an ML confidence component.
Initially:
Teacher-reviewed evaluations < 20
↓
Heuristic confidence
After enough teacher-reviewed examples:
Teacher-reviewed evaluations
↓
Feature extraction
↓
scikit-learn model
↓
Confidence prediction
The confidence model should improve as the platform accumulates verified evaluations.
The long-term system is intended to work like:
Student Answer
↓
AI Evaluation
↓
Teacher Review
↓
Corrected Mark
↓
Training Data
↓
Improved Confidence / Evaluation Models
↓
Better Future Evaluations
Teacher corrections are therefore valuable training data.
Large datasets and model weights should not normally be stored directly in the Git repository.
Examples:
dataset/*.parquet
*.safetensors
*.pt
*.pth
*.ckpt
The local model may contain:
model.safetensors
which is approximately gigabyte-scale and should be handled separately.
The dataset files are also large:
train.parquet
test.parquet
validation.parquet
Keep these available locally for experimentation while keeping repository history manageable.
Student examination papers can contain sensitive academic information.
Production deployments should consider:
- Access control
- Secure storage
- Encryption
- Database security
- File permissions
- Audit logging
- Data retention policies
- Student anonymization
- Secure backups
The local TrOCR pipeline is designed so handwriting OCR itself does not require a cloud OCR provider.
The project is a working core platform, but several areas still require development.
Current benchmark:
CER: 7.14%
WER: 28.92%
Exact: 18%
Further improvement is required for highly reliable handwritten examination evaluation.
Current segmentation uses generic image analysis and horizontal projection.
Different handwriting styles, page layouts, ink colors, shadows, and scan quality can affect detection.
Question markers that cannot be identified confidently are flagged for review.
This is intentional.
The system should prioritize correctness over guessing.
Semantic similarity and keyword matching are useful but do not perfectly reproduce human marking.
Rubric-aware scoring should be improved over time.
The current review workflow primarily supports total-mark override.
Per-question teacher mark editing can be expanded further.
The backend stores evaluation status and progress information.
A more complete implementation can add:
WebSocket / polling
↓
Live frontend progress
for:
Uploading
Extracting pages
Segmenting lines
Running OCR
Evaluating
Generating results
The recommended development order is:
PHASE 1
Existing Platform
↓
PHASE 2
OCR Benchmark
↓
PHASE 3
OCR Error Analysis
↓
PHASE 4
Image Preprocessing Improvements
↓
PHASE 5
Line Segmentation Improvements
↓
PHASE 6
Real Student Answer Testing
↓
PHASE 7
Question Association Validation
↓
PHASE 8
End-to-End Grading Validation
↓
PHASE 9
Teacher Review Improvements
↓
PHASE 10
Evaluation Model Improvements
↓
PHASE 11
TrOCR Fine-Tuning if necessary
↓
PHASE 12
Confidence Model Training
↓
PHASE 13
Production Hardening
The current priority should not be adding random features.
The immediate workflow is:
Inspect the worst 10–20 predictions.
Classify errors into:
Segmentation
Preprocessing
OCR
Normalization
Dataset
If segmentation is responsible for errors:
Improve segmentation
If image quality is responsible:
Improve preprocessing
If TrOCR itself is responsible:
Consider fine-tuning
Use real student answer scripts.
Do not rely only on the handwriting benchmark.
Ensure:
Q21 → Q21 answer
Q22 → Q22 answer
Q23 → Q23 answer
and never:
Q21 → Q22
Compare:
AI marks
vs.
Teacher marks
for the real examination dataset.
The current implementation has already established the following baseline:
Frontend
✓ npm install
✓ TypeScript compilation
✓ Vite production build
Backend
✓ Application imports
✓ FastAPI application
✓ OpenAPI generation
✓ SQLAlchemy models
✓ Database table creation
AI
✓ TrOCR integration
✓ Local model loading
✓ Line segmentation
✓ Question marker detection
✓ MCQ scoring
✓ Descriptive scoring integration
✓ Confidence pipeline
OCR Benchmark
✓ 100 samples processed
✓ CER measured
✓ WER measured
✓ Exact matches measured
Testing
✓ Unit/integration tests
The project follows several important principles.
Bad:
Q1-Q20 are always MCQs
Q21-Q35 are always descriptive
Good:
Detect question structure from the uploaded paper.
Bad:
Question 21 is always at x=100, y=5000
Good:
Detect text regions dynamically.
Bad:
Page → TrOCR
Good:
Page
↓
Line segmentation
↓
Line crop
↓
TrOCR
Bad:
Probably Q21
Good:
uncertain → teacher review
Bad:
Report → AI marks
Good:
Report → final_marks
Bad:
Model has errors
↓
Immediately fine-tune
Good:
Measure
↓
Analyze
↓
Improve preprocessing
↓
Measure again
↓
Fine-tune only if necessary
A developer continuing this project should understand these areas in roughly this order:
1. Python
2. FastAPI
3. SQLAlchemy
4. PostgreSQL
5. React + TypeScript
6. OpenCV
7. OCR
8. Transformers
9. TrOCR
10. NLP semantic similarity
11. Machine learning
12. Evaluation metrics
13. Celery + Redis
14. Production deployment
For the AI portion:
Image
↓
Computer Vision
↓
OCR
↓
NLP
↓
Semantic Evaluation
↓
Scoring
↓
Confidence
↓
Human Verification
backend/ai/ocr/trocr_service.py
backend/ai/ocr/handwriting_segmentation.py
backend/ai/ocr/ocr_service.py
backend/services/evaluation_pipeline.py
backend/services/document_parser.py
backend/ai/ml/ml_service.py
backend/models/exam.py
training/handwriting/test_trocr_dataset.py
models/handwriting/trocr-base-handwritten/
GitHub:
https://github.com/vin1397/Answer_Eval_Platform
The project should be considered to be at this point:
CURRENT STATE
│
▼
Core platform working
│
▼
Local TrOCR integrated
│
▼
OCR benchmark completed
│
▼
7.14% average CER
28.92% average WER
18% exact matches
│
▼
Error analysis NEXT
│
▼
Real exam validation
│
▼
End-to-end grading validation
│
▼
Model improvement
The final system should allow a teacher to do this:
1. Create Examination
↓
2. Upload Question Paper
↓
3. Questions automatically extracted
↓
4. Add / verify Model Answers
↓
5. Upload Student Answer Scripts
↓
6. AI scans handwritten answers
↓
7. AI identifies questions
↓
8. AI evaluates answers
↓
9. AI assigns marks
↓
10. AI calculates confidence
↓
11. Uncertain answers go to Teacher Review
↓
12. Teacher approves / corrects marks
↓
13. Final marks are stored
↓
14. Reports are generated
The ultimate objective is:
A reliable AI-assisted examination evaluation platform where handwriting recognition, question understanding, answer evaluation, automated marking, confidence estimation, and teacher verification work together as one complete system.
Do not restart the project when adding new AI capabilities.
Continue from the existing architecture.
Improve individual stages:
OCR
↓
Segmentation
↓
Question Association
↓
Answer Extraction
↓
Evaluation
↓
Confidence
↓
Teacher Review
Every improvement should be benchmarked against the previous version so that progress can be measured objectively.
### One important correction from your old README
Your pasted README still says **Docker Compose is recommended**, but your recent Git history shows:
```text
delete mode 100644 docker-compose.yml