DEV Community

adhv45
adhv45

Posted on

QuizzeR

QuizzeR

A bot which generates Multiple Choice Questions for an input keyword. Fetches information from Wikipedia and analyses the received information using spaCy and NLTK. Generates MCQ type question with 70-80 % accuracy. Implemented in Python, Flask, HTML/CSS.

Demo Link

You will have to run it locally on your machine.

Github Repo Link

QuizzeR

Quizzer is an online quiz making bot which fetches information from Wikipedia and analyses the received information using spaCy and nltk. The accuracy is 70-80 % for questions.

Prerequisites

Things you need to install first get pip for python3 (included env is based on python3.7 so use new env if needed)

Debian/Ubuntu : sudo apt-get install python3-pip
arch : sudo pacman -S python-pip

python3 libraries required: spacy, flask, Wikipedia, hunspell. already included wikipedia as there were issues with originel api. And already included nltk with tokeniser data.

first enter virtual env 
    source QUIZZER_DIR/.env/bin/activate
    
install these packages using pip (pip3 for python3):

i.e.
```
    pip3 install -v spacy (do the same for flask, hunspell)
        google if u face some error installing hunspell
        
    download spacy database for english
        python3 -m spacy download en
```

using new environment

rm -rf QUIZZER_DIR/.env
virtualenv .env
source .env/bin/activate
install wikipedia using pip
    edit .env/lib/pythonX.X/site-packages/wikipedia/wikipedia.py
        aroung
…

How I built it

  • Search the content from Wikipedia.
  • Divide into sections.
  • Filter the sentences by length and no. of named entities after than pick two random sentences from each section.
  • To make question remove the most important keyword and replace it with a blank string.
  • Use similarity to generate options.

Additional Thoughts / Feelings / Stories

It was my first project which we did on our own in a college hackathon.

Top comments (0)