Code Monkey home page Code Monkey logo

chatbot_based_on_babi_dataset_using_keras's Introduction

Chatbot using Keras

Here we are building a chatbot and this chatbot can have resoning capability.

Dataset Information

Here we are using bAbI dataset which is buit by Facebook AI Research.

Dependencies

  • Python 2.7
  • TensorFlow 1.4.1: Refer this link
  • keras: Refer this link
  • functools: It's python standard library.
  • tarfile: It's python standard library.
  • re : It's python standard library.
  • h5py: $ sudo pip install h5py

Usage

  • The dataset used here is babi-tasks-v1-2. Link of the dataset is here, its a relatively small dataset but a great dataset nonetheless

  • In main.py file there are following parameters which can be change in following manner to train and test the model

  • We are using the concepts of memory network and it is LSTM based models performed better than GRU based models for this task.

For Training

Step 1: Open main.py

Step 2: For training, set the parameters as given below.
train_model = 1         #(1 means training mode and 0 means no training mode) 
train_epochs = 100
load_model = 0          #( 1 means load the trained model and 0 means doesn't load trained model)
batch_size = 32
lstm_size = 64
test_qualitative = 0    #(1 means test trained on randomly generated story and 0 means do not perform test on ramdomly generated story)
user_questions = 0      #(1 means test trained on randomly generated story and 0 means do not perform test on ramdomly generated story)

Step 3: Run main.py

For Testing

Here we can perform two types of testing.

  • Testing for randomly generated story
  • Testing for used given story

Testing for randomly generated story

Step 1: Open main.py

Setp 2: For testing ramdomly generated story, set the parameters as given below.

train_model = 0
train_epochs = 100
load_model = 1
batch_size = 32
lstm_size = 64
test_qualitative = 1
user_questions = 0

Step 3: Run main.py

Testing for used given story

Step 1: Open main.py

Setp 2: For testing user given story, set the parameters as given below.

train_model = 0
train_epochs = 100
load_model = 1
batch_size = 32
lstm_size = 64
test_qualitative = 0
user_questions = 1

Step 3: Run main.py

Credit

Credit for the majority of code here goes to Batchu Vishal. I've merely created a wrapper to get people started.

chatbot_based_on_babi_dataset_using_keras's People

Contributors

jalajthanaki avatar

Stargazers

 avatar  avatar

Watchers

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