项目作者: karma9874

项目描述 :
Chatbot based Seq2Seq model with bidirectional rnn and attention mechanism with tensorflow, trained on Cornell Movie-Dialogs Corpus and deployed on a Flask Server
高级语言: Jupyter Notebook
项目地址: git://github.com/karma9874/Seq2Seq-Chatbot.git
创建时间: 2019-06-13T09:38:01Z
项目社区:https://github.com/karma9874/Seq2Seq-Chatbot

开源协议:

下载


Seq2Seq-Chatbot

Introduction

This Chatbot is a TensorFlow implementation of Seq2Seq Mode. It make use of a seq2seq model RNN for sentence predictions. The chatbot is trained on Cornell Movie Dialogs Corpus on Conversation of lenghth between 5 to 2 words

Installation

To run this chabtot you will need:

  • Python 3.5
  • Tensorflow (1.13.1)
  • Numpy
  • Flask
  • Matplotlib
  • Dataset

Running

To chat with the trained model from Web Chat:

  1. First install the required depedencies from Chat_UI_Web and run
    pip install -r requirment.txt
  2. From the Chat_UI_Web directory run run.py
    python run.py
  3. Open a browser to the URL indicated by the server console, This is typically: http://localhost:5000/

To chat with the trained model from Python Console:

  1. First install the required depedencies from root directory and run
    pip install -r requirment.txt
  2. From the root directory run
    python chat.py

List of Hyperparameters

  • Batch_size to 128
  • Rnn_size to 128
  • Embed_size to 128
  • Learning_rate to 0.0.1
  • Epochs to 500
  • Keep_prob to 0.75

For Training Model

To Train Model from Python Console:

  1. Configure the config.py file for desired training hyperparameters
  2. Run train.py
    python train.py
  3. Make sure the datasets should be present in the datasets folder

Results

Model was able to train to Accuracy of 62% and Loss of 19% and after that it was overfitting

Accuracy

alt text

Loss

alt text

Chat Results

  1. Human: who are you
  2. Bot: girlfriend
  3. Human: who am i
  4. Bot: doctor livingston
  5. Human: where are you from
  6. Bot: southern california
  7. Human: how old are you
  8. Bot: nineteen or
  9. Human: are you a boy
  10. Bot: i am trying
  11. Human: are you a girl
  12. Bot: something like that
  13. Human: do you drink
  14. Bot: no thanks

Some Funny Result
alt text