7 ms·
Not what OP is looking for (which has been answered), but 20Q is uncannily good at figuring out what you are thinking about. As a bonus, it still has a fantast
by rgovostes 6y ago
Not what OP is looking for (which has been answered), but 20Q is uncannily good at figuring out what you are thinking about.
As a bonus, it still has a fantastic mid-2000s web design. "The neural-net on the internet!"
http://www.20q.net http://www.20q.net
- johnchristopher 6y agoEh. I typed the code for this from a GW-BASIC book as a child. Nice memories.
- BeetleB 6y agoYou wrote a neural network in GW-BASIC that learned?
- johnchristopher 6y agoNo, I copied the code from a magazine as a kid, I literally read the code, line by line, and typed it on my computer. It was maybe 100 or 200 lines of code of BASIC. The game only took YES and NO as an answer (starting with `is it a living thing` I think). Then, if you had already played the game, it would read the next questions from a flat file that corresponds to your latest answer and moved on to narrow down the answer (or rather the last question in the tree). If it ran out of questions to ask for (the last question in the tree has no answer or no next question) it would give up and ask for what you had in mind and the question that would differentiate what you had in mind from the latest possibility. Then at the next play, you would find the same question if you went along the same path and now it would know what you were thinking about. I don't know if q20 is better than that. It just reminded me of that game. edit: see here https://www.atarimagazines.com/v4n12/Animal.html https://www.atarimagazines.com/v4n12/Animal.html The game's intelligence is rooted in a tree-like knowledge structure. Each point where the tree has "branches" (or nodes) consists of three bits of information-a question to ask, a YES branch, and a NO branch. The terminations (tips) of the branches consist of a single bit of information-in this case, an animal. During play, the program branches through the tree from the bottom to the top, stopping at each node to ask a question and branching according to the user's response. When it reaches a termination, its guess is the animal it finds there. When the computer guesses incorrectly, the tree "grows" by creating a new node at the termination. Remember that a node is formed of a question, a YES branch, and a NO branch. To create the new node, the program uses the question you provide. It then places the new animal you have given it at the termination of the YES branch. The animal that was at the old termination gets pushed up the NO branch. Thus, what was previously a single termination becomes a node with two terminations, and the tree grows a little taller. To get Animal Intelligence to work properly in BASIC, a language which lacks list processing ability, I had to divide the knowledge base into three parts. The first and second are simulated string arrays-AX$ holds the animals, and QX$ holds the questions. The third part, TREE$, is the knowledge tree. Though it is an ordinary string, TREE$ functions as a matrix of pointers. Every three bytes comprise a node or termination. The first byte of a node is a pointer to a question held in QX$. The second and third bytes point to the YES branch and NO branch respectively The first byte of a termination is a pointer to an animal held in AX$, while the second and third bytes are just dummies at the start. Later they will be used as pointers when the termination grows into a node. Animal Intelligence isn't limited to animals, however. With some simple modifications, I've created knowledge bases of plants, rocks and minerals, even famous people. Kids seem to especially enjoy the program. And as an educator, I can attest to its value as a tool for learning. Here's the source code for one variant https://www.animalgame.com/play/misc/source.php https://www.animalgame.com/play/misc/source.php: 100 &"PLAY 'GUESS THE ANIMAL' WITH RSTS 150 &"THINK OF AN ANIMAL AND THE COMPUTER WILL TRY TO GUESS IT...":& 500 DIM A$(200) 525 F$="ANIMAL.GME" :ON ERROR GOTO 700 550 OPEN F$ FOR INPUT AS FILE 1% :INPUT #1%,N% :INPUT #1,A$(I%) FOR I%=1%TO N% :CLOSE 1% :A$(0%)=NUM$(N%) :ON ERROR GOTO 0 :GOTO 1300 700 ON ERROR GOTO 1050 :F$="$"+F$ :RESUME 550 1050 READ A$(I%) FOR I%=0% TO 3% 1100 DATA "4","\QDOES IT SWIM\Y2\N3\","\AFISH","\ABIRD" 1300 INPUT "ARE YOU THINKING OF AN ANIMAL";Z9$ :GOTO 1350 IF LEFT(Z9$,1%)="Y" :GOTO 4000 IF LEFT(Z9$,1%)="N" 1310 IF Z9$="SAVE" THEN OPEN "ANIMAL.GME" FOR OUTPUT AS FILE 1% :PRINT #1%,A$(I%) FOR I%=0% TO VAL(A$(0%)) :PRINT #1,CHR$(26%) :CLOSE 1% :GOTO 1300 1320 IF Z9$="LIST" THEN PRINT "ANIMALS I ALREADY KNOW ARE:" :PRINT RIGHT(A$(I%),3%), IF INSTR(1%,A$(I%),"\A") FOR I%=1% TO 200% :PRINT :GOTO 1300 1330 &"PLEASE RESPOND 'YES', 'NO', 'SAVE', OR 'LIST'":GOTO1300 1350 K%=1% 1400 K%=FNA%(A$(K%)) :GOTO 3000 IF LEN(A$(K%))=0% :GOTO 1400 IF LEFT(A$(K%),2%)="\Q" :PRINT "IS IT A "RIGHT(A$(K%),3%); :INPUT Z7$ :Z7$=LEFT(Z7$,1%) 1450 IF Z7$="Y" THEN PRINT "WHY NOT TRY ANOTHER ANIMAL" :GOTO 1300 2000 INPUT "THE ANIMAL YOU WERE THINKING OF WAS A ";Z9$ 2050 PRINT "PLEASE TYPE IN A QUESTION THAT WOULD DISTINGUISH A " Z9$ " FROM A "RIGHT(A$(K%),3%) :INPUT Z8$ 2100 PRINT "FOR A "Z9$" THE ANSWER WOULD BE"; :INPUT Z7$ :Z7$=LEFT(Z7$,1%) :IF Z7$="Y" THEN Z6$="N" ELSE IF Z7$="N" THEN Z6$="Y" ELSE PRINT "PLEASE ANSWER 'YES' OR 'NO'" :GOTO 2100 2200 Z1%=VAL(A$(0%)) :A$(0%)=NUM$(Z1%+2%) :A$(Z1%)=A$(K%) :A$(Z1%+1%)='\A'+Z9$ :A$(K%)="\Q"+Z8$+"\"+Z7$+NUM$(Z1%+1%)+"\"+Z6$+NUM$(Z1%)+"\" 2300 GOTO 1300 3000 DEF FNA%(Q$) :PRINT MID(Q$,3%,INSTR(3%,Q$,"\")-3%); :INPUT Z9$ :Z9$=LEFT(Z9$,1%) :Z9$="N" IF Z9$<>"Y" :Z1%=INSTR(3%,Q$,"\"+Z9$)+2% :Z2%=INSTR(Z1%,Q$,"\") :FNA%=VAL(MID(Q$,Z1%,Z2%-Z1%)) :FNEND 4000 &:&"O.K. SEE YOU LATER. HOPE YOU HAD FUN PLAYING!!":&:& 9999 END
- BeetleB 6y agoIt's certainly better than what one would expect from a magazine, but I strongly suspect 20q does/did more in terms of training. In its heyday it was uncannily good. I'd say it'd guess my object 80% of the times in 20 questions and 90% of the time within 30 questions. The weights would update if different people gave different answers for the same object, etc. In its current incarnation, it is fairly poor as I mentioned in another comment. It couldn't even come close to guessing a screwdriver, for example.
- Digit-Al 6y agoMy guess is that the training data is being poisoned by people of "low intelligence". I tried it with refrigerator and it couldn't guess. At the end, in the list of contradictions it showed the following: > Does it usually have four corners? You said No, 20Q was taught by other players that the answer is Yes. Now, considering a fridge has four corners at the top and four at the bottom that does suggest that a lot of people answering the questions are lacking somewhat in the intelligence department. Either that or they are just completely forgetting that a fridge has an underneath (or a back) as well. (I'll leave it to the reader to decide whether forgetting a refrigerator has a back as well as a front constitutes a lack of intelligence.)
- chance_bear 6y agoYou read that question very literally. Fridges are often embedded in walls, from our vantage point they have four corners. Yes, technically they have 8 corners, but so too does a door. “Does it have four corners?” is more of an abstraction from the human viewpoint.
- crtasm 6y agoYou were thinking of fairy lights. You said it's classified as Mineral, 20Q was taught by other players that the answer is Other. > Other Something neither animal, vegetable or mineral Examples: love, the colour blue.
- jonshariat 6y agoside note: I like to use 20Q as a way to combat over use of ML. Whenever its suggested for a feature/product its wise to ask: would 20Q solve it faster? The idea being that some very basic algorithms beat out ML if its not an ML problem.
- justusthane 6y agoIsn't 20Q machine learning though? It says it's a neural network that learns from players.
- BeetleB 6y agoI used to love showing this to people in the early/mid 2000's. It was really good. But then at some point it's accuracy dropped significantly (it would guess my object less than a third of the time). And their design changed for the worse. I suspect that either someone bought them out, or people messed up the training in the NN, or both. As an example, once it felt it was close enough to the answer, would show you the list of candidate answers with weights at the bottom of each question. That was fun to see how it would get closer or further to my object with the answers I provided. They stopped showing that a long time ago. My favorite question it asks: Does it weight more than a duck?
- throwaway_pdp09 6y agoFuck, that's surreal. A bunch of totally rando questions on 16 it suddenly asked right out of nowhere whether it was a black widow spider. Very close. So I said no, 3 questions on, total of 19, it nailed it with tarantula. That's just eerie given the total apparent irrelevance of the questions. Unsettling. Q20. I am guessing that it is a tarantula? Right, Wrong, Close 19. Is it hard? No. 18. Is it bad for your health? No. 17. I guessed that it was a black widow spider? Wrong. 16. Would you find it on a farm? No. 15. Can it climb? Yes. 14. Does it go inside other things? No. 13. Do you catch it? No. 12. Can it make a sound? No. 11. Is it found in a bathroom? No. 10. Is it larger than a pound of butter? No. 9. Can you order it at a restaurant? No. 8. Does it live in the forest? Probably. 7. Is it a type of cat? No. 6. Is it an absolute state? No. 5. Would you give it as a gift? No. 4. Is it a type of dog? No. 3. Is it a vegetarian? No. 2. Can you hold it? Yes. 1. It is classified as Animal.
- dTal 6y agoQuestions 1-5 establish immediately that it's a small, carnivorous, unpleasant animal; you go on to establish that it's inedible, forest dwelling, palm-sized, and can climb. Some sort of spider is an obvious guess. There are other possible answers (tree frog, perhaps?) but spiders rank very highly in human psychology. Your main lesson here should be that you are not as original as you think you are!
- throwaway_pdp09 6y agoTarantula was indeed picked as an 'easy' start as I've played this before with people. So I guess you're right, though it's not the way a human would do it, we'd home in faster and more precisely, but still. As you say, it kind of partitioned off the search space pretty efficiently in its own strange manner.
- emerged 6y agoIt had a surprisingly hard time with grandfather clock. Although the fact that my clock is white, so I had to say they can sometimes be white, probably led it down the wrong path. It gave up eventually but then the first in the list of extra guesses was correct.
- Digit-Al 6y agoIt couldn't guess a refrigerator either. Apparently most people think they have four corners, which is a bit bizarre. It's pretty obvious they have eight.
- emerged 6y agoFor what it’s worth, I thought you were wrong and that they have only four. Took me a solid 10 seconds to realize how dumb I was.
- Digit-Al 6y agoThat's pretty funny. We all have those "dumb" moments I reckon.
- c22 6y agoI don't know what kind of fridge you have, but I count at least 24 corners on the outside alone.
- ksaj 6y agoThe text suggests that if you play it again, it will correct the errors.
- Digit-Al 6y agoYeah, but you'd probably have to play it quite a lot to override all the people who have already "poisoned the well".
- justusthane 6y agoMy first few play-throughs were a little disappointing; it got them eventually, but not until 30 questions or so (water bottle, headphones), but this one astonished me: Q19. I am guessing that it is a woodstove? RIGHT 18. Is it soft? No. 17. Does it come from trees? No. 16. Can you put something into it? Yes. 15. Can it bend without breaking? No. 14. Is it colorful? No. 13. Does it have four legs? Sometimes. 12. Does it have legs? Sometimes. 11. Does it weigh more than a duck? Yes. 10. Is it used for entertainment? No. 9. Does it use electricity? No. 8. Can you buy it? Yes. 7. Can it be placed on your head? No. 6. Does it come from space? No. 5. Does it come in a box? No. 4. Is it pleasurable? Probably. 3. Does it get wet? No. 2. Do you hold it when you use it? No. 1. It is classified as Concept.
- cercatrova 6y agoI read this top to bottom at first and was amazed that it could guess something so abstract as the notion of a concept.
- deleted 6y ago[deleted]
- lostmsu 6y agoIt did not know about quintessence: https://en.wikipedia.org/wiki/Quintessence_%28physics%29 https://en.wikipedia.org/wiki/Quintessence_%28physics%29
- eloeffler 6y agoHahah! I remember playing that in school but forgot about it. Thanks!
- mxxx 6y agoAbout 15 years ago a friend of mine had a toy, like a physical box with a yes and a no button, that would do this with very impressive accuracy. I don’t remember exactly what we asked it but I recall it getting some super obscure stuff.