Home
Softono
tf_seq2seq_chatbot

tf_seq2seq_chatbot

Open source Python
423
Stars
201
Forks
17
Issues
47
Watchers
6 years
Last Commit

About tf_seq2seq_chatbot

tfseq2seqchatbot is an unmaintained, general-purpose conversational agent built using the TensorFlow deep learning framework. It implements a sequence-to-sequence (seq2seq) neural network architecture designed to learn dialogue patterns from text corpora. The software utilizes a dataset of movie subtitles for training to enable the model to generate contextual responses. Key components include training scripts for model development and a command-line interface for real-time chat interaction. Users can configure various parameters via a Python configuration file. While the project originally aimed to demonstrate advanced natural language processing capabilities, current performance is noted as limited, often producing generic or inconsistent replies. The system requires TensorFlow for operation and supports both CPU and GPU execution, with specific instructions provided for building from source with CUDA optimization. The codebase serves primarily as a reference implementation for researchers and developers in

Platforms

Web Self-hosted

Languages

Python

Links

tensorflow seq2seq chatbot

Note: the repository is not maintained. Feel free to PM me if you'd like to take up the maintainance.

Build a general-purpose conversational chatbot based on a hot seq2seq approach implemented in tensorflow. Since it doesn't produce good results so far, also consider other implementations of seq2seq.

The current results are pretty lousy:

hello baby          - hello
how old are you ?   - twenty .
i am lonely         - i am not
nice                - you ' re not going to be okay .
so rude             - i ' m sorry .

Disclaimer:

  • the answers are hand-picked (it looks cooler that way)
  • chatbot has no power to follow the conversation line so far; in the example above it's a just a coincidence (hand-picked one)

Everyone is welcome to investigate the code and suggest the improvements.

Actual deeds

  • realise how to diversify chatbot answers (currently the most probable one is picked and it's dull)

Papers

Nice picture

seq2seq

Curtesy of this article.

Setup

git clone [email protected]:nicolas-ivanov/tf_seq2seq_chatbot.git
cd tf_seq2seq_chatbot
bash setup.sh

Run

Train a seq2seq model on a small (17 MB) corpus of movie subtitles:

python train.py

(this command will run the training on a CPU... GPU instructions are coming)

Test trained trained model on a set of common questions:

python test.py

Chat with trained model in console:

python chat.py

All configuration params are stored at tf_seq2seq_chatbot/configs/config.py

GPU usage

If you are lucky to have a proper gpu configuration for tensorflow already, this should do the job:

python train.py

Otherwise you may need to build tensorflow from source and run the code as follows:

cd tensorflow  # cd to the tensorflow source folder
cp -r ~/tf_seq2seq_chatbot ./  # copy project's code to tensorflow root
bazel build -c opt --config=cuda tf_seq2seq_chatbot:train  # build with gpu-enable option
./bazel-bin/tf_seq2seq_chatbot/train  # run the built code

Requirements