You are on page 1of 6

GUI COVID-19 FAQS CHATBOT USING ANN

Abdelrahman R. S. Almassri

Department of Artificial Intelligence and Data Science, Istanbul Aydin University, Istanbul, Turkey

Abstract

While now we suffer certain illnesses to a degree never seen in the past like COVID-19 and this disease outbreak
continues to evolve also people of all ages can be infected by the new coronavirus (COVID19). People around the
world are pre-emptively seeking medical advice on how to live a healthy lifestyle. They are looking to lower their risk
of this disease.

A FAQ's chatbot can play a significant role to keep up with all questions about the disease from reliable sources. A
FAQ's chatbot is a computer program designed to simulate conversation with human users as a virtual assistant. My
study shows, there FAQ's chatbots available but not for COVID-19 disease. In this paper, I have demonstrated a
machine learning-based closed domain "COVID-19 FAQ's Chatbot" which can converse with the user with the help of
its knowledge base and through learning from interactions with the user. It helps a user to know everything especially
with COVID-19 by interaction using conversation (user can ask and the chatbot will reply). This paper explores the use
of neural network approaches and showed significant efficiency.

Keywords—FAQ’s, Healthcare, COVID-19, Chatbot, Neural Network

1. INTRODUCTION
The new outbreak comes as the country continues to respond to the complex Ebola outbreak in the eastern
part of the country, the COVID-19 pandemic, the world’s largest measles outbreak, and a complex and long-
standing humanitarian crisis [1]. Nowadays people are prone to several common but dangerous diseases due
to lack of awareness and early prevention. A FAQ's chatbot installed in any digital device such as a laptop
can play an important role in this situation. A basic FAQ chatbot can reply to potential questions by user-
inputted. Moreover, it may assist a user by providing information on disease. However, my study shows
there is no FAQ's COVID-19 chatbot available although there are many chatbots available for healthcare and
FAQs. One of the major reasons behind this is that according to my study, increasing prevalence of COVID-
19 disease, many people are searching for answers to their questions from reliable sources. Therefore, I have
designed and implemented a neural network based on FAQ's COVID-19 chatbot. The chatbot can reply
questions relation with COVID-19.

A chatbot is an automated software program that interacts with humans [2]. A chatbot is merely a computer
program that fundamentally simulates human conversations. A chatbot that functions through AI and
machine learning has an artificial neural network inspired by the neural nodes of the human brain. Chatbots
are programs that can do talk like human conversations very easily. For example, Facebook has a machine
learning chatbot that creates a platform for companies to interact with their consumers through the Facebook
Messenger application. In 2016, chatbots became too popular on Messenger. By the consequences is noted
that 2016 was the entire year of chatbots. The software industry is mainly oriented on chatbots. Thousands of
chatbots are invented on start-up's and used by the businesses to improve their customer service, keeping
them hanging by a kind communication. According to research, nowadays chatbots are used to solve several
business tasks across many industries like E-Commerce, Insurance, Banking, Healthcare, Finance, Legal,
Telecom, Logistics, Retail, Auto, Leisure, Travel, Sports, Entertainment, Media and many others. Thus that
was the moment to look at the chatbots as a new technology in the communication field. Nowadays various
companies are using chatbots to answer quickly and efficiently some frequented asking questions from their
customers. Artificial neural network are used for creating chatbots, which are used to define general pattern-
based queries. This pattern can also be used to give random responses for the same query in the chatbot.
1.1. Why is FAQ chatbot useful for COVID-19?
The implementation of this project for any person wants to ask anything on your mind to get a quick answer
about COVID-19. Even though most of the information is available on the web, peoples often like to have a
personal interaction with the advisor. In such an environment, a chat robot could be designed for providing
health advice. The main goal of such a system is to conveniently retrieve information without having to look
or browse several web pages to fetch answers to frequently asked questions.

Mainly for choosing COVID-19 because the disease quickly spread and this disease has caused a complex
humanitarian crisis in a short period of time.

1.2. Why Neural Network?


Neural Network or Artificial Neural Network(ANN) is something very similar to a brain. Just like neurons in
the brain are responsible for all of our tasks similar to that in ANN also consist of neurons, A “neuron” in a
neural network is a simple mathematical function capturing and organizing information according to an
architecture of the provided Dataset.
2. ARTIFICIAL NEURAL NETWORKS
Artificial neural networks (ANN) have become a hot topic of interest and chat-bots often use them in text
classification[3].
The artificial neural network is like a collection of strings that are ‘tuned’ to training data. Imagine a guitar
and the process of tuning its strings to achieve a specific chord. As each string is tightened, it becomes more
“in tune” with a specific note, the weight of this tightening causes other strings to require adjustment.
Iterating through the strings, each time reducing errors in pitch, and eventually, you arrive at a reasonably
tuned instrument [3].natural language toolkit.
Anyways, with that being said, let’s begin. There are various kinds of chat-bots in the market, many
supremely sophisticated like Google Assistant or Amazon Alexa. But the kinds that usually needed for the
FAQ section need not be that sophisticated because their domain is defined. They are built for a specific
purpose. They will only entertain the questions in the topics that they are trained to answer. But the key is the
questions are NOT hard-coded. The users are free to type in the question in whichever form they wish to, as
long it is semantically the same.
A question can be asked in any grammatical order or framed with the help of any kind Auxiliary words, the
chatbot has to consider all that, and find the main words from the sentence, to know the real meaning behind
what is asked for.
Person 1: How are people test for covid19?
Person 2: How I can make a test for covid19?
Notice here, there are many auxiliary words but the main words are “test” and "covid19". Those are the
words the chat-bot should pay attention to and spot them.
Chatbots have effectively reduced human efforts by providing automated human-like solutions for various
healthcare, business, and societal problems. This paper is an elaborate description of the design and
implementation of a COVID-19 Auto-Reply Bot, that is capable of providing answers to queries related to
the disease of COVID-19. The appropriate ANN techniques are applied to WHO Data, collected in the CSV
format and the ANN model is used for training this dataset, and classify the reply. The GUI Chat Application
is developed using the Tkinter package (“Tk interface”) by using python language.

2. RELATED WORK
As I have mentioned earlier there is no FAQ's COVID-19 chatbot, however, my study shows, there are
works that have been done related to text classification using a neural network like Nursing-care Data
Classification using Neural Networks [4], this work discusses reduce workloads for the evaluation of
nursing-care data and have good classification performance, neural networks are used for classifying
nursing-care data.
also, I will discuss another work "A Novel Approach for Medical Assistance Using Trained Chatbot [5]" but
this work proposed to create a system with artificial intelligence that can meet the requirements. The AI can
predict the diseases based on the symptoms and give the list of available treatments. The System can also
give the composition of the medicines and their prescribed uses. It helps them to take the correct treatment.
So we can see in the first work is an example for using healthcare data to make a classification for it, and the
second work an example for creating a chatbot with healthcare data and classification it.
3. OVERVIEW, METHODS AND TOOLS
The proposed system is text-based and therefore, the system takes written text commands as input. Text
input is processed by a software function called a “classifier”, this classification associates an input sentence
with an “intent” (a conversational intent) which produces a response.

There many approaches for chatbot text classification like Pattern matchers, Algorithms, and Neural
networks but Regardless of which type of classifier is used, the end-result is a response.

The project relied on Artificial neural networks, which are a way of calculating an output from an input (a
classification) using weighted connections (“synapses”) that are calculated from repeated iterations through
training data. Each pass through the training data alters the weights such that the neural network produces the
output with greater “accuracy” (lower error rate).

Artificial neural networks (ANN) have become a hot topic of interest and chat-bots often use them in text
classification. But let’s be honest: unless you are a neuroscientist, using the brain as an analogy isn’t going to
illustrate much. Software analogies to synapses and neurons in the animal brain have recently given rise to
fantasy while neural networks in software have been around for decades.

A chatbot is a computer program, which is designed to simulate a conversation with human users using
patterns, especially over the internet. They are our online assistants that offer different services through
chatting over the internet. To build artificial intelligence chatbots through Python, you will require a natural
language toolkit package (nltk) [2].

The main issue with text data is that it is all in text format (strings). However, Machine learning algorithms
need some sort of numerical feature vector in order to perform the task. So before we start with any project
we need to pre-process it to make it ideal for work. Basic text pre-processing includes:

Converting the entire text into uppercase or lowercase, so that the algorithm does not treat the same words in
different cases as different

Tokenization: Tokenization is just the term used to describe the process of converting the normal text strings
into a list of tokens i.e words that we actually want. Sentence tokenizer can be used to find the list of
sentences and Word tokenizer can be used to find the list of words in strings.

The NLTK data package includes a pre-trained Punkt tokenizer for English.

Removing Noise i.e everything that isn’t in a standard number or letter.

Removing Stop words. Sometimes, some extremely common words which would appear to be of little value
in helping select documents matching a user need are excluded from the vocabulary entirely. These words
are called stop words

Stemming: Stemming is the process of reducing inflected (or sometimes derived) words to their stem, base or
root form — generally a written word form. For example, if we were to stem the following words: “Stems”,
“Stemming”, “Stemmed”, “and Stemtization”, the result would be a single word “stem”.

Lemmatization: A slight variant of stemming is lemmatization. The major difference between these is, that,
stemming can often create non-existent words, whereas lemmas are actual words. So, your root stem,
meaning the word you end up with, is not something you can just look up in a dictionary, but you can look
up a lemma. Examples of Lemmatization are that “run” is a base form for words like “running” or “ran” or
that the word “better” and “good” are in the same lemma so they are considered the same.

First, we need to do a bunch of things on the data so that it becomes ideal to feed into the neural network for
the learning system it's called also "Preprocessing step".

The next step is to provide some training data. A few sentences that are associated with each intent (a
“class”) and we can now organize our data structures for documents, classes, and words.

After the initial preprocessing phase, we need to transform the text into a meaningful vector (or array) of
numbers. The bag-of-words is a representation of text that describes the occurrence of words within a
document. It involves two things:

•A vocabulary of known words.

•A measure of the presence of known words.

Why is it is called a “bag” of words? That is because any information about the order or structure of words in
the document is discarded and the model is only concerned with whether the known words occur in the
document, not where they occur in the document.

The intuition behind the Bag of Words is that documents are similar if they have similar content. Also, we
can learn something about the meaning of the document from its content alone.

For example, if our dictionary contains the words {Learning, is, the, not, great}, and we want to vectorize the
text “Learning is great”, we would have the following vector: (1, 1, 0, 0, 1).

And now we code our neural network training function to create synaptic weights. After that We are now
ready to build our neural network model, we will save this as a json structure to represent our synaptic
weights.

You should experiment with different ‘alpha’


(gradient descent parameter) and see how it
affects the error rate. This parameter helps our
error adjustment find the lowest error rate [6]:

synapse_0 += alpha * synapse_0_weight_update

This classify() function is all that’s needed for the classification. We can now generate the probability of a
sentence belonging to one (or more) of our classes. This is super fast because it’s the dot-product calculation
in our previously defined think() function.
Finally, Create a GUI for Chatting with the user. will interact with the user on a GUI interface. I’ll ask the
user to chat with the bot by posting a query. Naturally, the user will type the query in the natural language.
Remember, the neural network only understands numbers. So, we need to convert this natural language
query into something that the network understands. Then, in that intent section, we predict response and
throw it back to the user.
1. We can ask question as stored in CSV file (Origin text).

2. We can ask question with a different structure as stored in CSV (the origin text: Is the virus dangerous?).

3. We can change the present for sentence (the origin text: How can I protect myself?).
4. CONCLUSIONS AND FUTURE WORK
A chatbot is one of the easiest ways to fetch information from a system without having to think for proper
keywords to look up in a search engine or browse several web pages to collect information, users can easily
type their query in natural language and retrieve information, in this project I looked into how neural
network can be used as a text classification chatbot, and also I looked into our FAQ bot architecture and
some ways by which the accuracy can be improved, certainly as future work if we can collect more data and
broaden our knowledge base, the accuracy of the system can further improve and this FAQ bot could be used
to serve people and we can develop a website for it.
5. REFERENCES
[1] world health organization, Coronavirus disease (COVID-19), Situation Report – 136.
[2] Nii, M., Takahashi, Y., Uchinuno, A., & Sakashita, R. (2007). Nursing-care Data Classification using Neural
Networks. 2007.
[3] Akshay Kumar, Pankaj Kumar Meena ,Debiprasanna Panda ,Ms. Sangeetha (2019). Chatbot in Python.
[4] S. McConnell, Rapid Development, Microsoft Press, 1996.
[5] Madhu, D., Jain, C. J. N., Sebastain, E., Shaji, S., & Ajayakumar, A. (2017). A novel approach for medical
assistance using trained chatbot.
[6] Text Classification using Neural Networks (2017) https://machinelearnings.co/text-classification-using-neural-
networks-f5cd7b8765c6.

You might also like