This is seq2seq chatbot implementation. Most credit goes to 1228337123 and AvaisP. I'm just reimplmenting their work to have better understandings on seq2seq. This chat bot is optimized for Japanese. You may replace existing tokenizer with one for your language.
Main differences of my implementation are
- More comments
- Easy to understand input/output format for each processes
- Python 3.6
- Tensorflow 1.1.0
-
Prepare train data.
- Put your train data as data/tweets.txt, the file consists of pairs of tweet and reply.
- Odd lines are tweets and even lines are corresponding replies.
- You can get the training data using github.com/Marsan-Ma/twitter_scraper.
-
Process the training data and generate vocabulary file and some necessary files. Run following command then you'd see the files generated in generated/ directory.
python data_processer.py
-
Train! Train may take a few hours to 1 day, and it never stops. Once you think it's ready, just Ctrl-C. Model parameters are saved in generated/ directory.
python train.py
-
Talk to him!
python predict.py
By running twitter_listenr.py and twitter_replier.py, you can run this chatbot on twitter.