Skip to content

Web-based application that generates questions and answers from a given text using Machine Learning (ML). The app will then generate a Google Quiz link containing the questions, which can be easily shared with others for interactive learning. πŸ“šπŸ’‘

Notifications You must be signed in to change notification settings

dhaneshragu/Text2Fillups

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Text2Fillups

Text2Fillups is a web-based ML application that allows users to generate fill-in-the-blank questions from given texts. This repository contains the code for both the backend server and the frontend user interface, as well as model training and inference notebooks.

πŸ“• Tech stack

πŸ“½οΈ Video demo

2023-07-09.14-06-19.mp4

πŸ”₯ Web-app Features

πŸ’» Stylish glassmorphism UI

image
  • The UI has been created using material-ui react library.

πŸ“œ Toggle Feature for questions

  • The toggle feature has been implemented in the question answer cards to hide and unhide the answers.

🍞 Toast Messages

image
  • Toast messages are displayed wherever necessary, to indicate a completion of a process, for a better accessibility.

πŸ”— Google Quiz link

image
  • Google quiz link is readily generated for assessment of the topic.

🧠 Overview

  1. The text corpus is taken as input from the user and question-answer pairs are generated using the t-5 transformer model from hugging face for the task of context-aware question generation. (generates question and answer pairs using a context).
  2. Then these question-answer pairs are converted to normal sentences (For e.g.: {"Question":"What is your name ?", "Answer":"Dhanesh"} is converted to "My name is Dhanesh") using t-5 transformer fine-tuned on QA2D dataset.
  3. The fine-tuned model is pushed in hugging-face hub for further usage.
  4. To reduce the inference time and reduce the model size, I have quantized the fine-tuned transformer using ONNX and fast-t5 library that reduced the size of the model from around 900MB to around 400MB. The models and relevant notebooks are uploaded in Fine-tuning-notebook/Quantized-model.
  5. The answer word is blanked and displayed in the web app with a toggle feature.
  6. Additionally, a Google quiz link containing all these questions is created using google forms API in the backend, which can be shared to test the topic readily.

πŸ“Š Metrics from Weights and Biases

I used weights and biases to log metrics like epochs, train_acc, valid_acc, BLEU score etc. Click here to view them.

πŸ™Œ Instructions to Get Started

  • First of all, git clone this repository and go to the appropriate folder in your local machine.

πŸ“œ Getting credentials for GoogleFormsAPI

  1. Create an account on https://console.cloud.google.com/ and create a new project.
  2. In the API & Services section enable the API for Google Forms.
  3. Generate a new OAuth 2.0 Client ID and download the json file containing Client_ID and Client_Secrets.
  4. Save this json as credentials.json in the backend folder.

πŸ”Œ Backend Server

  1. Navigate to the folder where this repository is cloned.
  2. Open the terminal and navigate to the backend directory using the command: cd backend.
  3. Install the required dependencies by running: npm install.
  4. Start the backend server by running: npm start.
  5. Install the Python dependencies by running: pip install -r requirements.txt.
  6. Run the Flask application by executing: python app.py.

πŸ‘€ Frontend User Interface

  1. Open a new terminal window.
  2. Navigate to the frontend directory using the command: cd frontend.
  3. Install the necessary dependencies by running: npm install.
  4. Start the frontend development server by running: npm start.

That's it! You are now ready to use Text2Fillups and generate fill-in-the-blank questions from texts. Enjoy! πŸš€πŸ“š

🦾 Contributors

🌟 Stay connected

Don't forget to ⭐️ star this repository to show your support and stay connected for future updates!

About

Web-based application that generates questions and answers from a given text using Machine Learning (ML). The app will then generate a Google Quiz link containing the questions, which can be easily shared with others for interactive learning. πŸ“šπŸ’‘

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published