QUAI takes in a question and rephrases it. In so doing, QUAI solves the problem of overfitting in quiz and flashcard software because it allows students to learn the concepts a question is meant to assess instead of the specific wording of any question.
QUAI consists of a GPT-2 language model [1] trained on approximately 150,000 pairs of questions that say the same thing but are worded differently. We obtained the pretrained GPT-2 model from aitextgen [2], and the data from the Quora Question Pairs dataset on Kaggle [3]. We deployed the QUAI model on a customized website built on a Bootstrap website.
In spaced repetition quizzing software such as Anki or Quizlet, questions are shown many times. As a result, users begin remembering the question's syntax and structure. QUAI injects variation in into a study regimen by rephrasing quiz and flashcard questions. That means QUAI would allow a dynamic studying experience if integrated with a learning software.
Here are some example input questions and output questions generated by our model.
INPUT: What can Donald Trump win in the election?
OUTPUT: How will Donald Trump winning?
INPUT: What is the most embarrassing moment of your life?
OUTPUT: What was the most embarrassing moment of yours?
INPUT: How do you think about Trump?
OUTPUT: How do I think about Trump?
INPUT: What is the best way to learn web development?
OUTPUT: How can I learn web development?
INPUT: What is the best way to learn how to hack (whitehat)?
OUTPUT: What is the best way to learn about web development?
INPUT: How can I stop worrying about what other people think of me?
OUTPUT: How do I stop myself from being affected by what other people think of me?
INPUT: What is the best way to learn English vocabulary?
OUTPUT: How can I learn English?
You can run the QUAI website and use the QUAI model by running the following scripts. Assuming you have conda installed, create an environment.
conda create -n quai python=3.8
conda activate quai
Then, navigate into the app folder and install dependences.
cd blue-pythons-QUAI/app
pip install -r requirements.txt
With dependencies installed, you can run the website with the deployed model. Make sure that pytorch_model.bin
and config.json
are in the app/models
folder. No pretrained models are currently available, but you can get those two files by training the quai-training.ipynb
notebook in the training
folder on the processed-quora.txt
dataset. The results above were obtained by training a GPT-2 model on 10,000 question pairs. We suggest using the entire dataset and perhaps upgrading to a pretrained Seq2Seq model or GPT-3 for better performance.
After all files are uploaded, run the following line, making sure you are in the app
folder.
python -m main
- Lawrence Lo - Python & Flask Programmer
- Minseo Lim - Frontend & Backend Programmer
- Nicole Fong - Product Manager & Frontend Programmer
- Shayna Hecht - Frontend Programmer Queen
- John Kang - Frontend & Backend Programmer
- Darius Cronin - Frontend Programmer
- Adam Mehdi - Instructor