A (somewhat) simple Chatbot for Slack backed by a Recurrent Neural Network(RNN).
- Python 3.6
- TensorFlow 0.12
- Numpy
- SciPy
- Six
- Slackbot
- NLTK (punkt, a NLTK library, is also required. See
punkt_dl.py
script in repo)
The program is run in a Python virtual environment for Python 3.5, which is included in the venv
directory.
This section assumes you are using CentOS 7
- Clone this repo
- Create a Slack chatbot integration. Add the bot user to whatever Slack channel you would like. Take note of the
Bot User OAuth Access Token
. - Copy the
slackbot_settings_template.py
toslackbot_settings.py
in the same directory. Editslackbot_settings.py
and add your API token, and what channel you would like errors sent to, if any. - Gather all dependencies
- To install Python 3.6, see here: https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-centos-7
- To install TensorFlow, see here: https://gist.github.com/87170360/0d445ae4100c2686067ee56901b42f9b
- All other dependencies are installed using Pip, Python's package manager
- Copy the
slack_integration
directory from the repo to your Python distribution'ssite-packages
directory. Typically/usr/lib/python3.5/site-packages/
cd
to the repo, and runvenv/tensorflow/bin/python3.5 run.py
- Installing Docker is outside the scope of this repository, please see here for more information: https://docs.docker.com/engine/installation/
- Clone this repository
- Open a terminal (BASH or PowerShell depending on environment), and navigate to the repository directory
- Build the container using the following command:
docker build -t cmsc495:chatbot .
- Run the container using the following command:
docker run -m 2g -p 80:80 -p 443:443 -e "SLACKBOT_API_TOKEN=<Your token from step 2 here>" cmsc495:chatbot