Cloudkibo / KiboPush

0 stars 1 forks source link

Build ChatBot for Corona Virus #8232

Closed jekram closed 4 years ago

jekram commented 4 years ago

This task is to build ChatBot for Corona Virus.

  1. We should use Dialogflow that we have used before
  2. It should be built for both Messenger and SMS.

It should menu-driven and not using Naural Language (this would be later).

Source: https://www.cdc.gov/coronavirus/2019-nCoV/index.html

For visibility, we would be creating

  1. Chatbot with Video
  2. Audio is Urdu for Pakistan

Speed is the essence. He have done this many times and we should use our existing knowledge.

sojharo commented 4 years ago

Faizan, can you please work with me on this task and collect videos and also create audio in urdu.

jekram commented 4 years ago

These are CDC Video's https://www.youtube.com/channel/UCiMg06DjcUk5FRiM3g5sqoQ

https://search.cdc.gov/search/?query=video&sitelimit=coronavirus&utf8=%E2%9C%93&affiliate=cdc-main

Faizan20 commented 4 years ago

I have collected all the COVID-19 CDC video's and created an excel sheet where I maintained the list of each topic title and its CDC web URL and its CDC video link. @sojharo you can find the sheet from this link

https://docs.google.com/spreadsheets/d/1XV7GbVw-o2ZNm57ZuYa31QcnYnT3xO8gU8BhHoisO9M/edit?usp=sharing

sojharo commented 4 years ago

Thanks. I will upload these videos to page once it is created so that we can use them in our chatbot.

sojharo commented 4 years ago

I have created the chatbot for both sms and messenger. I have captured almost all the sections from the website of CDC on corona.

For messenger, I have added videos for those topics for which videos were available. For sms, I have given information in small summarised messages on each topic. Also, on Messenger, we can read up on the information if we don't want to watch video.

As a next step, we need to have Facebook Page for this chatbot and a twilio number for sms testing. Once, we have the Facebook Page, I will upload the partial videos (due to 25 MB limit) on Page Messenger and then give the button to watch full video on Youtube.

Also, another step in this that I need to do is to setup the server for this bot. Currently, both demossa and demossa2 are being served from the same server (demossa droplet). I will use that server code to include the Covid19 Bot as well. We can create a new server code as well, but most of the logic is common, so with just switch of config information, we can include several in our single server code. This server was written in a way that it can support as backend of multiple bots at the same time.

For the Facebook apps, we are using KiboPush app (which is already approved for production) for both demossa and demossa2. Once the page is created, we will use the same app for Covid19 bot as well.

Summarised Next steps:

  1. Setup pages and upload partial videos to page and show buttons to watch full on youtube
  2. Setup server to also support Covid 19 Chatbot
  3. Purchase a twilio number and setup external twilio integration (twilio integration in dialogflow itself is going to deprecate, so we need to do external integration in our server code)
jekram commented 4 years ago

FANTASTIC.

ALHUMDULLAH. GREAT JOB

jekram commented 4 years ago

I have Created the page and made you, and @saniasiddiqui, @Faizan20 and @AnishaChhatwani as editors

Page Name is CovidAlert

Please have the logo and other info updated on this page. We probably get the same info from HealthAlertme page.

sojharo commented 4 years ago

I have completed the following two tasks in this now:

  1. Setup pages and upload videos to page and show buttons to watch them on youtube
  2. Setup server to also support Covid 19 Chatbot

The next remaining task in this:

  1. Purchase a twilio number and setup external twilio integration (twilio integration in dialogflow itself is going to deprecate, so we need to do external integration in our server code)
jekram commented 4 years ago

@sojharo Please make the following changes.

  1. On the startup (first-time users) has to enter another message.
  2. There need to a back button on each screen
  3. The last node should have a back button and a home button
  4. Let's remove "View Full Video" button
  5. Instead of Hello - can it be Hello Jawaid
  6. Does Messenger allows bold letters?
jekram commented 4 years ago

Please incorporate these Videos

  1. How does COVID-19 Spread https://www.youtube.com/watch?v=WfJSVbQtHs
  2. Six steps to prevent COVID-19 https://www.youtube.com/watch?v=9Ay4u7OYOhA
  3. COVID-19 What older adults needs to know. https://www.youtube.com/watch?v=TjcoN9Aek24
  4. 10 Things You Can Do to Manage COVID-19 at Home https://www.youtube.com/watch?v=qPoptbtBjkg&t=11s
  5. What You Need to Know About Handwashing https://www.youtube.com/watch?v=eZw4Ga3jg3E&feature=youtu.be
  6. COVID-19: What Older Adults Need to Know https://www.youtube.com/watch?v=TjcoN9Aek24&t=2s
  7. Surgeon General Social Distancing https://www.youtube.com/watch?v=wKX1PQTz5_M
sojharo commented 4 years ago

I have worked on following.

Back button is doing some problems. I think it is because of context I have set. In order to restrict the NLP, I have used contexts of dialogflow. I will look into rest from here and above comments tomorrow Inshallah.

jekram commented 4 years ago

@sojharo Let's follow this workflow document

https://docs.google.com/document/d/19xwCVjGUgA0yibtFb_m9QIoJiS5PmNTg3htgsI7_tnE/edit#

Faizan20 commented 4 years ago

Worked on this task and recorded audios. I have put the audios in the drive you can find the link here https://drive.google.com/open?id=1b_-Q-mQQtaytmiMAlzSYy_48iEondwPu

sojharo commented 4 years ago

I have completed the workflow of the chatbot according to the document. Also, uploaded the videos to facebook which were remaining. This can be tested on https://www.messenger.com/t/113059013658389

SMS part is remaining in the bot as it was becoming little bit difficult to show same options in multiple messages and trigger them with 1, 2, 3 input. I will look into this tomorrow again.

Also, one option 6.5 is remaining in the document.

Faizan20 commented 4 years ago

I have just tested the Urdu bot on messenger to see if the URDU is human-readable or not

Screenshot from 2020-03-25 14-54-22 Screenshot from 2020-03-25 14-26-56

I am proceeding with the roman URDU because the Urdu showing on messenger not looks good and is not human readable.

sojharo commented 4 years ago

I have worked further on this and have done following things:

  1. All the videos are moved down and text will be shown first and video as last message before quick replies. I have done this for all the intents where video is added.
  2. I have connected the chatbot with health alert me as well. It is working and we can see the messages from chatbot on health alert me when we say hello. There is one problem however, the videos are not played on health alert me as these were uploaded to covid alert page so they are only shown for the page to which they belong. One solution for this is to upload the same videos to health alert me page as well and change the bot logic to check for which page we should send which video. However, this solution will make the server side bot logic complex and will also need us to tweak the demossa and demossa2 bots as well else they will break.
  3. I checked whether a video uploaded to page feed can be sent on messenger of that page. But it didn't work. I think on the API level, they are not allowing sending more than 25mb video on messenger. Also, the vidoes which were uploaded to page feed will not be sent to page messenger as attachment.

sms part of the changes in chatbot are remaining from the document of conversation flow. I will work on them tomorrow.

Faizan20 commented 4 years ago

I have created the Urdu chatbot for messenger. I have captured all the sections and workflow of the chatbot according to the document. First, I started building it using Urdu but since it was not human-readable on Facebook I decided to shift towards Roman Urdu

Currently, I have given information in small summarised messages on each topic. Tomorrow I will be uploading the recorded audios also. So that users can read up on the information or they can listen to the audios.

As a next step, we need to have a Facebook Page for this Urdu chatbot. Once, we have the Facebook Page, I will upload the audios on Page Messenger.

Also, another step in this that I need to do is to set up the server for this bot.

Summarised Next steps:

  1. Setup pages and upload audios to page
  2. Setup server to also support Covid 19 Urdu Chatbot

After completing it for the messenger I will then start working on it for the SMS part.

Faizan20 commented 4 years ago

Worked on this task and did the following:

  1. Server setup to support Covid 19 Urdu Chatbot
  2. Setup pages and upload audios to page
  3. Add audio Payload in Dialogflow message

The pull request is under review once it got merged I will then test the bot and its flow.

sojharo commented 4 years ago

Worked more on this:

  1. Downloaded videos and uploaded to facebook for health alert me page (now bot on this page shows videos as well)
  2. modified all the video intents in covid alert chatbot and demossa chatbot to support page wise video attachment ids
  3. on chatbot server code, added page-wise condition

SMS intents in this are under construction.

jekram commented 4 years ago

@Faizan20 @sojharo What is the status of the pull request for the Urdu. I would like to see a demo in the status meeting.

Faizan20 commented 4 years ago

Worked on this issue and start with the testing of the bot I found out that there is some server setup error because of that the recording was not being sent to users. I have fixed that and other small issues now the Urdu bot is live. This can be tested on https://www.messenger.com/t/104316101220333

sojharo commented 4 years ago

There are few issues in our roman urdu. In our meeting, we have just found out the way to write correct urdu in arabic script on messenger. Please see the following link and update the bot accordingly today as we have sent it to high profile people today.

https://www.branah.com/urdu

Faizan20 commented 4 years ago

Ok working as a high priority on it.

Faizan20 commented 4 years ago

I worked on this task today and converted to Urdu chatbot from Roman Urdu to Urdu. I have done the following

  1. I have updated all the intents
  2. I have typed all the Urdu content for the chatbot

Now the chatbot is in the Urdu language. Here is the link of the chatbot https://www.messenger.com/t/104316101220333

sojharo commented 4 years ago

I have worked on this task to see why sometimes our chatbot is not working when we click on quick replies after a long time.

I came to know that dialogflow context are set to expire after 10 minutes. So after 10 minutes dialogflow will not remember what user was talking about before.

I am using contexts heavily because we have same multiple intents with same input such as: hand washing, we have around 3 intents for handwashing. So, it is important to keep the context to know which handwashing intent should be triggered.

One way to overcome this context expiration is to save the context in our own database. For now, we have not added any database to chatbot. Other way is to remove the duplicate intents so that we don't need to use the context.

https://miningbusinessdata.com/extending-context-duration-in-dialogflow/

https://cloud.google.com/dialogflow/docs/contexts-input-output

Also, with our new chatbot design process, we can easily take care of this. As, we will be able to attach ids to the quick replies as well. So, we can also recreate the entire bot once new design of our bot creation is implemented.

jekram commented 4 years ago

Thanks - Let's talk tomorrow.

Can we do without context?

sojharo commented 4 years ago

I think we can close this issue. or we can use it to port the chatbot that we created on dialogflow to the chatbot automation tool that we have. Our chatbot tool have no problems of context issues so the issue of sometimes bot not working next day will be resolved if we use our chatbot tool for this chatbot. Else we can close this issue.