Skip to content

kishorekrrish3/AutoGradeAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ AutoGradeAI

Intelligent Automated Grading using OCR and Semantic Similarity

A smart AI-powered grading system that evaluates handwritten student answers by combining OCR, NLP, and semantic similarity. Upload an answer sheet, compare it with the model answer, and automatically compute a fair grade.


Python Streamlit EasyOCR SentenceTransformers TextBlob MIT License


๐Ÿ“– What is AutoGradeAI?

AutoGradeAI is an AI-powered automated grading system designed to streamline the evaluation of handwritten student answers.

Traditional grading requires teachers to manually read and score each answer. This project eliminates that burden by combining OCR (Optical Character Recognition) and semantic similarity models to evaluate answers intelligently.

When an answer sheet is uploaded:

  1. EasyOCR extracts text from the scanned handwritten answer.
  2. TextBlob corrects spelling errors introduced during OCR extraction.
  3. SentenceTransformers generates embeddings for both student and model answers.
  4. The system computes a semantic similarity score between them.
  5. The similarity score is converted into a final grade based on configurable weightage.

The result is a system that evaluates answers based on meaning rather than exact wording, making grading more fair and efficient.


โœจ Features

Feature Description
๐Ÿง  AI-Powered Grading Uses semantic similarity instead of simple keyword matching
๐Ÿ“ Handwritten Text Extraction EasyOCR extracts text directly from scanned answer sheets
โœ๏ธ Spelling Correction TextBlob automatically corrects OCR mistakes
๐ŸŽฏ Semantic Similarity Evaluation SentenceTransformers compares meaning between answers
โš–๏ธ Custom Weightage System Teachers can define marks per question
๐Ÿ“Š Similarity-Based Grading Marks are calculated from similarity score percentages
๐ŸŒ Interactive Web App Built with Streamlit for easy use

๐Ÿ—๏ธ System Architecture

Grading Pipeline

graph TD
    A[๐Ÿ‘ค Teacher uploads answer sheet] --> B[Streamlit Web Interface]
    B --> C[Image Processing]
    C --> D[EasyOCR Text Extraction]
    D --> E[TextBlob Spelling Correction]

    E --> F[Student Answer Embedding]
    G[Model Answer] --> H[Model Embedding]

    F --> I[Semantic Similarity Calculation]
    H --> I

    I --> J[Similarity Score %]
    J --> K[Weightage-based Grade Calculation]
    K --> L[Final Marks Output]
Loading

Processing Workflow

The grading process consists of four main stages:

1๏ธโƒฃ OCR Extraction

  • EasyOCR scans the uploaded answer sheet
  • Extracts the handwritten content into machine-readable text

2๏ธโƒฃ Text Cleaning

  • TextBlob performs spelling correction
  • Ensures OCR errors do not affect evaluation

3๏ธโƒฃ Semantic Comparison

  • SentenceTransformers generates embeddings
  • Cosine similarity measures how closely answers match

4๏ธโƒฃ Grade Computation

  • Similarity score converted into marks
  • Adjusted based on teacher-defined weightage

๐Ÿ› ๏ธ Technology Stack

Core System

Component Technology
Programming Language Python
Web Interface Streamlit
OCR Engine EasyOCR
Semantic Similarity SentenceTransformers
Spelling Correction TextBlob
Image Processing PIL
Numerical Processing NumPy

๐Ÿ“‚ Project Structure

automated-grading-system/
โ”‚
โ”œโ”€โ”€ app.py                 # Streamlit application
โ”œโ”€โ”€ grading_engine.py      # Core grading logic
โ”œโ”€โ”€ ocr_processor.py       # EasyOCR extraction
โ”œโ”€โ”€ similarity_model.py    # SentenceTransformer embedding + similarity
โ”œโ”€โ”€ utils/
โ”‚   โ”œโ”€โ”€ spell_correct.py   # TextBlob spelling correction
โ”‚   โ””โ”€โ”€ image_utils.py     # Image preprocessing utilities
โ”‚
โ”œโ”€โ”€ requirements.txt       # Python dependencies
โ””โ”€โ”€ README.md

๐Ÿš€ Installation & Setup

Prerequisites

  • Python 3.9+
  • pip
  • GPU optional (for faster OCR processing)

1๏ธโƒฃ Clone the Repository

git clone https://github.com/your-username/automated-grading-system.git
cd automated-grading-system

2๏ธโƒฃ Install Dependencies

pip install -r requirements.txt

This installs:

  • Streamlit
  • EasyOCR
  • SentenceTransformers
  • TextBlob
  • NumPy
  • Pillow

๐Ÿƒ Running the Application

Launch the Streamlit app:

streamlit run app.py

The application will start locally:

http://localhost:8501

๐ŸŒ Application Workflow

Step 1 โ€” Upload Answer Sheet

Upload a scanned image of the student answer sheet.

Supported formats:

  • PNG
  • JPG
  • JPEG

Step 2 โ€” Enter Model Answer

Provide the correct reference answer that will be used for evaluation.


Step 3 โ€” Assign Weightage

Define the maximum marks for the question.

Example:

Total marks: 10

Step 4 โ€” Evaluate

Click Evaluate, and the system will:

  • Extract text using OCR
  • Correct spelling
  • Compute semantic similarity
  • Calculate final marks

๐Ÿ“Š Example Output

Metric Result
Corrected Student Answer Displayed in UI
Similarity Score 87%
Total Marks 10
Marks Awarded 8.7

โš™๏ธ Configuration

Setting File Description
OCR Model ocr_processor.py EasyOCR language settings
Similarity Model similarity_model.py SentenceTransformer model
Grading Logic grading_engine.py Score calculation formula
UI Interface app.py Streamlit UI

๐Ÿ› Known Issues & Troubleshooting

OCR accuracy issues

Improve results by:

  • Using high-resolution images
  • Avoiding skewed answer sheets
  • Ensuring clear handwriting

Slow processing

OCR and embeddings can be slow on CPU.

Solutions:

  • Enable GPU for EasyOCR
  • Use lighter SentenceTransformer models

๐Ÿ”ฎ Future Improvements

  • ๐ŸŒ Multi-language grading
  • โœ๏ธ Improved handwriting recognition
  • ๐Ÿง  Context-aware answer evaluation
  • ๐Ÿ—‚๏ธ Student result database
  • ๐Ÿ“Š Analytics dashboard for teachers
  • ๐Ÿ“‘ Bulk grading support

๐Ÿ“‘ License

This project is licensed under the MIT License.


๐Ÿ™ Acknowledgements

This project was built using several powerful open-source technologies:

  • EasyOCR โ€” text extraction from images
  • TextBlob โ€” spelling correction and NLP utilities
  • SentenceTransformers โ€” semantic similarity modeling
  • Streamlit โ€” rapid web app development for AI projects


Transforming traditional grading into intelligent AI evaluation.



AutoGradeAI โ€” because grading should measure understanding, not just keywords.

About

A Streamlit-based app using EasyOCR, TextBlob & SentenceTransformers to grade handwritten answers via OCR, spelling correction & semantic similarity.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages