Skip to content

Web App that helps teachers to generate multiple choice questions by taking text or article as an input.

Notifications You must be signed in to change notification settings

PushkaraSharma/MCQ_Generator

Repository files navigation

MCQ Generator

Table of Content

Demo

Link: http://35.224.236.92:5000/

Image

Screenshot from 2020-09-22 21-45-46

Video Demo

Overview

This is the Web App that is being developed by using Flask, Machine Learning, Docker, hosted on GCP instance and focus on providing teachers with automatic mcq generationing system for the given article or passage.

Motivation

I wanted to develop something that can utilize all of my learnings and also has little bit of uniqueness as well. So, after randomly looking at my younger brother's(5th standard) assignment regarding answering MCQ of given passage, I decided to automate the generation of MCQ in order to make the task of teachers little easy.

Technical Aspect

This project is divided into four part:

  1. Building the core of the app using Natural Language Processing, Wordnet and ConceptNet.
  2. Desiging the frontend with the help of HTML, CSS, JavaScript(Done By Shubhankar).
  3. Building Flask API and Containerizing with the help of Docker.
  4. Deploying the whole Web App on Google Cloud Platform.
    • Used e2-medium VM instance with 2 vcpus and 4 gb ram.
    • will use domain for static ip in future.

Pipeline

How MCQ queations along with wrong answer choice are generated?

  1. Firstly the user provide text and choose to generate MCQ from Full Text or Summary.
  2. Proper Noun words are extracted as keywords from text.
  3. If user selects Summary then we use Transformer model to generate summary and select respective keywords.
  4. Respective Sentences are selected of gien keywords.
  5. Word sense is calculated with pwysd library for WordNet.
  6. Related options (From same parent class) are extracted and if not found in Wordnet then ConceptNet(PartOf) is used.
  7. Keyword is replaced with ______ and data is return as response.

Installation

The Code is written in Python 3.8. If you don't have Python installed you can find it here. If you are using a lower version of Python you can upgrade using the pip package, ensuring you have the latest version of pip. To install the required packages and libraries, run this command in the project directory after cloning the repository:

pip install -r requirements.txt

Run

To run the app in a local machine, shoot this command in the project directory:

python Flask_api.py

Note:- It may download some of the required data on first run.

Running Docker Image

To run Docker Image make sure you have installed Docker in your system. If you haven't installed follow this. Use this command to pull image.

docker pull pushkarasharma11/mcq_generator:1.1

Directory Tree

MCQ_Generator/
├── Dockerfile
├── extract_keywords.py
├── find_sentances.py
├── Flask_api.py
├── generate_summary.py
├── gen_mcq.py
├── KeyNotes.txt
├── README.md
├── requirements.txt
├── response.json
├── static
│   ├── ai.svg
│   ├── arrow.svg
│   ├── get mcq group.svg
│   ├── input_data.svg
│   ├── script.js
│   └── style.css
├── summary_notebook.ipynb
├── templates
│   └── index.html
└── test_articles
    ├── article.txt
    ├── Egypt.txt
    └── The Indus River Valley Civilizations.txt

To Do

Using Abstract Summarization in order to produce difficullt multiple choice questions.

Bug / Feature Request

If you find a bug (the website couldn't handle the query and / or gave undesired results), kindly open an issue here by including your search query and the expected result.

If you'd like to request a new function, feel free to do so by opening an issue here. Please include sample queries and their corresponding results.

Technologies Used

Team

PUSHKARA SHARMA

SHUBHANKAR SINGH

License

License: MIT

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Web App that helps teachers to generate multiple choice questions by taking text or article as an input.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •