This repository contains code for a generative type chatbot created using RNNs with attention mechanism.
- Introduction
- Installation Steps
- Data Used
- Project Structure
- Model Training
- Chat with Bot
- Current Status
- Future Prospects
Now a days, the importance of Deep Learning and Natural Language Processing has been improving at a very remarkable rate. The main progress is seen in areas like Automatic Speech Recognition, Neural Machine Translation, Image Recognition, Self Driving Cars, Chatbots, Recomender Systems and other areas.
This is a Generative Type Chatbot developed using Recurrent Neural Networks with Attension Mechanism in TensorFlow Deep Learning Framework.
Some Background On Chatbots taken from WildML article on Retrieval-Based vs. Generative Models.
Retrieval-based models (easier) use a repository of predefined responses and some kind of heuristic to pick an appropriate response based on the input and context. The heuristic could be as simple as a rule-based expression match, or as complex as an ensemble of Machine Learning classifiers. These systems don’t generate any new text, they just pick a response from a fixed set.
Generative models (harder) don’t rely on pre-defined responses. They generate new responses from scratch. Generative models are typically based on Machine Translation techniques, but instead of translating from one language to another, we “translate” from an input to an output (response).
I am creating this project to apply the skills I learnt while working on the course Deep Learning for Natural Language Processing taught by Stanford Professors, Christopher Manning and Richard Socher. I suggest you go through this course in order to understand about Bi-directional Recurrent Neural Networks, Embeddings and Attention Mechanism in Seq2Seq models.
In order to use this repository to create a chatbot, you first need have Python 3.5 or more and need to install some Python Packages. I suggest you to create a virtual environment for this purpose. Run the following commands in your favorite projects directory.
cd path/to/your/folder
git clone https://github.com/manikanthr5/MovieChatbot.git
cd MovieChatbot
virtualenv -p python3.5 env
source env/bin/activate
pip install -r requirements.txt
Now you are ready to work with the Chatbot.
I am using Cornell Movie Dialogs Corpus for the purpose of training the model. Please download the data from this link and extract movie_conversations.txt and movie_lines.txt to ./data folder. Other files in this zip folder are optional and please read through them to understand more about the data.
The project is divided into 3 parts.