How to paraphrase and augment training data for a question answering ML model? I have only 50 question, answer pairs in my training data, where each question represent a unique intent. However, the training data is too small to build any meaningful ML model.
What are the various techniques to paraphrase training questions so that we can add them to the training data? Any code example would be helpful.
Sample Input question
who founded microsoft?

Expected paraphrased questions
q1: who is the founder of microsoft?
q2: who is the creator of microsoft?
q3: Microsoft was founded by whom?
q4: who started microsoft?

 A: There are many ways to paraphrase the sentences. But I have tried to solve it using an easier and quickest approach using spacy and pre-processing.
Here is the code:
from nltk.stem.porter import *
stemmer = PorterStemmer()
from nltk.stem import WordNetLemmatizer
wordnet_lemmatizer = WordNetLemmatizer()
from nltk.tokenize import word_tokenize, sent_tokenize
from nltk.corpus import stopwords
from string import punctuation

import spacy
nlp = spacy.load('en', parser=False) 

def tokenize(text):
        sents = sent_tokenize(text)
        return [word_tokenize(sent) for sent in sents]

def removeStopWords(words):
        customStopWords = set(stopwords.words('english')+list(punctuation))
        return [word for word in words if word not in customStopWords]

def get_related(word):
    filtered_words = [w for w in word.vocab if w.is_lower == word.is_lower and w.prob >= -15]
    similarity = sorted(filtered_words, key=lambda w: word.similarity(w), reverse=True)
    return similarity[:5]

def get_semantic_similar_phrases(sentence, n=5):
    synonyms = []
    for pos, word in enumerate(tokenize(sentence)[0]):
        word_syns = [w.lower_ for w in get_related(nlp.vocab[word.decode('utf-8')])]
        synonyms.append(word_syns)

    sentence_tokens = tokenize(sentence)[0]
    for token_index, token in enumerate(sentence_tokens):
        selected_syn_set = synonyms[token_index]
        for synonym in selected_syn_set:
            sentence_tokens[token_index] = synonym
            print(' '.join(sentence_tokens))
        sentence_tokens = tokenize(sentence)[0]
        print("")

Here is the input and the output using spacy:
get_semantic_similar_phrases('who is the founder of microsoft')

Output:
who is the founder of microsoft
whom is the founder of microsoft
whose is the founder of microsoft
he is the founder of microsoft
never is the founder of microsoft

who is the founder of microsoft
who has the founder of microsoft
who which the founder of microsoft
who be the founder of microsoft
who that the founder of microsoft

who is the founder of microsoft
who is of founder of microsoft
who is entire founder of microsoft
who is one founder of microsoft
who is that founder of microsoft

who is the founder of microsoft
who is the pioneer of microsoft
who is the founded of microsoft
who is the pioneers of microsoft
who is the founders of microsoft

who is the founder of microsoft
who is the founder the microsoft
who is the founder all microsoft
who is the founder and microsoft
who is the founder that microsoft

who is the founder of microsoft
who is the founder of xp
who is the founder of win7
who is the founder of adobe
who is the founder of vista

other ways:
sentence = 'who is the founder of microsoft'
other_forms = []
other_forms.append(' '.join([stemmer.stem(word) for word in tokenize(sentence)[0]]))
other_forms.append(' '.join([wordnet_lemmatizer.lemmatize(word) for word in tokenize(sentence)[0]]))
other_forms.append(' '.join(removeStopWords(tokenize(sentence)[0])))
other_forms

Output:
['who is the founder of microsoft',
 'who is the founder of microsoft',
 'founder microsoft']

