Smart Ubiquitous Chatbot for COVID-19 Assistance with Deep learning Sentiment Analysis Model during and after quarantine

The huge number of deaths caused by the novel pandemic COVID-19, which can aﬀect anyone of any sex, age and socio-demographic status in the world, presents a serious threat for humanity and society. At this point, there are two types of citizens, those oblivious of this contagious disaster’s danger that could be one of the causes of its spread, and those who show erratic or even turbulent behavior since fear and anxiety invades our surroundings because of conﬁne-ment and panic of being aﬀected. In this paper we aim at developing a smart ubiquitous chatbot, called COVID-Chatbot, for COVID-19 assistance during and after quarantine that communicates with a citizen to increase his/her consciousness towards the real danger of this outbreak. Furthermore, COVID-Chatbot is able to recognize and manage stress, during and after lock-down and quarantine period, using natural language processing (NLP). The robust messages delivered from COVID-Chatbot and its way of communication could possibly help to slow the COVID-19 spread. The pro-N

posed method is a ubiquitous healthcare service that is presented by its four interdependent modules: Information Understanding Module (IUM) in which the NLP is done, Data Collector Module (DCM) that collect user's non-confidential information to be used later by the Action Generator Module (AGM) that generates the chatbots answers which are managed through its three submodules. And finally the Depression Detector Model (DDM) that detects anxiety in the text input through a deep leaning sentiment analysis model to help AGM make the decision to deliver a reassurance message if a bad behavior is distinguished.
Keywords Chatbot · COVID-19 · Natural Language Processing · Deep learning · Mental Health · Ubiquity 1 Introduction COVID-19 is the abbreviated name for novel coronavirus disease 2019, which is a respiratory illness that spreads from person to person 1 . Different from both MERS-CoV and SARS-CoV, COVID-19 is the seventh member of coronaviruses family that infects humans [12,4]. It was first reported in December 2019 in Wuhan City in China . Up to April 2020, more than 144,000 people have died globally from the COVID-19, while more than 2 millions infections have been confirmed in dozens of countries, according to the World Health Organization, as a result the COVID-19 is now declared a pandemic 2 .
Upon observing the proliferation of the outbreak, some countries were hit earlier than others, but currently has fewer cases than the recently hit countries.
According to the World Health Organization's head of emergencies, these dramatic differences show that the behavior of governments in response to this epidemic matters 3 , but most importantly, citizens' response too.
In fact, while the number of people who are being treated for COVID-19 is increasing by the day, some citizens are not aware of the real threat of this outbreak which explains its quickly spread all over the world, however others, panicked and desperate, fell headlong into the trap of this grim and even worse committing suicide [2].
Given the previously outlined circumstances, a smart ubiquitous chatbot is proposed in this paper in order to assist ordinary citizens during and after the quarantine period to help them overcome such a situation. The proposed method is a chatbot based ubiquitous [37] healthcare service that offers healthcare to anyone, anytime, and anywhere.
The remainder of the paper is organized as follows: First, we enumerates some solutions based on artificial intelligence proposed to fight COVID-19, in 2. Next, we explain our approach through a global architecture and the articulation between the different modules of our Chatbot 3. Then, we evaluate our work by a test case in 4. And finally, the paper ends with a conclusion and an outlook on some perspectives and future works for interesting research directions 5.

Related Works
Some citizens from several nations express their interest to the diagnosis, prediction and heal of the viral outbreak so that computer science researches has chosen to adopt artificial intelligence into the COVID-19 diagnosis to avail of its several advantages.
The authors of [7], developed an artificial intelligence method to to diagnose and predict COVID-19. This method is designated for the clinical use, so that ordinary citizens could not profit from it.
Also [9] proposed to use artificial intelligence and mobile-phone simultaneously in order to improve possible case identifications of COVID-19 in populations under quarantine .
More over in [8], artificial intelligence is coupled with an universal data sharing standards to manage and monitor urban health in smart cities, also it revealed the urgent need of the standardization of protocols for enhanced smart city communication to provide more possible cooperation in the case of disasters such as the recent novel pathogen COVID-19.
On the other hand, [5] developed an artificial intelligence based automated thoracic CT image analysis tools for detection, quantification, and tracking of COVID-19 positive patients, while [10] presented an artificial intelligence framework that reads the smartphone sensors' signal measurement to predict the severity of the pneumonia and the result of the COVID-19. It is designed for the experts (doctor or radiologists).
Chatbots prove their potential to surmount obstacles such as geographical problems that could be effective in our confinement period to curb in-person medical consultations. Meanwhile, communication becomes a necessity to convince and reassure people of the current plight, that's why, a Japanese based Bespoke company took advantage of artificial intelligence to launch an online chatbot called Bebot that provides up-to-date information of the COVID-19 and preventative actions with a possibility to check symptom [3].
Some interesting chatbots that were previously developed for the healthcare domain are also worth mentioning such as, SPeCECA [11] which is a smart pervasive chatbot for emergency case assistance and it is designated to interact with ordinary citizens to help them overcome an emergency situation by suggesting the accurate first aid actions to do. Additionally, Mandy [18] is a chatbot that communicates with normal people using natural language in order to provide an online healthcare suggestions. In [21], a chatbot is designed to mimic human interaction in a medical case. Its objective is to help ordinary people choose the most appropriate way to prevent a disease. Finally in [14], a mobile chatbot is developed for health care service. This chatbot is able to collect and detect user's daily health data, in order to diagnose chronic diseases and give preventive information and fast treatment to accidents that may occur in everyday life.
The second part of our research is the impact of virtual assistants to overcome stressful situations. Besides, a messenger chatbot was built to recognize and manage emotional stress through predefined set of questions [16]. Not far from this spirit, [19] presents chatbot for mental health counselling also using a set of questions to assess a user's depression without a deep learning sentiment analysis. However, other works [17,15,20,29,28] have benefited from the power of deep learning sometimes to adjust the sentiment of the chatbot response, and sometimes to detect depression in text sequences. Another solution was developed as virtual reality application to support individuals in a stressful situation via communication with imaginary persons [35]. Table 1 shows a comparative analysis of some research works according to several criteria: Chatbot-based, Service Delivered, Smartness, Ubiquity, Beneficiary and Deep Learning Sentiment Analysis (DL Sentiment Analysis). From the research we have done, we can conclude that despite the several propositions of solutions to fight havoc and damage caused by the novel COVID-19, very few works managed to broach the subject of communication with ordinary citizens to fight the spread of epidemic and mainly to handle and avoid psychological troubles that may appear because of the ongoing world's situation. That's why, we seek a smart ubiquitous chatbot to ensure communication and interaction with ordinary people under quarantine using artificial intelligence and natural language processing (NLP) methods to assist them mainly to thwart the agony may be caused by COVID-19 during or after quarantine.

COVID-Chatbot Architecture
Communication is essential to convince people of the danger of COVID-19 because most citizens all over the world are unconscious of the contagiousness of COVID-19. However we have to limit close interactions among people, so we propose COVID-chatbot: A Smart Ubiquitous Chatbot for COVID-19 Prehospital Assistance. The main objectives of COVID-Chatbot are listed below: -Help people understand and accept the coronavirus quarantine in order to limit the quickly spread of the viral disease -Raise awareness but also share reassuring messages to take the required precaution actions -Collect user's data (non-confidential information) to use it in machine learning later -Tell both uninfected and infected people what to do to protect themselves and their entourage from more infections.
Our adopted approach is modular in its organization. The individual modules of the workflow have been segregated into self-contained steps to enhance the quality of the implementation. COVID-Chatbot's architecture is shown in Figure 1, so we divide it into four main modules: Information Understanding Module (IUM), Action Generator Module (AGM), Data Collector Module (DCM) and Depression Detector Model (DDM). Information Understanding Module (IUM): When the user sends an input message, COVID-Chatbot must transform unstructured text to a structured representation composed of entities and intents which called the natural language processing (NLP), through several successive steps such as Tokenization [43], Part of Speech tagging (PoS tagging) [40], Lemmatization and Stemming [27], etc. Then we used the pre-trained word embedding model [33,25,26,13] GloVe [31] to transform text to vector. Next, we extracted entities by using Conditional Random Field (CRF) [38]. And finally, intent classification is done using Support Vector Machines (SVM) classifier [36] because it requires less training to guarantee confident intent classification. IUM is very similar to the Natural Language Processing Component (NLPC) of the Chatbot SPeCECA [11] which is used for emergency case assistance.
Action Generator Module (AGM): After understanding the user's request, COVID-Chatbot must deliver a precise, accurate and rapid actions. This task is done by Action Generator Module (AGM). AGM is trained on customised data that we generated from scratch because until now there is no publicly available conversational data sources between doctors and normal people about COVID-19.
So, we use decision trees algorithm [42] to generate actions as we treat this task as a classification problem. Actions delivered from COVID-Chatbot depend on the user input that's why we have decomposed AGM into three sub-modules: -Response Classifier: is the main sub-module of AGM since it decides the answer that must be generated taking into consideration the psychological state of the user as well as his desire of our chatbot. -Daily Medical Follower (DMF): the user who can take advantage of this functionality must either be infected or suspected of being infected with COVID-19. During the 14 days of quarantine the patient must fill in a virtual form which differs from the traditional form because there are no boxes to fill in but the fact of answering successive questions in a well determined order. DMF has the role to monitor the progress of the various symptoms during the 14 quarantine days. Then the information will be stored in the Data Collector Module so experts (Doctors, data scientists, etc..) will be able to have access to these information. -Off-topic input Manager: when the user shows a non-serious aspect, this sub-module returns a warning message to avoid unnecessary discussions.
To accelerate interactions between COVID-Chatbot and the user, there are answers suggested to the user to control the conversation in order to minimize errors as much as possible.
The Data Collector Module's mission is to collect the user's non-confidential data and create a dataset that contains these user's information: -Location -Symptoms (Fever, coughs, dyspnea, etc) -Age -Gender  Depression Detector Model (DDM): We solve the detection of depression as a text classification prob-lem. So we designed a Sentiment Analysis [22] model which is the process of computationally identifying and classifying sentiments expressed in a piece of text, especially in order to determine whether the user's attitude towards a specific topic is positive, negative, or neutral. We used the Long Short Term Memory (LSTM) network [41] as the regular Recurrent Neural networks (RNN) are not easy to train [34] because of the exponential growth by repeatedly multiplying gradients [39] over long sequences. We choose the LSTM, as it performed better than Gated Recurrent Units (GRU) [32] in our case. So we developed a sequential neural network model composed of four layers: Embedding layer and LSTM layer followed by two fully connected layers as shown in Figure 2.
In our example, we want to predict the state of the user when talking to our chatbot. Our model does not learn the response of immediate dependency, but rather of long-term dependence. We used the Sigmoid Activation function [44] as it can turn the output values in a value between 0 and 1. Thanks to this output, AGM will know the state of the user during an ongoing conversation. Thus, if the user sends three successive negative messages, AGM will decide to make the user more comfortable by sending him/her reassuring messages or pleasantries or even sending questions asking him/her the cause of the bad mood.

Implementation
Our solution is cloud based, so we developed three separate but inter-dependent applications: The mobile and web applications used by citizens and the cloud based platform, where each of proposed modules is deployed as a web service. Our web services are exposed as REST API micro services on the cloud, referenced via their URI as shown in Figure 3.
As mentioned in Section 3, the IUM deals with teaching a chatbot on how to understand user inputs. To be able to achieve this task, we build a natural language understanding (NLU) model and feed it with the training data. The model will then learn to convert the data into a structured format consisting of intents and entities. Then it will classify the user messages into one or multiple user intents. We already choose to work with spacy sklearn pipline, so this intent classifier loads pretrained language model which then is used to represent each word in the user's message as word embedding vector. Word embedding models have been trained on massive text corpus created from Google news and similar sources so the representations may not always transfer well to specific domains. For example, the word "python" means a very large snake in the everyday context, however it means a programming language in the field of computer science. These differences become even more relevant in our case because we are supposed to analyze medical data. Our solution is to simply train the GloVe model on our domain specific data. Since the embeddings are already trained, the SVM requires only little training to make confident intent predictions. So far the chatbot is able to process user input and understand it. Our next task is to teach COVID-Chatbot to respond to messages by training the AGM. The training data for AGM is called scenarios. User's inputs are expressed as intents as well as the corresponding entities, and the chatbot responses are expressed as actions. Finally, we will train AGM citing the policies that should be used to train it.
DCM collects entities as soon as the conversation begins and saves to create its proper dataset.
As for DDM, we used the deep learning library Keras [23]. This is where we get to use the LSTM layer. As we said in 3, our model is composed of an Embedding layer, LSTM layer and two Dense layers which are a fully connected neural network, first Dense layer with ReLU as activation function which to reach a higher accuracy. This layer has no parameters.and the second one with sigmoid as activation function. We added dropouts between layers to avoid over-fitting. After training and testing our model we got 92% of accuracy and 80.78 % of F1 score on validation set while running on a dataset that includes 14375 data with labeled sentiment (neutral, negative, positive). When we measure the number of correct predictions, we found that negative messages goes better for the Network than deciding the positive ones as shown in Table 2.
We evaluated our model's results on the basis of F1 score and accuracy. F1 score as the primary performance measure and accuracy as the secondary one. To calculate F1 score we had to calculate first Precision and Recall which are based on True positives (TP), True negatives (TN), False positives (FP) and False negatives (FN).
Here are the equations that we used: P recision = T P T P + F P F 1 Score = 2 * P recision * Recall P recision + Recall As shown in Table 3, when we use LSTM Layer we get F1 score of 80.78% whereas Gru has achieved a  To sum up, COVID-Chatbot keeps requesting information from the user to understand his/her situation and to collect information that will be used for a further machine learning. Once the determination is complete, actions suggested by COVID-Chatbot are performed.  An example of implemented scenario is shown in Figure 4 and Figure 5.

Conclusions and Future Works
We develop Smart Ubiquitous Chatbot for COVID-19 Assistance with Deep learning Sentiment Analysis Model during and after quarantine. COVID-19 is presented through its four modules: Information Understanding Module(IUM), Action Generator Module (AGM), Data Collector Module (DCM) and Depression Detector Model (DDM). A sentiment analysis model based LSTM neural network has been applied detect depression in texts delivered by the user during an ongoing discussion. Much further work is needed to improve our sentiment analysis model and make it applicable to the human voice and we aim to add a decision support module to allow users getting an idea of the probability of being infected with COVID-19.