Skip to content

Automatically generates Multiple Choice Questions (MCQs) from text using T5 and NLP. Built with Sense2Vec, keyword extraction, and Flask for easy UI.

License

Notifications You must be signed in to change notification settings

addittidas/SmartMCQ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmartMCQ

MCQ Generation from Text using T5 and NLP

Overview

This project implements a system that automatically generates multiple-choice questions (MCQs) from a given input text using Natural Language Processing (NLP) and Machine Learning techniques. The system leverages pre-trained models like T5 (Text-to-Text Transfer Transformer) and Sense2Vec for extracting relevant information from the input text and generating meaningful questions. This tool is useful for educators, content creators, and anyone interested in automatically generating quizzes or assessments.

Features

  • Text Input: Users can input text directly or upload a file (PDF or TXT format).
  • Question Generation: The system processes the input text and automatically generates MCQs based on the text's context and keywords.
  • Answer Choices: For each MCQ, the system generates distractors using semantic similarity with the correct answer.
  • Validation: The system displays the correct answer to validate user-selected answers.
  • Randomization: Questions are generated randomly from the text to ensure diverse content.

Technologies Used

  • Flask: Python web framework used for building the web application.
  • spaCy: Advanced NLP library used for text processing.
  • T5: Pre-trained transformer model used for question generation.
  • Sense2Vec: A model used for word embeddings and sense disambiguation to generate semantic distractors.
  • NLTK: Natural Language Toolkit for basic text processing like tokenization and keyword extraction.
  • PyTorch: Deep learning library for managing the neural network operations.
  • Transformers: Library for working with transformer-based models like T5.
  • Gensim: For topic modeling, document indexing, and similarity retrieval.
  • Levenshtein Distance: Used for calculating string similarity.

Installation Procedure

  1. Clone the repository:

    git clone https://github.com/addittidas/SmartMCQ.git
    cd SmartMCQ
  2. Set up a virtual environment:

    python -m venv .venv
    .venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Download s2v_old data from kaggle:

    https://www.kaggle.com/datasets/parthchokhra/s2v-old
  5. Run the .ipynb files in notebooks folder.

  6. Running the application:

    python app.py

License

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

About

Automatically generates Multiple Choice Questions (MCQs) from text using T5 and NLP. Built with Sense2Vec, keyword extraction, and Flask for easy UI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published