Skip to content

silentst0rm/tensorflow_seq2seq_chatbot

 
 

Repository files navigation

What is this?

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

Requirements

  • Python 3.6
  • Tensorflow 1.1.0

How to run

  1. Prepare train data.

    1. Put your train data as data/tweets.txt, the file consists of pairs of tweet and reply.
    2. Odd lines are tweets and even lines are corresponding replies.
    3. You can get the training data using github.com/Marsan-Ma/twitter_scraper.
  2. 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

  3. 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

  4. Talk to him! python predict.py

Twitter Bot

By running twitter_bot.py, you can run this chatbot in twitter. Here are some interesting conversations with him. sample1 sample2

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%