An implementation of Chatbot using Adversarial Learning and Reinforcement Learning
- Paper: Adversarial Learning for Neural Dialogue Generation
- Initial implementation: Many thanks to @liuyuemaicha
- Python 3.6
- TensorFlow 1.12.0
- nltk
- tqdm
- numpy
Note: You might also need to download additional data to make nltk work
python -m nltk.downloader punkt
- Cornell Movie Dialogs Corpus (default). Already included when cloning the repository.
- OpenSubtitles. Follow the instructions and use the argument
--corpus opensubs
. - Supreme Court Conversation Data. Follow the instructions and use the argument
--corpus scotus
. - Ubuntu Dialogue Corpus. Follow the instructions and use the argument
--corpus ubuntu
.
Many thanks to @Conchylicultor for providing above corpus information.
python main.py
Follow below steps:
- Pre train the Generator and get the GEN_0 model.
- GEN model test
- Pre train the Discriminator and get the DISC_0 model
- Train the GEN model and DISC model using AL/RL
- GEN model test
python main.py --test 1
Results
Q: Hi.
A: Hey.
Q: How are you..
A: Fine.
Q: What is your name
A: Harold ...
Q: You are so nice
A: I am?
Q: Wow
A: What do you mean?
Q: That's great
A: That's right.
Q: Cool
A: Yeah?
Q: My name is Amigo
A: I know.
Q: What is the first letter of the alphabet ?
A: What?
Q: See you later
A: Yeah.
Q: Tell me something ...
A: I'm not saying ...
Q: You are so cute !!!!!!!!!!
A: Wonderful!
Q: Can we make this quick?
A: Sure.
Q: Where are you from
A: Here.
Q: Merry christmas !
A: Merry christmas.
Q: How old are you
A: Twenty-eight.