This work tries to reproduce the results of A Neural Conversational Model (aka the Google chatbot). It uses a RNN (seq2seq model) for sentence predictions. It is done using python and TensorFlow. It's belongs to the csdn blog
For now, DeepQA support the following dialog corpus:
The program requires the following dependencies (easy to install using pip: pip3 install -r requirements.txt
):
- pandas==0.22.0
- tqdm==4.19.5
- tensorflow==1.0.0
- nltk==3.2.5
- numpy==1.13.3
You might also need to download additional data to make nltk work.
python3 -m nltk.downloader punkt
To train the model, simply run training.py
. Once trained, you can test the results with `training.py with self.test = 'interactive' in args.py file.
It's possible to get some results after only 20 hours of training (on a CPU), Of course, the network won't be really chatty:
Q: i like you. A: You're not.
Q: i really like you. A: Yeah?
Q: jack chen A: Hi.
Q: what time is it? A: Two months.
Q: what's the time? A: I do n't know.
Q: you are cute. A: I'm not.
You can find a pre-trained model checkpoint.tar.gz. samples To use it:
- Extract the zip file checkpoint.tar.gz inside `Seq2seq_from_scratch/save/model/cornell/
- Extract the zip file samples.tar.gz inside `Seq2seq_from_scratch/samples/cornell
- Run `./training.py with with self.test = 'interactive' in args.py file.