This repository contains the implementation of an automated system for grading handwritten subjective answers, leveraging advanced computer vision, natural language processing, and large language model techniques.
The proposed system aims to automate the traditionally labor-intensive task of grading handwritten responses, offering a scalable and efficient solution with the potential to transform education assessment practices. The system utilizes the following key components:
-
Text Detection: The Surya for text line detection in documents.
-
Handwritten Text Recognition: The TrOCR (Transformer-based Optical Character Recognition) model is used for recognizing and transcribing handwritten text within the detected regions.
-
Answer Evaluation: An LLM (API) is employed to evaluate the transcribed handwritten answers against a reference answer key, providing a consistent grading mechanism.
- Accurate text detection in handwritten images using CRAFT (SuryaOCR)
- Robust handwritten text recognition with TrOCR
- Automated grading of subjective answers using a Gemini API
- Consistent and scalable evaluation of handwritten responses
- Potential to transform education assessment practices
- Generate and add your Gemini API key in the grading.py file
- run the command "streamlit run apps.py" in the terminal
- Follow the link
- Enter the question to answer needed to graded, save the question
- Enter the actual answer to the question, save it
- Drag or upload the handwritten answer image and click the extract and segment button
- Once the answer is converted to digital text, click the grade button and get the grade
CUDA installed and configured if using the GPU libraries like streamlit, NumPy, Cv2, PyTorch, PIL need to be installed The Surya OCR and TrOCR are necessary
This work would not have been possible without amazing open source AI work:
- Segformer from NVIDIA
- TrOCR for handwritten text recognition
- Surya for text line detection
- Donut from Naver
- transformers from huggingface
- CRAFT, a great scene text detection model
Thank you to everyone who makes open source AI possible.