Project Report AI Chatbot Covid 19
Project Report AI Chatbot Covid 19
BY
CERTIFICATE
This is to
submitted by
is a record of bonafide work carried out by them, under my guidance, in partial fulfillment of the
requirement for the Second Year of Engineering(Computer ) at M.I.T. School of Engineering, Pune
under MIT Art, Design & Technology University.
On this great occasion of accomplishment of our project onAI Chatbot For Covid 19 , we
would like to sincerely express our gratitude to Mrs. Dr Reena Pagarewho has been supported
through the completion of this project.
We would also be thankful to our HOD Mrs.Dr. RajneeshKaurSachdeoof MIT ADT for providing all
the required facilities in completion of this project.
Finally, as one of the team members, I would like to appreciate all my group members for their
support and coordination, I hope we will achieve more in our future endeavours
Group Members
1.Sujit Bhogil
2.Gurjeet Singh
3.Isha Awhale
4.Rutuja Deshmukh
Contents
Abstract
List of Tables
List of Figures
1. INTRODUCTION
2. PROBLEM DEFINITION
3. FEATURES OF PROJECT
8. REFERENCES
Glossary
Abstract
Artificial Intelligence has core branches like, Machine Learning which takes in data, searches
patterns, improves itself using the data, and displays the outcome. To lead healthy lifestyle
healthcare is very much important. In few unsocialized areas, it is quite hard to find a
consultation with a doctor that easily regarding health issues. The main idea here is to make a
healthcare chatbot based on Artificial Intelligence using NLP that can diagnose the disease and
provide required details about the specific disease before consulting or visiting a doctor. Reduces
the healthcare costs and improves accessibility to this medical chatbot. Specific chatbots act as
virtual medical assistance, which helps the patient know more about their disease and helps to
improve their health. The user can achieve the real benefit of a chatbot only when it can diagnose
all kinds of diseases and provide the necessary information. A text-to-text medical chatbot
involves patients in online conversation considering their health problems which provides a set
of personalized diagnoses based on their provided symptoms. These bots connect with the
potential patients visiting the site, helping them discover specialists, booking appointments, and
getting them access to correct treatment. This chatbot uses Natural language processing
techniques to process and analyze the data and give the output inappropriate manner. It brings up
the disease-related problems about whether the task mentioned above should be assigned to
human staff. This healthcare chatbot system will provide patients healthcare support online at all
times. It helps to generate health data and automatically delivers the information of reports to
medical management. By asking the questions in series it helps the patient by guiding what
exactly the user is looking for queries.
1. INTRODUCTION-:
The Current artificial intelligence has developed to a point where programs can learn by
the humans and effectively simplistic human conversations which is essential. One of the
best-known examples of chatbots in recent history is Siri the AI assistant that is part of
Apple's standard software for its products. Siri took chatbot mainstream in 2011. Since
then, brands in every sector have started to use them, eventually developing a new trend
conversational in user experience. This refers to an end-user experience in which your
interaction with a firm or service is automated based on user prior behaviour. If users are
developing artificial intelligence applications like Alexa, which enables the use of voice
to control devices. If you are a user, you can already interact with this Artificial
Intelligence chatbot on popular messaging platforms like Facebook, Instagram and so on.
Nowadays the use of chatbots has spread from user customer service to life and death
risks. Chatbots are coming into the healthcare industry and can help to solve health
problems. Health and fitness chatbots have begun to gain popularity in the market.
Previous year Facebook has started allowing healthcare industries to create Messenger
chatbots which would then communicate with users. A great example is Health Tap the
first company to release a health bot on the Messenger app. It allows users to ask their
medical-related queries and receive answers.
2. PROBLEM DEFINITION-:
With the spread of COVID-19 across the world, there is a sense of panic and uncertainty
amongst the public.
There is a need for health organizations to automate as many responses to these inquiries
as possible to free up human resources to deal with more complex problems in the fight
against this pandemic.
3. FEATURES OF PROJECT-:
1.SentenceTokenization:
In this method whole sentence is divided is into substrings and breaks into
smaller words. When a patient enters the query in form of sentences, a whole set
of words are converted into tokens, also split the sentences when there is
punctuation mark.
2. Word Tokenization:
There are varieties of words, whichare present in the dictionaries.The
segmentation of sentences is carried out. Words are assigned to tokens. The
chatbot helps to classify the words according to the category present in medical
records and gives the optimum feedback to a user.
3. Stemming and Lemmatization:
Stemming is process,where words are chopped out from beginning and end.
Whereas, lemmatization is used in morphological analysis for extraction of words.
When doctors entered the wrong data on their database, the responses of chatbot
are not relevant. These above techniques are used to correct the information and
give proper response to a patient in form of text.
4. PLATFORM / TECHNOLOGY -:
The proposed method for developing the systemconsist of web application. Firstly, chatbot is
createdwhich can help the users to get the symptoms of theirdiseases. Then we will add the
chatbot link over therespective hospital website which will help the otherpeople to gain the
information of medical reports[6].Database of the system helps to store therecords of the users.
We had train a chatbot using chatterbotlibrary and also train the bot to identify certain typesof
keywords in order to recognize the user's intent.This information shall then be forwarded to
thebackend. The chatbot can be trained to perform somelogical reasoning and responses without
referring tothe backend.The proposed method for developing the system consist of healthcare
application. It elaborates the business aspects of the proposed system. Firstly, chatbot is created
which can help the users to get the symptoms of their diseases.Then hospital website is
integrated which will help the other people to gain the information of hospital and their staff.
Database of the system helps to store the records of the users backend is responsible to use the
processed input from the chatbot and convert it into action to be performed in the database.
The proposed system is accessed by two entity namely, Admin and User. Admin needs to log in
with their login credentials.
5. FLOWCHART-:
From this flowchart are used to show the flow of message from one activity to the other activity.
Activityis the specific operation. The user will give the personal details such as name . Chatbot will ask
the symptoms from the user and by using natural processing language process it will respond to the
database and related question answer will be reflect.. The details will be stored in the database in will
reflect in command prompt .At last, the health care bot will provide the details and allow user to exit
the portal by ending up the conversation.
The healthcare chatbot is designed by using python in backend and user interface design
byJavaScript. For conversation between user and system the natural processing library is used
named chatterbot application runs in localhost ser appropriate details according to the user
queries. In training phase, the train.py file is and the new database is created. All the database
files are in xml format which are trained in the initial stage of the application model frontend
interface of the healthcare assistant is displayed on the localhost server and ready to solve the
patient symptoms on basis of a specific disease. At initial, the health assistant will take some
personal details of the user which will be stored the database. The diseases like headache, cough,
cold, etc are some diseases where user queries are inserted. For a doctor’s appointment, a
different data file is created. The training will help the bot to increase the accuracy of the
responses. Aft running the train.py file, it will load the all data into the MYSQL database and it
will create a new user [9]. After creating the new database, it will list all the data files and
training will be initiated.. That link consists of the chatbot web application be used by any
internet browser chrome, and so on
6. OUTPUT-:
7. CODE-:
import numpy as np
import google
import tensorflow as tf
import tflearn
import random
import nltk
stemmer = LancasterStemmer()
import json
import pickle
import warnings
warnings.filterwarnings("ignore")
intents = json.load(json_data)
words = []
classes = []
documents = []
ignore_words = ['?']
words.extend(w)
documents.append((w, intent['tag']))
classes.append(intent['tag'])
words = sorted(list(set(words)))
training = []
output = []
print("Creating an List (Empty) for Output.....")
bag = []
pattern_words = doc[0]
for w in words:
output_row = list(output_empty)
output_row[classes.index(doc[1])] = 1
training.append([bag, output_row])
random.shuffle(training)
training = np.array(training)
train_x = list(training[:,0])
train_y = list(training[:,1])
tf.compat.v1.reset_default_graph()
net = tflearn.input_data(shape=[None, len(train_x[0])])
net = tflearn.fully_connected(net, 8)
net = tflearn.fully_connected(net, 8)
net = tflearn.regression(net)
print("Training....")
model.save('model.tflearn')
print("Loading Pickle.....")
words = data['words']
classes = data['classes']
train_x = data['train_x']
train_y = data['train_y']
intents = json.load(json_data)
model.load('./model.tflearn')
import requests
def getCovidData(state,city):
r = requests.get("https://api.covid19india.org/state_district_wise.json")
data=r.json()[state]['districtData']['Pune']['delta']
return f'confirmed {data["confirmed"]} deceased {data["deceased"]}
recovered {data["recovered"]}'
def clean_up_sentence(sentence):
sentence_words = nltk.word_tokenize(sentence)
return sentence_words
sentence_words = clean_up_sentence(sentence)
bag = [0]*len(words)
for s in sentence_words:
if w == s:
bag[i] = 1
if show_details:
ERROR_THRESHOLD = 0.25
print("ERROR_THRESHOLD = 0.25")
def classify(sentence):
return_list = []
for r in results:
return_list.append((classes[r[0]], r[1]))
return return_list
results = classify(sentence)
if results:
while results:
if 'data-today' == results[0][0]:
state=input("Enter State")
city=input("Enter city")
return print(getCovidData(state,city))
for i in intents['intents']:
if i['tag'] == results[0][0]:
return print(random.choice(i['responses']))
results.pop(0)
class cdata():
name = "IDK"
data = cdata()
while True:
answer = response(input_data)
answer
def do_AI(x,data):
if data.name == "IDK":
8..REFERENCES-:
Jia, Jiyou. "CSIEC: A computer assisted English learning chatbot based on textual
knowledge and reasoning." Knowledge-Based Systems 22.4 (2009): 249-255.
Patel, Neelkumar P., et al. "AI and Web-Based Human-Like Interactive University
Chatbot (UNIBOT)." 2019 3rd International conference on Electronics, Communication
and Aerospace Technology (ICECA). IEEE, 2019.
Dharwadkar, Rashmi, and Neeta A. Deshpande. "A medical chatbot." Int J Comp Trends
Technol 60.1 (2018).
Our application also can give the answer for normal queries.
Our application also provide people a happy environment as it share cheerful video for
who has covid anxiety and Depression.
Future scope of the project could be AI Based Covid 19 chatbot system using NLP can also
include a mobile assistant in it which will be more functions will be added and can be accessed
by many users. Which will also reduce the time and will also be accurate in the health details of
patients given to the doctors. We can add biometric system for more secure authentication
process.
Reference & Bibliography-:
[1]"Real World Smart Chatbot for Customer Care using a Software as a Service (SaaS) Architecture
“Godson Michael D’silva1”, Sanket Thakare2, Shraddha More Available:
https://www.docme.ru/doc/2207164/i-smac.2017.8058261
[3] YerlanJ Saurav Kumar Mishra, Dhirendra Bharti, Nidhi Mishra,” Dr.Vdoc: A Medical Chatbot that Acts
as a Virtual Doctor”, Journal of Medical Science and Technology Volume: 6, Issue 3, 2016. Available:
http://medicaljournals.stmjournals.in/index.php/RRJoMST/article/view /30
[7] Kowatsch, T., VollanMobile Coach. In: Designingthe Digital Transformation. DESRIST 2017. Lecture
Notes in Computer Science, vol 10243, pp. 485-489. Springer, Berlin; Germany (2017). Available:
https://www.researchgate.net/publication/317181609_Design_and_Eva
luation_of_a_Mobile_Chat_App_for_the_Open_Source_Behavioral_Health_Intervention_Platform_Mob
ileCoach
[9] Ahmed Fadhil, “Beyond Patient Monitoring: Conversational Agents Role inTelemedicine& Healthcare
Support For Home-Living Elderly Individuals”, a researcharticle, April 2017.
Available :http://:www.researchgate.net/publication/323845985_Beyond_Patient
_Monitoring_Conversational_Agents_Role_in_Telemedicine_Healthca
re_Support_For_Home_Living_Elderly_Individuals.pdf
[10] Fadhil, Ahmed. ”Can a Chatbot Determine My Diet?: Addressing Challenges ofChatbot Application
for Meal Recommendation.” arXiv preprint arXiv:1802.09100(2018). Available:
http://:www.researchgate.net/publication/addressing_challanges_of_
chatbot_application_for_meal_recommendation.pdf
[19] Web application testing for creating final test cases reports of user interface guidance. Available:-
https://www.perfecto.io/blog/ui-testing-comprehensive-guide