Exaphis / HackQ-Trivia

Yet another HQ Trivia bot. Automatically scrapes HQ Trivia questions without OCR and answers them.
MIT License
89 stars 54 forks source link

Any way to apply logic to show the confidence in search results? #125

Open maximama opened 6 years ago

maximama commented 6 years ago

Great work on this project, works beautifully most of the time. Quick question, not an issue, more of an enhancement. Do you think it would be possible to add a feature that shows the confidence for each method? Method 2 never works for me, but 1 and 3 works great. So typically I'm seeing that they give the same responses, but especially in later questions they give different responses. And if I had more than 3 seconds to read and interpret the scores I could see this bot being 95% accurate.

For example, I don't know if this makes sense, you could calculate confidence like this: Method 1: Answer 1 score: 35, answer 2 score: 0, answer 3 score: 40 Let's say question does not include 'NOT'. so method 1 would return answer 3

Method 3: Answer 1 score: 3, answer 2 score: 0, answer 3 score: 1 So this would return answer 1.

Now, confidence: Take the top 2 answers, calculate the percentage between them Hi: 40 Lo: 35 so 40-35/40=13% difference, so give it a confidence score of 13% Hi: 3 Lo: 1 so 3-1/3=66% difference, so give it a confidence score of 66% If the second largest score is a 0, it would return a score of 100%

I know there is a better way to calculate this, but I would go with method 3 as my answer, and I feel it gives me a better chance than the 50% chance I have right now to pick either one or the other.

maximama commented 6 years ago

Here's a real life example: Q: What is the inner most planet in our solar system A: Jupiter, B: Mercury, C: Saturn M1: A:13, B:322, C:11 Best answer: B: Mercury (322-13)/322=96% Confidence M3: A:284, B:239, C: 161 Best answer A: Jupiter (284-239)/284=16% Confidence

Two different answers but I would definitely pick the 96% confidence answer, which happens to actually be the correct answer.

Mineleague commented 6 years ago

I would suggest using Beautiful Soup to return the number of results in each search, and assign them to a printed variable.

DEEVANSHU1 commented 4 years ago

pl help me i am unable to install it