indrajithi / genquest

Automatic question generation by using NLP
208 stars 60 forks source link

How to generate the question starting with How,Whom ? #4

Open navneet-arya opened 5 years ago

indrajithi commented 5 years ago

You have to write grammar for that.

navneet-arya commented 5 years ago

Okay But there will be many forms of grammar for the question which is starting with how, like How many people are there? How long have you been writing this letter? How much is this? . . etc. Can you share some grammatical form for the question of how or any reference?

indrajithi commented 5 years ago

You have to take some sample questions starting with How and get their pos-tags. Then by trial and error form a rule (combinations of pos tags) that will result in a question. This is a rule-based approach in generating questions.

  1. How many people are there? This question may be generated from this sentence "There are ten people in the hall?
    [('There', 'EX'),
    ('are', 'VBP'),
    ('ten', 'JJ'),
    ('people', 'NNS'),
    ('in', 'IN'),
    ('the', 'DT'),
    ('hall', 'NN')]

    Use the pos-tags with carefully constructed rules to generate a question. I have made this_repo public. You can refer that for how the rules are constructed.