Skip to content

Aazim-parwaz/Rasa-Covid-ChatBot

Repository files navigation

COVID-19 Chatbot with Rasa 2.0: open source conversational AI(currently migrating to Rasa 3.x)

Table of Contents

  1. Introduction
  2. COVID-19 data
  3. Conversational flow
  4. Demonstration
  5. Installation
  6. References

Introduction

As natural language processing (NLP) technology and chatbot systems over the past few years have evolved quickly, also the usefulness of chatbots has increased. The motivation of chatbots is productivity; they have an instant access to information they refer to and are efficient in assisting users. (Brandtzaeg, 2017, Why people use chatbots. COVID-19 chatbot is an excellent use case example for the technology.

The content of a chatbot consists of the personality, conversation flows and the information it can deliver to the user. Personality is created by interactions and responses and by acting differently in different situations. These responses should be designed so that it maximises the engagement between the bot and the user (Katz, 2019, The Ultimate Guide to chatbot personality, Chatbots Magazine). The COVID-19 chatbot described here aims to use these principles, however due to the efforts required, in a rather minimalistic way leaving plenty of room for future improvements. e.g. in the area of how to handle chitchat.

COVID-19 data

The COVID-19 data format chosen here is defined by (https://api.rootnet.in/covid19-in/stats/history), which provides COVID-19 data freely for developers.

Conversation Flow

The conversation is initiated by the end-user. The user starts with a greeting "hi" , "hey" etc. The bot responds with the list that user can ask to bot. if user chooses option 1. The bot asks for the state name. When user enters the state name , the bot replies with the details for cases.

Demonstration:


Sample Demonstration Images:

Chatbot's Intro Interface:

Chatbot's Chat Interface:

Chatbot's Tracker Interface:

Deployed Chatbot's Telegram interface:



Installation

Installation assumes existing installation of miniconda or anaconda. https://www.anaconda.com/

pip3 & Rasa

Below are the simple steps for creating a virtual environment, install pip3 and Rasa Open Source 2.0.

conda create -n RasaEnv python=3.7.6 
conda activate RasaEnv
conda install -c anaconda pip3
pip3 install rasa==2.8.11  

In case of issue, please refer to Rasa Open Source installation pages: https://rasa.com/docs/rasa/installation/

Creating and initialising a new project:

mkdir rasa
cd rasa
rasa init --no-prompt

This will create a new directlry, under which rasa creates all necessary directories and files.

Replace all files in the rasa directory with the files in the project.

Train the model and run the bot

Train the model with command

rasa train

There are additional actions that need to be started before starting the bot evaluation. These are in actions.py file. To do so, run below commands on two different terminals:

rasa run actions

Start the discussion with rasabot:

rasa shell

Starting the model on deployable server

Terminal 1(starting ngrok on default port of rasa 5005):

ngrok http 5005

copy paste the url in the credentials file.

Terminal 2(start bot):

rasa run

Terminal 3(start actions file):

rasa run actions

Now just go to "Covid-bot-Aazim" on telegram and start using!

References

- Rasa. (n.d.). Rasa: Open source conversational AI. URL: https://rasa.com

Releases

No releases published

Packages

No packages published

Languages