Skip to content

kunalekare/Answer_Evalution_System_with_ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

48 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AssessIQ - AI-Powered Student Answer Evaluation System :

AssessIQ Logo

Python FastAPI React License

Automated evaluation of student answers using Natural Language Processing and Computer Vision


πŸ“š Table of Contents


🎯 Overview

AssessIQ is an intelligent system designed to automate the evaluation of student answer sheets. It combines:

  • OCR Technology for extracting text from handwritten answers
  • NLP Processing for text normalization and keyword extraction
  • Semantic Analysis using Sentence-BERT for meaning-based comparison
  • Diagram Evaluation using structural similarity metrics
  • Hybrid Scoring algorithm for accurate grading

This project is developed as part of the 6th Semester B.Tech Computer Science Engineering curriculum.


✨ Features

πŸ”€ Text Extraction (OCR)

  • Multi-Engine Support:
    • βœ… EasyOCR (balanced, ~5s)
    • βœ… Ensemble (90-95% accuracy, ~12s)
    • βœ… Tesseract (fast, ~3s)
    • βœ… PaddleOCR (layouts, ~8s)
    • βœ… Sarvam AI Cloud API (cloud, 90-95% accuracy, NEW!)
  • Image preprocessing: Noise removal, skew correction, thresholding
  • PDF and image file support (PNG, JPG, TIFF, BMP)
  • User-selectable OCR engine via API

πŸ“ NLP Processing

  • Text cleaning and normalization
  • Tokenization and lemmatization
  • Stopword removal
  • Keyword extraction

🧠 Semantic Analysis

  • Sentence-BERT embeddings (all-MiniLM-L6-v2)
  • Cosine similarity calculation
  • TF-IDF vectorization
  • Jaccard similarity

πŸ“Š Diagram Evaluation

  • SSIM (Structural Similarity Index)
  • ORB feature matching
  • Contour analysis
  • Shape comparison

πŸ“ˆ Scoring System

  • Hybrid scoring with dynamic weights
  • Keyword coverage analysis
  • Length penalty for incomplete answers
  • Detailed feedback generation

🎨 Professional UI

  • Modern React dashboard
  • Material-UI components
  • Responsive design
  • Animated visualizations

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        ASSESSIQ SYSTEM                         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚
β”‚  β”‚   Frontend   │───▢│   Backend    │───▢│   Database   β”‚      β”‚
β”‚  β”‚   (React)    │◀───│   (FastAPI)  │◀───│   (SQLite)   β”‚      β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚
β”‚                              β”‚                                  β”‚
β”‚         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”             β”‚
β”‚         β–Ό                    β–Ό                   β–Ό             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚ OCR Service β”‚    β”‚ Semantic Service β”‚   β”‚Diagram Serviceβ”‚   β”‚
β”‚  β”‚  (EasyOCR)  β”‚    β”‚(Sentence-BERT)  β”‚   β”‚   (OpenCV)   β”‚    β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β”‚         β”‚                    β”‚                   β”‚              β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β”‚
β”‚                              β”‚                                  β”‚
β”‚                              β–Ό                                  β”‚
β”‚                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                         β”‚
β”‚                    β”‚ Scoring Service β”‚                         β”‚
β”‚                    β”‚(Hybrid Algorithm)β”‚                        β”‚
β”‚                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                         β”‚
β”‚                                                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Flow

Input (Image/PDF/Text)
        β”‚
        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ OCR Extractionβ”‚ ──▢ Extract text from images
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚
        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ NLP Processingβ”‚ ──▢ Clean, tokenize, normalize text
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚
        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚Semantic Analysisβ”‚ ──▢ Generate embeddings, calculate similarity
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚
        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚Diagram Analysisβ”‚ ──▢ Compare visual elements (if applicable)
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚
        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚Hybrid Scoring β”‚ ──▢ Combine scores, apply weights
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚
        β–Ό
    Final Result

πŸ› οΈ Tech Stack

Backend

Technology Purpose
Python 3.9+ Core programming language
FastAPI REST API framework
Pydantic Data validation
SQLAlchemy ORM for database

AI/ML

Technology Purpose
EasyOCR Optical Character Recognition
spaCy NLP processing
Sentence-Transformers Semantic embeddings
OpenCV Image processing
scikit-image SSIM calculation

Frontend

Technology Purpose
React 18 UI framework
Material-UI Component library
Framer Motion Animations
Axios HTTP client
Recharts Data visualization

πŸ“¦ Installation

Prerequisites

  • Python 3.9 or higher
  • Node.js 16+ and npm
  • Git

Step 1: Clone Repository

git clone https://github.com/your-username/answer-evaluation.git
cd Answer_Evaluation

Step 2: Backend Setup

# Create virtual environment
python -m venv venv

# Activate virtual environment
# Windows:
venv\Scripts\activate
# Linux/Mac:
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Download spaCy model
python -m spacy download en_core_web_sm

# Download NLTK data
python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords'); nltk.download('wordnet')"

Step 3: Environment Configuration

# Copy example environment file
copy .env.example .env

# Edit .env with your settings (optional)

Step 4: Frontend Setup

cd frontend

# Install dependencies
npm install

# Return to root
cd ..

Step 5: Initialize Database

python -c "from database.models import init_db; init_db()"

πŸš€ Usage

Start Backend Server

# From project root
uvicorn api.main:app --reload --host 0.0.0.0 --port 8000

Backend will be available at: http://localhost:8000

Start Frontend Development Server

cd frontend
npm start

Frontend will be available at: http://localhost:3000

Quick Test

# Test API health
curl http://localhost:8000/

# Test with sample evaluation
curl -X POST http://localhost:8000/api/v1/evaluate/text \
  -H "Content-Type: application/json" \
  -d '{
    "model_answer": "Photosynthesis is the process by which plants convert sunlight into energy.",
    "student_answer": "Plants use photosynthesis to make food using sunlight.",
    "question_type": "descriptive",
    "max_marks": 10
  }'

πŸ“– API Documentation

Endpoints

Method Endpoint Description
GET / Health check
POST /api/v1/upload Upload files for evaluation
POST /api/v1/evaluate Evaluate uploaded files
POST /api/v1/evaluate/text Evaluate text directly
GET /api/v1/results Get all evaluation results
GET /api/v1/results/{id} Get specific result
DELETE /api/v1/results/{id} Delete result

Interactive Docs

Example: Text Evaluation

Request:

POST /api/v1/evaluate/text
{
  "model_answer": "DNA is deoxyribonucleic acid, which carries genetic information.",
  "student_answer": "DNA stands for deoxyribonucleic acid and contains genetic info.",
  "question_type": "factual",
  "max_marks": 5
}

Response:

{
  "evaluation_id": "abc123",
  "final_score": 85.5,
  "obtained_marks": 4.3,
  "grade": "excellent",
  "score_breakdown": {
    "semantic_score": 0.89,
    "keyword_score": 0.78,
    "diagram_score": null,
    "length_penalty": 0.02
  },
  "concepts": {
    "matched": ["DNA", "deoxyribonucleic acid", "genetic"],
    "missing": ["information", "carries"],
    "coverage_percentage": 75.0
  },
  "explanation": "Good understanding of DNA basics...",
  "suggestions": ["Include more detail about DNA's function"]
}

πŸ“ Project Structure

Answer_Evaluation/
β”œβ”€β”€ api/                          # Backend API
β”‚   β”œβ”€β”€ main.py                   # FastAPI application
β”‚   β”œβ”€β”€ routes/                   # API endpoints
β”‚   β”‚   β”œβ”€β”€ upload.py             # File upload handling
β”‚   β”‚   β”œβ”€β”€ evaluation.py         # Evaluation logic
β”‚   β”‚   └── results.py            # Results retrieval
β”‚   └── services/                 # Core services
β”‚       β”œβ”€β”€ ocr_service.py        # OCR processing
β”‚       β”œβ”€β”€ nlp_service.py        # NLP operations
β”‚       β”œβ”€β”€ semantic_service.py   # Semantic analysis
β”‚       β”œβ”€β”€ diagram_service.py    # Diagram comparison
β”‚       └── scoring_service.py    # Hybrid scoring
β”‚
β”œβ”€β”€ config/                       # Configuration
β”‚   └── settings.py               # Application settings
β”‚
β”œβ”€β”€ database/                     # Database layer
β”‚   └── models.py                 # SQLAlchemy models
β”‚
β”œβ”€β”€ frontend/                     # React frontend
β”‚   β”œβ”€β”€ public/                   # Static assets
β”‚   └── src/
β”‚       β”œβ”€β”€ components/           # Reusable components
β”‚       β”‚   └── Layout.jsx        # Main layout
β”‚       β”œβ”€β”€ pages/                # Page components
β”‚       β”‚   β”œβ”€β”€ Dashboard.jsx     # Home dashboard
β”‚       β”‚   β”œβ”€β”€ Evaluate.jsx      # Evaluation form
β”‚       β”‚   β”œβ”€β”€ Results.jsx       # Results display
β”‚       β”‚   └── History.jsx       # Past evaluations
β”‚       └── services/
β”‚           └── api.js            # API client
β”‚
β”œβ”€β”€ uploads/                      # Uploaded files (gitignored)
β”œβ”€β”€ results/                      # Evaluation results
β”œβ”€β”€ requirements.txt              # Python dependencies
β”œβ”€β”€ .env.example                  # Environment template
└── README.md                     # This file

πŸ“Š Scoring Algorithm

Formula

Final_Score = (Semantic Γ— W₁) + (Keyword Γ— Wβ‚‚) + (Diagram Γ— W₃) - Length_Penalty

Dynamic Weights by Question Type

Question Type Semantic (W₁) Keyword (Wβ‚‚) Diagram (W₃)
Factual 0.50 0.40 0.10
Descriptive 0.60 0.30 0.10
Diagram 0.30 0.20 0.50
Mixed 0.45 0.25 0.30

Score Components

  1. Semantic Score (0-1): Cosine similarity of Sentence-BERT embeddings
  2. Keyword Score (0-1): Percentage of important keywords matched
  3. Diagram Score (0-1): SSIM + ORB feature matching
  4. Length Penalty (0-0.1): Deduction for too short/long answers

Grading Scale

Grade Percentage Range
Excellent β‰₯ 85%
Good 70% - 84%
Average 50% - 69%
Poor < 50%

πŸ“Έ Screenshots

Dashboard

Modern dashboard with statistics and quick actions

Evaluation

Step-by-step evaluation wizard with file upload

Results

Detailed results with animated score visualization


πŸ‘₯ Contributors

Name Role Contact
[Kunal Ekare] Developer [kunalekare02@gmail.com]
[Soumya Dhole] Full Stack Developer [dholesm@rknec.edu]

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments


Made with ❀️ for Academic Excellence

Β© 2024 AssessIQ - All Rights Reserved

About

Preview our websiteAI Answer Evaluation System using NLP and Machine Learning for automatic exam grading.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors