0

So I am working on a question generator, so far I have generated some questions from a sentence. What I need to do now is generate 3 other options similar to the answer one, so that I can make it MCQ type.

The problem I am facing is, when I generate similar words, I get obnoxious stuff, or repeaters in general.

example, for "how", I get hello, hi, hullo

and for "hydrogen", I get atomic number 1, chemical element, gas

I need a more reliable method (I am using pydictionary to generate similar words) I face a similar problem with skynet.

All help appreciated :)

from PyDictionary import PyDictionary

dictionary=PyDictionary()
answer = dictionary.synonym(word)
Amara Fray
  • 33
  • 5
  • What does MCQ mean? – Thomas Weller May 27 '21 at 05:37
  • 1
    @ThomasWeller I guess it's "Multiple-Choice Question" (MCQ) – Rafael-WO May 27 '21 at 05:58
  • Show us the code you're using the generate the unsatisfactory answers. Even if it's not directly useful, it will show us the framework your code is operating in, so answers can also fit within that context. – Blckknght May 27 '21 at 06:21
  • @Blckknght i edited in the code. – Amara Fray May 27 '21 at 07:57
  • 1
    I'd challenge that idea that an automated system can possibly produce useful wrong answers if it doesn't know anything about the question. That might not be entirely impossible to do with sophisticated machine learning techniques (that learn what the question means and guess at the plausible form of answers), but it's not going to be a one-line bit of code like your example. – Blckknght May 27 '21 at 08:10

1 Answers1

1

You probably don't want to get antonyms, since that would be too obvious. Also, what would the antonym of Hydrogen be?

You also don't want arbitrary word like "car" or "house", because that would also be too obvious and likely make the answer ridiculous.

You want kind of related words and perhaps even have a difficulty. Probably "Uranium" is simple to rule out, but "Oxygen" and "Nitrogen" would be difficult?

My experience on guessing games is: it takes a lot of thought and manual work to get good questions with enough wrong options to answer.

My recommendations for a guessing game:

  • try to find more than one correct answer, otherwise players will remember it too easily. (Unfortunately sometimes there aren't)
  • find a lot more incorrect answers than needed. I you display 3 incorrect answers on the screen, find at least 10 incorrect answers to choose from. This will take the players time to read and make it more fair for newcomers.

Overall you probably want a template engine for generating sentences and a "database" (JSON or whatever) to put your carefully crafted words in.

Sorry that I'm not suggesting a fancy AI algorithm for this task. How should the AI be able to figure out whether a valid (or invalid) selection for an atom is based on weight, binding energy, free electrons, radioactivity or other criteria?

I found that above is even true for math questions. Of course it's typically easier to find wrong answers. But you still want the number range to match certain criteria (like 1 to 10 for first grade school). How should an AI algorithm know you target a specific child age?

Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
  • Thanks, but how do I generate the wrong answers though? Other than manually doing it? – Amara Fray May 27 '21 at 07:58
  • @IdhikashJaishankar: with a template engine + manual input. Templates would be like "The answer is {}." and "{} is an answer." and "{} will work." and "A solution is {}", where {} is a placeholder. The placeholder can then be filles with answers or non answers like "hydrogen", "oxygen", "nitrogen" and "uranium". This example gives 16 sentenses. – Thomas Weller May 27 '21 at 08:10
  • Yes but I am trying to remove all manual work, anyways thanks for your help, I found a better way to do it (I think), I'm going to try it out, its called gensim – Amara Fray May 27 '21 at 08:17