Skip to content

Generalised chatbot framework with followup

Notifications You must be signed in to change notification settings

shaanzie/chatbot-MIL

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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


Releases

No releases published

Packages

No packages published

Languages

  • Python 95.8%
  • HTML 3.9%
  • Shell 0.3%