简体   繁体   中英

Quiz Generator using NLTK/Python

The goal of this application is produce a system that can generate quizzes automatically. The user should be able to supply any word or phrase they like (eg "Sachin Tendulkar"); the system will then look for suitable topics online, identify a range of interesting facts, and rephrase them as quiz questions.

If I have the sentence "Sachin was born in year 1973", how can I rephrase it to "Which Year was sachin born?"

In the general case, this is a very hard open research question. However, you might be able to get away with a simple solution a long as your "facts" follow a pretty simple grammar.

You could write a fairly simple solution by creating a set of transformation rules that act on parse trees. So if you saw a structure that matched the grammar for "X was Y in Z" you could transform it to "Was XY in Z?", etc. Then all you would have to do is parse the fact, transform, and read off the question that is produced.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM