File size: 2,539 Bytes
7163439
 
 
 
 
 
f1ad996
7163439
 
 
a47415e
f1ad996
413c0d5
 
6b69d68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
title: Answer Evaluation App
emoji: 🧠
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
---




# Answer Evaluation App ✍️

# πŸ“ Handwritten Answer Evaluation App using OCR + XLNet

An end-to-end machine learning application that extracts handwritten answers from images and evaluates them using a custom XLNet model trained on semantic similarity.

---

## πŸš€ Live Demo

πŸ‘‰ [Try it on Hugging Face Spaces](https://yeswanthvarma-answer-evaluation-app.hf.space)

---

## πŸ“Œ Project Overview

This app takes images of handwritten answers and performs:
1. **OCR** to extract text from question, student answer, and reference answer.
2. **Similarity scoring** using a custom-trained XLNet model.
3. **Bonus logic** to adjust the final score based on thresholds.
4. **User interface** to upload images and view the evaluated score.

---

## 🧠 Core Technologies

- **FastAPI**: Web framework
- **EasyOCR**: For extracting handwritten text
- **Hugging Face Transformers**: XLNet model
- **Custom Training**: Trained on Q-A-R triplets
- **Docker**: For containerized deployment
- **Hugging Face Spaces**: Live hosted app

---

## πŸ“¦ Folder Structure

```
answer-evaluation-app/
β”œβ”€β”€ app.py                     # FastAPI application
β”œβ”€β”€ requirements.txt           # Dependencies
β”œβ”€β”€ Dockerfile                 # For Hugging Face deployment
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ image_processor.py     # EasyOCR + preprocessing
β”‚   └── xlnet_model.py         # Model load and prediction
β”œβ”€β”€ templates/
β”‚   └── index.html             # Frontend HTML
β”œβ”€β”€ static/
β”‚   β”œβ”€β”€ css/style.css          # UI styling
β”‚   β”œβ”€β”€ js/main.js             # JS for client interaction
β”‚   └── uploads/               # Uploaded image storage
```

---

## πŸ” Model Details

- **Base Model**: `xlnet-base-cased` (Hugging Face)
- **Custom Trained On**: Question, student answer, reference answer, and human-evaluated scores
- **Loss**: MSELoss
- **Output**: Score from 0 to 100
---

## ✍️ Sample Use Case

- Upload 3 images:
  - Question image
  - Student handwritten answer
  - Reference answer
- App will:
  - Extract text
  - Score similarity using model
  - Apply bonus logic
  - Display final score and extracted text

---

## πŸ§‘β€πŸ’» Author

**Yeswanth Varma Gottumukkala**  
- Email: yeswanthvarma.g@gmail.com  

---

## πŸ“œ License

This project is for educational and research purposes.  
Model and app are freely available to explore on Hugging Face Spaces.