GithubHelp home page GithubHelp logo

dixitakhil / chatbot_v1 Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 194.57 MB

A short and simple chatbot using sequence to sequence neural network to be used as a base for more advance bot.

Python 99.18% Shell 0.82%
tensorflow tensorlayer chatbot-application twitter-bot simple

chatbot_v1's Introduction

ChatBot_V1

This project is intended to create an automatic reply system or ChatBot. It has been trained for twitter and cornell-movie dataset and currently supports both of them. This project is the first version of more advance bot system project I am working upon.

Motivation

The working of the automatic repy systems in online messengers and services fascinated me. In order to have more knowledge about their working, the basic need was to create a project to understand the basic needs of such a model and how to train it. The twitter and movie dataset is taken from their respective sources and are available under data. The coding style and motivation is found from seq-chatbot. Tensorlayer is used as a high level wrapper over the tensorflow backend.

Description

The project is created from Sequence to Sequence model and consists of two RNNs - an encoder and a decoder. The encoder reads the input sequence, word by word and emits a context, which would ideally capture the essence of the input sequence. Based on this context, the decoder generates the output sequence, one word at a time while looking at the context and the previous word during each timestep. RNN are Recurrent Neural Networks in which nodes form a graph,hence they can be used to identify sequences in a text, as contrast with Feed Forward NN where there is no cycle.

Working

To run the application choose the required model. Modelv1t.npz is 1 epoch train model on twitter dataset. Modelv2t.npz is 15 epoch train model on twitter dataset and Modelcopper.npz is 15 epoch train model on cornel-movie dataset. Change the name in script accordingly.

  1. To install the necessary requirements, follow the procedure
pip install -r requirements.txt
  1. Launch 'run.py' script to get query results provided in seeds.
python run.py
  1. To train the model on the required dataset launch 'main.py' script.
python main.py

Results

INPUT QUERY OUTPUT QUERY
How is the weather? i think it was a good one thing
How are you? i am so excited for the next time
I had an exam today. thank you
Do you have any political views? i am so excited for the debate
Tell me something about yourself i think its a lot of people
happy birthday have a nice day thank you

Implementation

The 'main.py' script launches as:
The time taken to run it is quite large.

The 'run.py' script launches as:

Versions

  1. Python- 3.6
  2. Tensorflow- 2.0.0b0
  3. Tensorlayer- 2.0.2

Code Working

The code working is provided in comments in the respective scripts.

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.