An Approach for a Hyper Local, Crowd Sourced, Data Driven Chat Bot for COVID
An Approach for a Hyper Local, Crowd Sourced, Data Driven Chat Bot for COVID Rajan Manickavasagam Follow Aug 11 · 5 min read

Overview

The COVID-19 pandemic has captured everyone’s attention and impacted our daily lives since the past few months. It is likely to remain that way for the foreseeable future too, as we learn to navigate around it.

Several organizations and volunteers globally have created various kinds of dashboards, databases, etc. so that information is available to everyone. Some of them are:

COVID-19 database by Johns Hopkins: https://github.com/CSSEGISandData/COVID-19

COVID-19 India dashboards: https://github.com/covid19india/covid19india-react

COVID-19 India clusters: https://github.com/someshkar/covid19india-cluster

WHO app: https://github.com/WorldHealthOrganization/app

COVID-19 time series data: https://github.com/pomber/covid19

And many others

Approach

From the various open source applications already created for COVID, came my inspiration too, for a chat bot. The idea is to empower local communities with data and insights so that they are better informed as they go about their daily tasks and routine. This might help people assess the “risk” where:

Some of them have to go to an office or public place for work

Children are going to schools/parks

People are heading out for chores/outdoors

And similar scenarios

Concept

Governments, NGOs, businesses and health officials all over the world are taking several initiatives to keep people safe. However, it is imperative that local communities also take steps to safeguard themselves. The idea is to create a chat bot that is set up and maintained by each local community, like a ham radio movement.

Such chat bots could provide both quantitative and qualitative data to the users. This chat bot could act as a digital sentinel for each local community. So, let’s call them DISCO (Distributed Information Sentinels for COvid) chat bots. Each of these DISCO bots will be maintained by each community.

Technology

The first step is to gather the relevant data. This can be done on a Google Spreadsheet, as it allows multiple people to update the sheet at the same time. In the example here, data from the Aarogya Setu app is used to capture the COVID-positive cases and at-risk cases for a given location. A sample spreadsheet is here. This is the kind of “quantitative” data that the DISCO bot could provide.

Often, many people have queries regarding the pandemic. An FAQ conversation model can be built that can also be integrated into the DISCO bot. A sample is provided here. This is the kind of qualitative data the DISCO bot could provide.

Next, we need a host computer to run the bot. It could be a desktop, laptop, server, Cloud or even a Raspberry Pi. This bot would download the above spreadsheet regularly and keep a local cache (for quicker responses to user queries). My copy of the DISCO bot for the local community is running on my Raspberry Pi 3 that has been idle for years.

Lastly, the community can use Telegram chat app on a compatible device to interact with the bot. Scroll below for the demos on how to set up and use the DISCO bot.

Drivers and Goals

The following drivers and goals have driven the design and implementation of this chat bot:

Local

Yet Global

Community/Volunteer Driven

Accessible

Simple and Cheap

Local

As we have seen so far, each community can set up their own little ‘database’ in the form of a Google spreadsheet. The idea is not to have a global or even a national instance of the chat bot, but for each community/locality/suburb to maintain one for themselves.

With many countries and communities in various stages of lockdown at some time or the other, many people — professionals, students, elderly and children (basically everyone) are home-bound most of the time. Hopefully, this idea motivates people to reuse this chat bot and build something similar for their local communities. This way, people can learn/share some knowledge on technology and help their communities at the same time.

Yet Global

Largely, people are limiting their travel and daily routines to their immediate and nearby areas. This approach can be adopted by communities and organizations around the world.

Use cases for this bot could be residential communities, educational institutions, workplaces (where remote working is not possible), etc.

Community/Volunteer Driven

The two key stakeholders for this chat bot are volunteers:

Data Volunteers: Their responsibility is not just to enter/maintain the data, but to also ensure that the data is “as true” as possible. Data volunteers are kind of playing the role of citizen journalists. One of the “journalistic ethics” is to have a story/lead/data verified by at least 2 independent sources. This is the reason for the Google spreadsheet to have 2 columns: “Data Source Verified By (1): and “Data Source Verified By (2)”. It is also important to ensure that the data maintained is sufficiently protected and privacy maintained. For more details, please refer to Reuters Handbook.

Their responsibility is not just to enter/maintain the data, but to also ensure that the data is “as true” as possible. Data volunteers are kind of playing the role of citizen journalists. One of the “journalistic ethics” is to have a story/lead/data verified by at least 2 independent sources. This is the reason for the Google spreadsheet to have 2 columns: “Data Source Verified By (1): and “Data Source Verified By (2)”. It is also important to ensure that the data maintained is sufficiently protected and privacy maintained. For more details, please refer to Reuters Handbook. Technology Volunteers: Their responsibility is to set up and run the chat bot. The source code and installation instructions are available here at Github.

Accessible

Creating chat bots using Telegram APIs is incredibly simple. Also, Telegram provides various free chat clients across all devices and form factors — web, desktop, mobile and tablet apps.

Unless someone is on a “feature phone”, virtually anyone in the world should be able to access their respective local COVID chat bot over a data connection (mobile or broadband or Wi-Fi) from a device of their choosing.

Simple and Cheap

Simplicity here has 4 connotations:

Simple to maintain the data

Simple and light-weight to set up and run the chat bot

Simple and actionable insights

Simple for anyone to use the chat bot

All the technologies used in this chat bot are either free or open source or cheap to buy.

Chat Bot in Action

Step 1: Updating data in a Google spreadsheet

Step 2: Training a sample FAQ for the chat bot

https://youtu.be/IWphF4t34Pk

Step 3: Downloading Google spreadsheet to a local file cache and running the chat bot on a Raspberry Pi

https://youtu.be/ft0uEUycBXc

Step 4: Testing an alpha version of the chat bot in the Telegram Web app

https://youtu.be/CPXuFHfRNLk

Step 5: Testing the current version of the chat bot in Telegram app for iPhone

How to set up your own Bot

The source code and installation instructions are available here at Github. Feel free to customize to your requirements. You can set up and run a bot for your local community/organization. It should take roughly 1–2 hours to set it all up from scratch.

Summary

In the example videos above, the health and contact tracing application from the Indian central/federal government — Aarogya Setu (rough English translation — Bridge to your Health) has been used to manually collect anonymous data over a period of a few weeks, for the location where I live.

Take care and stay safe.
['Rajan Manickavasagam']
['Coding', 'Data', 'Chatbots', 'Engineering', 'Technology']