Code Monkey home page Code Monkey logo

chatbot-mil's Introduction

Chatbot - Summer Internship Project 2019

Project description

A generalised chatbot which can intelligently respond to conversation using named entity recognition (NER), sentiment analysis and an implementation of a decision system for follow up mechanism using a Seq2seq model which uses Bidirectional RNNs and Attention models.

Encoder-Decoder Model

Instructions

Create an IBM Cloud account. Follow the steps mentioned in the following link- https://dataplatform.cloud.ibm.com/docs/content/wsj/getting-started/get-started-wdp.html

Using the dialogflow api https://cloud.google.com/dialogflow/docs/quickstart-api

Installation

To run the chatbot program you must install the following libraries -

  1. Install spacy
pip install spacy
  1. Install tensorflow
pip install tensorflow
  1. Install dialogflow
pip install dialogflow
  1. Install textblob
pip install textblob
  1. Install tqdm
pip install tqdm
  1. Install tensorlayer
pip install tensorlayer
  1. Install wikipedia
pip install wikipedia
  1. Install Watson NLU
pip install ibm_watson
  1. Install Spacy's English Model
python -m spacy download en_core_web_md
  1. Install numpy
pip install numpy
  1. Install pandas
pip install pandas
  1. Install tensorlayer
pip install tensorlayer

API's used -

  1. MediaWiki
  2. Dialogflow
  3. IBM Watson NLU (for sentiment analysis)

Training data

We have trained our model on three different datasets (SQuAD , Cornell Movie Dialogue Corpus and a Trump Tweets Dataset) to bring about generalisation. They are included in the 'data' folder and are included through an import of the folder.

Usage

Note - First make sure that all the files required are saved in the same directory and all the required libraries are installed before running the program. For Windows -

To run it on squad

python model.py squad

To run on cornell_corpus

python model.py cornell_corpus

To run on twitter

python model.py twitter

For Linux (For Python3+ versions) -

To run it on squad

python3 model.py squad

To run on cornell_corpus

python3 model.py cornell_corpus

To run on twitter

python3 model.py twitter

The model can be trained on the user's system or the pretrained weights (.hdf5 files) included in the respective folders can be loaded to view the output.

Results

The results of the chatbot (including the follow up) are shown below -

References


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.