# How can I generate "what", "why" and "who" types of questions from question templates?

I was wondering if in any way it is possible to generate $$n$$ questions based on gap-fill-in type questions.

For example, the following template

______ is a process in which plants generate energy.

could lead to the generation of the following specific question

What is the process in which plants generate energy called?

If so, how can I achieve this?

I am familiar with and used natural language processing techniques, and have no problem with implementing an algorithm for this, but I do not know where to start with this.

This seems tricky. It seems that any "surface level" transformation wouldn't give adequate results and any working solution would need to properly capture the sentence structure, and generate a gramatically correct transformed sentence.

One possible option is to use a "traditional pipeline" - e.g. you run a NLP pipeline up to syntactic parsing, which for general domain english is quite accurate (you'd need some special handling for the gap "____" part though), then implement some heuristic rules to transform the syntax tree, and regenerate a sentence from the transformed tree. There are a lot of publications about similar transformations in machine translation domain, used as a way to preprocess data before running statistical machine translation for language pairs with very different word(or sentence part) ordering.

A second option that may work is to look into the field of controlled natural languages, or something like http://www.grammaticalframework.org/ that can be used as a toolkit to help generating new sentences.

Current fashion also suggests a very different option that might work - you could train a character-level recurrent neural network with an attention mechanism (look into recent neural machine translation publications for details) to do this transformation, but I'm not sure of how much training data it will need for decent accuracy.