20Q
A bot trained with an artificial neural network to play a simplified version of 20 questions. Uses a "zoo" dataset as guess options for the user and targets for the bot, with animal features forming the questions and answers.
Instructions
The program runs on Python 2.7, modules are in requirements.txt: numpy==1.12.0, matplotlib==2.0.2
There are two modes and four datasets which you can use to interact with the bot:
MODES:
- 'play': load a previously trained and optimised network.
- 'crossvalidate': train a network for a dataset and then play with that network.
DATASETS:
- 'micro': for very basic training. 5 animals + 5 questions, question limit = 4.
- 'small': testing basic intelligence. 12 animals + 6 questions, question limit = 5.
- 'medium': for testing smart question selection. 13 animals + 15 questions, question limit = 6.
- 'big': the big kahuna... 58 animals + 28 questions, question limit = 13.
To run the bot in either mode with a dataset:
python 20q.py
e.g. python 20q.py medium crossvalidate python 20q.py big play
It is recommended that 'crossvalidate' mode only be used on datasets micro, small or medium (not big), as training for 'big' takes 20-30 mins.