All Projects → ramsrigouthamg → Questgen.ai

ramsrigouthamg / Questgen.ai

Licence: mit
Question generation using state-of-the-art Natural Language Processing algorithms

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Questgen.ai

Clicr
Machine reading comprehension on clinical case reports
Stars: ✭ 123 (-27.22%)
Mutual labels:  question-answering
Question answering models
This repo collects and re-produces models related to domains of question answering and machine reading comprehension
Stars: ✭ 139 (-17.75%)
Mutual labels:  question-answering
Rczoo
question answering, reading comprehension toolkit
Stars: ✭ 163 (-3.55%)
Mutual labels:  question-answering
Knowledge Aware Reader
PyTorch implementation of the ACL 2019 paper "Improving Question Answering over Incomplete KBs with Knowledge-Aware Reader"
Stars: ✭ 123 (-27.22%)
Mutual labels:  question-answering
Question Answering
TensorFlow implementation of Match-LSTM and Answer pointer for the popular SQuAD dataset.
Stars: ✭ 133 (-21.3%)
Mutual labels:  question-answering
Pytorch Question Answering
Important paper implementations for Question Answering using PyTorch
Stars: ✭ 154 (-8.88%)
Mutual labels:  question-answering
Dynamic Coattention Network Plus
Dynamic Coattention Network Plus (DCN+) TensorFlow implementation. Question answering using Deep NLP.
Stars: ✭ 117 (-30.77%)
Mutual labels:  question-answering
Hq bot
📲 Bot to help solve HQ trivia
Stars: ✭ 167 (-1.18%)
Mutual labels:  question-answering
Gossiping Chinese Corpus
PTT 八卦版問答中文語料
Stars: ✭ 137 (-18.93%)
Mutual labels:  question-answering
Denspi
Real-Time Open-Domain Question Answering with Dense-Sparse Phrase Index (DenSPI)
Stars: ✭ 162 (-4.14%)
Mutual labels:  question-answering
Dan Jurafsky Chris Manning Nlp
My solution to the Natural Language Processing course made by Dan Jurafsky, Chris Manning in Winter 2012.
Stars: ✭ 124 (-26.63%)
Mutual labels:  question-answering
Kbqa Ar Smcnn
Question answering over Freebase (single-relation)
Stars: ✭ 129 (-23.67%)
Mutual labels:  question-answering
Nspm
🤖 Neural SPARQL Machines for Knowledge Graph Question Answering.
Stars: ✭ 156 (-7.69%)
Mutual labels:  question-answering
Dynamic Memory Networks Plus Pytorch
Implementation of Dynamic memory networks plus in Pytorch
Stars: ✭ 123 (-27.22%)
Mutual labels:  question-answering
Awesomemrc
This repo is our research summary and playground for MRC. More features are coming.
Stars: ✭ 162 (-4.14%)
Mutual labels:  question-answering
Haystack
🔍 Haystack is an open source NLP framework that leverages Transformer models. It enables developers to implement production-ready neural search, question answering, semantic document search and summarization for a wide range of applications.
Stars: ✭ 3,409 (+1917.16%)
Mutual labels:  question-answering
Cape Webservices
Entrypoint for all backend cape webservices
Stars: ✭ 149 (-11.83%)
Mutual labels:  question-answering
Rat Sql
A relation-aware semantic parsing model from English to SQL
Stars: ✭ 169 (+0%)
Mutual labels:  question-answering
Improved Dynamic Memory Networks Dmn Plus
Theano Implementation of DMN+ (Improved Dynamic Memory Networks) from the paper by Xiong, Merity, & Socher at MetaMind, http://arxiv.org/abs/1603.01417 (Dynamic Memory Networks for Visual and Textual Question Answering)
Stars: ✭ 165 (-2.37%)
Mutual labels:  question-answering
Chinese Rc Datasets
Collections of Chinese reading comprehension datasets
Stars: ✭ 159 (-5.92%)
Mutual labels:  question-answering

Questgen AI

https://questgen.ai/

Questgen AI is an opensource NLP library focused on developing easy to use Question generation algorithms.
It is on a quest build the world's most advanced question generation AI leveraging on state-of-the-art transformer models like T5, BERT and OpenAI GPT-2 etc.

Online course and blog

Our online course that teaches how to build these models from scratch

Blog announcing the launch

Currently Supported Question Generation Capabilities :

1. Multiple Choice Questions (MCQs)
2. Boolean Questions (Yes/No)
3. General FAQs
4. Paraphrasing any Question  
5. Question Answering.

Simple and Complete Google Colab Demo

Open In Colab

1. Installation

1.1 Libraries

pip install git+https://github.com/ramsrigouthamg/Questgen.ai
pip install sense2vec==1.0.2
pip install git+https://github.com/boudinfl/pke.git

python -m nltk.downloader universal_tagset
python -m spacy download en 

1.2 Download and extract zip of Sense2vec wordvectors that are used for generation of multiple choices.

wget https://github.com/explosion/sense2vec/releases/download/v1.0.0/s2v_reddit_2015_md.tar.gz
tar -xvf  s2v_reddit_2015_md.tar.gz

2. Running the code

2.1 Generate boolean (Yes/No) Questions

from pprint import pprint
from Questgen import main
qe= main.BoolQGen()
payload = {
            "input_text": "Sachin Ramesh Tendulkar is a former international cricketer from India and a former captain of the Indian national team. He is widely regarded as one of the greatest batsmen in the history of cricket. He is the highest run scorer of all time in International cricket."
        }
output = qe.predict_boolq(payload)
pprint (output)
Show Output
'Boolean Questions': ['Is sachin ramesh tendulkar the highest run scorer in '
                       'cricket?',
                       'Is sachin ramesh tendulkar the highest run scorer in '
                       'cricket?',
                       'Is sachin tendulkar the highest run scorer in '
                       'cricket?']

2.2 Generate MCQ Questions

    qg = main.QGen()
    output = qg.predict_mcq(payload)
    pprint (output)
    
Show Output
    {'questions': [{'answer': 'cricketer',
                'context': 'Sachin Ramesh Tendulkar is a former international '
                           'cricketer from India and a former captain of the '
                           'Indian national team.',
                'extra_options': ['Mark Waugh',
                                  'Sharma',
                                  'Ricky Ponting',
                                  'Afridi',
                                  'Kohli',
                                  'Dhoni'],
                'id': 1,
                'options': ['Brett Lee', 'Footballer', 'International Cricket'],
                'options_algorithm': 'sense2vec',
                'question_statement': "What is Sachin Ramesh Tendulkar's "
                                      'career?',
                'question_type': 'MCQ'},
               {'answer': 'india',
                'context': 'Sachin Ramesh Tendulkar is a former international '
                           'cricketer from India and a former captain of the '
                           'Indian national team.',
                'extra_options': ['Pakistan',
                                  'South Korea',
                                  'Nepal',
                                  'Philippines',
                                  'Zimbabwe'],
                'id': 2,
                'options': ['Bangladesh', 'Indonesia', 'China'],
                'options_algorithm': 'sense2vec',
                'question_statement': 'Where is Sachin Ramesh Tendulkar from?',
                'question_type': 'MCQ'},
               {'answer': 'batsmen',
                'context': 'He is widely regarded as one of the greatest '
                           'batsmen in the history of cricket.',
                'extra_options': ['Ashwin', 'Dhoni', 'Afridi', 'Death Overs'],
                'id': 3,
                'options': ['Bowlers', 'Wickets', 'Mccullum'],
                'options_algorithm': 'sense2vec',
                'question_statement': 'What is the best cricketer?',
                'question_type': 'MCQ'}]}

2.3 Generate FAQ Questions

output = qg.predict_shortq(payload)
pprint (output)
Show Output
{'questions': [{'Answer': 'cricketer',
               'Question': "What is Sachin Ramesh Tendulkar's career?",
               'context': 'Sachin Ramesh Tendulkar is a former international '
                          'cricketer from India and a former captain of the '
                          'Indian national team.',
               'id': 1},
              {'Answer': 'india',
               'Question': 'Where is Sachin Ramesh Tendulkar from?',
               'context': 'Sachin Ramesh Tendulkar is a former international '
                          'cricketer from India and a former captain of the '
                          'Indian national team.',
               'id': 2},
              {'Answer': 'batsmen',
               'Question': 'What is the best cricketer?',
               'context': 'He is widely regarded as one of the greatest '
                          'batsmen in the history of cricket.',
               'id': 3}]
}

2.4 Paraphrasing Questions

payload2 = {
    "input_text" : "What is Sachin Tendulkar profession?",
    "max_questions": 5
}
output = qg.paraphrase(payload2)
pprint (output)

Show Output
{'Paraphrased Questions': ["ParaphrasedTarget: What is Sachin Tendulkar's "
                           'profession?',
                           "ParaphrasedTarget: What is Sachin Tendulkar's "
                           'career?',
                           "ParaphrasedTarget: What is Sachin Tendulkar's job?",
                           'ParaphrasedTarget: What is Sachin Tendulkar?',
                           "ParaphrasedTarget: What is Sachin Tendulkar's "
                           'occupation?'],
 'Question': 'What is Sachin Tendulkar profession?'}

2.5 Question Answering (Simple)

answer = main.AnswerPredictor()
payload3 = {
    "input_text" : '''Sachin Ramesh Tendulkar is a former international cricketer from 
              India and a former captain of the Indian national team. He is widely regarded 
              as one of the greatest batsmen in the history of cricket. He is the highest
               run scorer of all time in International cricket.''',
    "input_question" : "Who is Sachin tendulkar ? "
    
}
output = answer.predict_answer(payload3)

Show Output
Sachin ramesh tendulkar is a former international cricketer from india and a former captain of the indian national team.

2.6 Question Answering (Boolean)

payload4 = {
    "input_text" : '''Sachin Ramesh Tendulkar is a former international cricketer from 
              India and a former captain of the Indian national team. He is widely regarded 
              as one of the greatest batsmen in the history of cricket. He is the highest
               run scorer of all time in International cricket.''',
    "input_question" : "Is Sachin tendulkar  a former cricketer? "
}
output = answer.predict_answer(payload4)
print (output)
Show Output
Yes, sachin tendulkar is a former cricketer.

NLP models used

For maintaining meaningfulness in Questions, Questgen uses Three T5 models. One for Boolean Question generation, one for MCQs, FAQs, Paraphrasing and one for answer generation.

Online Demo website

Under development... https://questgen.ai/

Linkedin Link

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].