AutoQuiz: Generating ‘Fill in the Blank’ Type Questions with NLP

Can a machine create quiz which is good enough for testing a person’s knowledge of a subject?

So, last Friday, we wrote a program which can create simple ‘Fill in the blank’ type questions based on any valid English text.

This program basically figures out sentences in a text and then for each sentence it would first try to delete a proper noun and if there is no proper noun, it deletes a noun.

We are using textblob which is basically a wrapper over NLTK – The Natural Language Toolkit, or more commonly NLTK, is a suite of libraries and programs for symbolic and statistical natural language processing for English written in the Python programming language.

The results are as follows:

In __________________ 1941, Japan attacked the United States and European colonies in the Pacific Ocean, and quickly conquered much of the Western Pacific.

===============
December
===============

 

The war continued primarily between the European Axis powers and the coalition of the United Kingdom and the British Commonwealth, with campaigns including the North Africa and East Africa campaigns, the aerial __________________ of Britain, the Blitz bombing campaign, and the Balkan Campaign, as well as the long-running __________________ of the Atlantic.

===============
Battle
===============

 

The __________________ advance halted in 1942 when Japan lost the critical Battle of Midway, and Germany and Italy were defeated in North Africa and then, decisively, at Stalingrad in the Soviet Union.

===============
Axis
===============

 

During 1944 and 1945 the Japanese suffered major reverses in mainland Asia in South Central China and Burma, while the Allies crippled the Japanese __________________ and captured key Western Pacific islands.

===============
Navy
===============

…..

We can further improve this in many ways. Some of these are as follows:

  1. Better selection of the word to be picked as a question.
  2. Conversion into proper question: “Who won the war?” instead of “_____ won the war”
  3. Creating multiple choice questions with good distractions or alternative options.

The Jupyter notebook for this is available in here: https://github.com/cloudxlab/ml/tree/master/projects/autoquiz

If you are interested to work on it further with us, drop an email at reachus@cloudxlab.com.