Skip to content

Machine Learning Slack Chatbot with Data Visualizations

License

Notifications You must be signed in to change notification settings

maddiex/thesis

 
 

Repository files navigation

Charlie Chatterbot

Machine Learning Slackbot + Data Visualizations

Charlie the Chatterbot is a Machine Learning Chatbot that integrates with Slack. Place the Slack bot into your channel and the bot will be automatically trained on all of the conversations in that particular channel. Over time, the bot will learn and represent the culture of the Slack channel. All of the data that the bot learns from is also analyzed through Alchemy's sentiment analysis, and displayed in graph form.

We are live at uai.website!

Table of Contents

Installation

If you need to set up a Python dev environment, check out this guide in our wiki.

From the root directory,

npm install
pip install -r requirememnts.txt

Initializing the Database

This project uses mysql for the node/express server, and Mongodb for the chat bot. Both must be installed and running.

Initialize the MySQL Database with the Schema File

$ mysql -u root < server/Schema.sql

If your MySQL instance needs a password, add -p to this command

Start MongoDB

$ mongod

It is recommended that each of the following commands is run in it's own terminal window. This will help with development flow as you will be able to watch webpack, the server and the bot at the same time.

1. Run webpack to package the front-end code

$ npm run webpack

2. Run the server using nodemon

$ nodemon server/server.js

3. Run the chat bot

$ nodemon server/chatterbot/chatterbot_entry.js

Configuration

The following files must be added to the server/config folder. These files hold secrets, such as API keys.

AlchemyApiKey.js

module.exports = <ALCHEMY_API_KEY>;

botKey.js

module.exports = <SLACK_BOT_KEY>;

pythonSettings.js

module.exports = {
  mode: 'text',
  pythonPath: '<PATH_TO_PYTHON>',
  args: [0, 'test', 0],
};

winston.js set logging levels - uncomment lines for loggly integration.

const winston = require('winston');
require('winston-loggly');

module.exports = (logger) => {
  logger.level = 'info';
  // logger.add(winston.transports.Loggly, {
  //   token: '<LOGGLY_API_TOKEN>',
  //   subdomain: 'your loggly subdomain',
  //   tags: ['Winston-NodeJS'],
  //   json: true,
  // });
  // logger.add(require('winston-daily-rotate-file'), {
  //   filename: 'server.log',
  //   dirname: './logs',
  //   prepend: true
  // });
};

Architecture

Front-end
APIs
  • AlchemyAPI - Sentiment analysis
  • Slack RTM
Back-end
Testing
  • Travis CI - Continuous Integration Testing
  • Mocha/Chai
  • Karma
Architecture Diagram

Architecture

MySQL Schema

Schema

Deployment

Our deployment strategy is explained in more detail in our wiki.

Contributing

See CONTRIBUTING.md to see the Git Flow that we used in this project.

Authors

License

MIT

Issues

Stories in Ready

Waffle.io Throughput Graph. We have been working really hard on this project

Throughput Graph

About

Machine Learning Slack Chatbot with Data Visualizations

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 56.8%
  • JavaScript 23.0%
  • Python 20.0%
  • HTML 0.2%