Chatbot

From UBC Wiki

Chatbot

Authors: Kieran, Jugraj, Will

What is the problem?

Many companies are adopting online customer support systems to provide care to their customers. Hiring staff to answer every message through an online chat is expensive, and somewhat redundant if the same type of question is asked many times. We are creating an online chatbot that will provide automated answers to common user questions in order to reduce operating costs of a support system.

What is the something extra?

This bot will be trained on a set of sample user questions to predict which canned response best fits a new, unseen question.

What did we learn from doing this?

The chatbot is based on the websocket protocol and a naive bayes classifier. The implementation is concise and clean in haskell; processing and generating responses to user questions are simple operations on the classifier component with haskells list operations, and training datasets are stored in a simple human readable format.

However, the functionality of the project is centered around training data files and internet communication - two pieces of IO functionality. As a result, the project is heavily focussed on computations outside "pure" functional programming. The program loads training data based on a file name input; changing the contents of this file will lead to a different classifier being returned by the same training function inputs - impure functional programming - although training the classifier on the same set of training data will always produce an identical classifier - "pure". Haskell is certainly sufficient for the task, but it is used more like an imperative language than a functional one.

Links to code etc

Support Chatbot - https://github.com/jugrajb/CPSC312-Support-Chatbot

Naive Bayes Classifier - http://vishnumenon.com/2012/06/07/naive-bayes-classifier-in-haskell/

Chat Server - https://wiki.haskell.org/Implement_a_chat_server