General Architecture of Seq2Seq Model:
https://www.anaconda.com/distribution/
Please note that, when you're running the below line of code, you do so in the anaconda terminal to avoid any issues. "chatbot" is the name of the virtual environment.
conda create -n chatbot python=3.5 anaconda
Press 'y' and hit enter when it promts you for y/n
To properly activate the virtual env after creating it, go to anaconda navigator > environments > click on 'chatbot' then right click on it, click on run 'chatbot terminal' and run the below code
activate chatbot
To deactivate the virtual environment, simply use deactivate
pip install tensorflow==1.0.0
http://www.cs.cornell.edu/~cristian/Cornell_Movie-Dialogs_Corpus.html
- It allows you to execute a runtime instance using google's GPU (which is a powerful Nvidia Tesla K80) coupled with 12GB Ram
- It is free of cost
- Only downside is that it allots you a time period of 12 hours maximum after which the runtime terminates without any warnings and any files in that runtime are deleted as well
Check the Colab_GPU_train.ipynb which you can download and open directly on Google Colab
It explains all the steps as well as provides the code which you can directly execute unless you want to change the versions to setup your environment for training using GPU
I was only able to train the model for 15 epochs, which is very less for training a chatbot with a huge and complex dataset like cornell's movie dialouge corpus. As a result, below you can see that the chatbot's reply to my messages are hugely inaccurate. They can be however improved by further fine tuning the hyperparamters and certainly by training the model for more epochs.
Note: The python files contains not only the code but also comments wherever necessary to explain the code and the working. For any further questions, you can send a request.
This section is dedicated to amazing tutorials and articles on chatbot development out on the internet which helped me out a lot in building the bot. I specifically followed these:
- Ultimate Guide to Leveraging NLP & Machine Learning for your Chatbot - Stefan Kojouharov Link for Article
- seq2seq model in Machine Learning - Mani Wadhwa(GeeksforGeeks) Link for Article
- Python Chat Bot Tutorial - Chatbot with Deep Learning - Tech With Tim Link for Video