Git Product home page Git Product logo

tf_seq2seq_chatbot's Introduction

tensorflow seq2seq chatbot

Build a general-purpose conversational chatbot based on a hot seq2seq approach implemented in tensorflow.

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 bin/setup.sh

Run

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

python bin/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 bin/test.py

Chat with trained model in console:

python bin/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 bin/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

tf_seq2seq_chatbot's People

Contributors

nicolas-ivanov avatar rodart avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.