Giter VIP home page Giter VIP logo

seq2seq's Introduction

Making chatbot using naive seq2seq model

Overview

The input is twitter chat that contains questions and their responsed answers. I clean all messy characters. In training state, we forward questions and try to predict answers. The model is followed by GitHub Logo

In sampling pharse, i use multinomial distribution to sampling next word.

Dependencies

  • Python 2.7
  • Tensorflow 1.xx
  • I only test it on Ubuntu 16.04

Preprocess

All sequences is padded to be same fixed length by using PAD token, and all questions is reversed according to Sutskever et al., 2014

Q : [ PAD, PAD, PAD, PAD, PAD, PAD, “?”, “you”, “are”, “How” ]
A : [ GO, “I”, “am”, “fine”, “.”, EOS, PAD, PAD, PAD, PAD ]

Training

I use tensorflow so if you haven't installed tensorflow yet, just following the link and install approriate tensorflow for your pc To train model

python seq2seq.py

Here i plot chart of cross-entropy loss. the loss is still going down at the end of training phase. It mean the model is learning somethings. png

I show somes answers at iter

Q: if youre gonna fall asleep in class just stay home
A:
Q: this was my favorite play of his jumped off the screen
A:
Q: former president george hw bush said hell vote for hillary clinton according to sources close to bush
A:
Q: sweet he should be here in his staff meeting now
A:

Evaluate

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.