bkenan / robo-chatbot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deep Learning ChatBot Microservice for Robo-Advisor

Background

There are many ways to improve communication between Robo-Advisor and its customers. One effective method in terms of efficiency, effectiveness and results would be to use chatbots. Several reasons include the following:

  1. Customers Prefer Texting to long phone calls
  2. It's fast
  3. It's available 24 hours

This application has been designed with Python, JavaScript, HTML/CSS, Deep Learning model - BERT and Flask. The idea was to build a chatbot for my Robo-Advisor, so that I can easily integrate it into the web application later. This chatbot receives texts from users and returns intelligent answers based on the trained model.

Modeling

As for the modeling, I used the BERT (Bidirectional Encoder Representations from Transformers) model. BERT applies bidirectional training of Transformer, an attention mechanism that learns contextual relations between words (or sub-words) in a text. Its goal is to generate a language model, so only the encoder mechanism is necessary here. The model achieved State-of-the-Art result for this chatbot, and I did the model evaluation by using Negative log-likelihood which had minimal averages:

nll

Workflow

Untitled Diagram-Page-1

Data

Dataset can be found in json and excel files, which have been created for this problem. Future improvement include to replace them with any relevant API service.

Deployment

I used AWS ECR to create a docker image and push my code into it. ECR is a fully managed container registry offering high-performance hosting. I also used AWS ECS that is a fully managed container orchestration service to deploy, manage, and scale my containerized application. This allowed me to deploy my application to AWS Elastic Compute Cloud (EC2). The site can be accessed by this link. The screenshot from the deployed app:

aws

Running in the local machine:

  1. Clone this repo
  2. Download my trained model and put it in a new "models" folder within the repo directory
  3. make install
  4. python application.py

Demo

demo.mov

About


Languages

Language:Python 57.8%Language:HTML 15.9%Language:CSS 15.3%Language:JavaScript 7.8%Language:Dockerfile 2.0%Language:Makefile 1.2%