Wa0002.
Wa0002.
On
HEALTHCARE CHATBOT
Training From: Onlei Technology
Submitted to
MAHARAJA RANJIT SINGH PUNJAB TECHNICAL
UNIVERSITY
in partial fulfillment of the requirement for the award of the degree of
B.TECH
In
Aditi Sengupta
ACKNOWLEDGMENT
Aditi Sengupta
Table of content :
1. Introduction…………………………………………………………………………………5
1.1 Healthcare Chatbot………………………………………………………….5
1.2 Diseases prediction, Decision tree algorithm……………………6
2. Survey regarding disease diagnosis………………………………………………
6
2.1 Existing system………………………………………………………………..7
2.2 Proposedsystem……………………………………………………………..7
3. Objectives……………………………………………………………………………………8
3.1 Overall algorithm………………………………………………………….…8
4. Architectural design ……………………………………………………………………9
4.1 Architectural requirements……………………………………………10
5. Features…………………………………………………………………………………….11
6. Module used………………………………………………………………………………
11
6.1 Tkinter…………………………………………………………………………..12
6.2 Os………………………………………………………………………………….12
6.3 Web browser…………………………………………………………………13
6.4 Numpy…………………………………………………………………………..13
6.5 Pandas…………………………………………………………………………..14
6.6 Matplotlib……………………………………………………………………..16
7. Working of healthcare chatbot………………………………………………….18
7.1 Procedure of project……………………………………………………..19
7.2 Files used in project……………………………………………………….19
7.3 Required
system…………………………………………………………….20
7.3.1 User login to system………………………………………………..
1 . Introduction
1.1 Healthcare chatbot
Abstract: As the demand in Machine Learning and AI keeps growing,
new technologies will keep coming in the market which will impact our
day-to-day activities, and one such technology is Virtual Assistant Bots
or simply Chatbots. Chatbots have evolved from being Menu/Button
based, to Keywords based and now Contextual based. The most
advanced among all of the above is contextual based because it uses
Machine Learning and Artificial Intelligence techniques to store and
process the training models which help the chatbot to give better and
appropriate response when user asks domain specific questions to the
bot. The idea is to create a medical chatbot that can diagnose the
disease and provide basic details about the disease before consulting a
doctor. This will help to reduce healthcare costs and improve
accessibility to medical knowledge through medical chatbot. The
chatbots are computer programs that use natural language to interact
with users. Our project focuses on providing the users immediate and
accurate prediction of the diseases based on their symptoms. For the
prediction of diseases, we have used Decision tree algorithm. Chatbots
can play a major role in reshaping the healthcare industry by providing
predictive diagnosis.
1.2 Disease Prediction, Decision tree Algorithm
Since the past few decades, humans have been tirelessly working day in
and day out that they fail to prioritize their health on a regular basis. In
the longer run, this problem leads to jeopardizing the quality of life.
Nevertheless, with the aid of Artificial Intelligence, we can now provide
health care services to individuals at their convenience at reasonable
prices. One of the biggest blessings we possess is a healthy body. A
healthy body and enhanced quality of life is something each one of us
looks up to. The primary focus of this paper is to provide these services
to fulfill the above mentioned purpose. It is difficult to imagine our lives
without high tech gadgets because they have become an essential part
of our lives. Therefore the field of Artificial Intelligence is prospering
due to the various applications of it in the research field. Disease
prediction is one of the main goals of the researchers based on the
facts of big data analysis which in turn improves the accuracy of risk
classification based on the data of a large volume. E-healthcare facilities
in general, are a vital resource to developing countries but are often
difficult to establish because of the lack of awareness and development
of infrastructure. A number of internet users depend on the internet
for clearing their healthcare based queries. We have designed a
platform for providing online medical services to patients with a goal to
provide assistance to healthcare professionals. The user can also seek
medical guidance in an easier way and get exposure to various diseases
and diagnosis available for it. In order to make communication more
effective, we have implemented a chatbot for disease prediction.
Chatbots are the human version of software that is based on AI and
uses Natural language processing (NLP) to interpret and accordingly
respond to the user. This study proposes the disease prediction chatbot
using the concepts of NLP and machine learning algorithms. The
prediction is carried out using the Decision tree algorithm.
2.SURVEY REGARDING DISEASE DIAGNOSIS :-
An application of counseling chatbot, which provides conversational
service for mental health care based on emotions recognition methods
and chat assistant platform. This application doesn’t consider the user's
psychiatric status through continuous user monitoring.
In this text-based healthcare chatbots can be designed to effectively
support patients and health professionals in therapeutic settings
beyond on side consultations. It does not have face to face care and
where THCB are likely to fail.
This paper reports a primary care chatbot system created to assist
healthcare staff by automating the patient's intake process. In this
paper they did not include more disease and also a symptom synonym
thesauri also should be produced.
This provides a text-to-text conversational age that asks the user about
their health issue. The user can chat as if chating with a human. The bot
then asks the user a series of questions about their symptoms to
diagnose and gives suggestions about the different symptoms to clarify
the disease. Doesn’t give detailed information No features such as
duration, intensity of symptoms etc
The proposed method is a chatbot based mobile healthcare service that
can immediately respond to the accidents that arise in everyday life
and to the condition changes of chronic-disease patients. Also proposes
a framework for the human-robot interaction that can endure an
efficient implementation of the chatbot service. It is a text based bot
irrespective of having all advanced features.
Conversational agents have many technical, design and linguistic
challenges. They introduced the nature of conversation user
interface(CUI) for health and described UX design. Some technical
limitations like voice message are not accurate, some corruptions are
faced due to the network so the timing of bot remainders is corrupted.
The Bot Transition program provides a framework and resources based
on AAP, AFP and ACP recommendations to promote skill attainment in
self-care. A scripted text messaging platform is feasible and appears to
be well-received by patients and caregivers. It is designed only for
people with special health needs transitioning into adolescents.
The system uses a question and answer protocol in the form of a
chatbot to answer users' queries. The complex questions and answers
present in the database are viewed and answered by an expert. This
chatbot is comparatively time consuming.
This chatbot is an attempt to let users understand the symptoms they
are facing and get a basic diagnosis about the disease they could be
having. Complex interface, time consuming, high installation cost.
A chatbot is an interactive software application to simulate natural user
interactions based on AI modeling. We have proposed a dataset for the
commonly occurring medical conditions together with a prototype
model to provide quick assistance to the patients.It only gives solutions
for the common medical conditions.
Uses both KNN algorithm and decision tree classifier and from that
more accurate one is taken and shows the output. As it uses both
algorithms it is time consuming.
2.1 EXISTING SYSTEM
Many of the existing systems have chats through texts.Some limitations
of such Chatbotsare,there is no instant response given to the patient,
they have to wait for experts acknowledgement for a long time. And
also there are a limited number of diseases in the dataset.Technical
issues like voice messages are not accurate in the existing system .
2.2 PROPOSED SYSTEM
In our system the user can interact with the chatbot through text and
chat bot will interact using voice and text manner. With respect to the
users queries, the bot identifies the disease if user chatting with the
chatbot. According to the diseases of the user, bot gives suggestions for
the disease and also prescribe specialist doctors. This system can be
used by multiple users at a time without any lagging.
3. Objectives
1. To extract symptoms from user chat.
2. To classify and predict the diseases using a decision tree classifier.
3. To develop a healthcare chatbot to predict diseases by symptoms
taken as input.
3.1 Overall Algorithm
1. Insert user query in the chatbot window.
2. The details will be extracted from the user chat.
3. Decision Tree classifier algorithm is used to process the query.
4. The response is fetched from the chatbot like Disease Prediction and
Disease Precaution and output to the user.
5. Exit.
4. Architectural Design
Example:
import Tkinter
top = Tkinter.Tk()
# Code to add widgets will go here...
top. mainloop()
6.2. OS module
The OS module in Python provides functions for interacting with the
operating system. OS comes under Python’s standard utility modules.
This module provides a portable way of using operating system-
dependent functionality. The os and os.path modules include many
functions to interact with the file system.
Handling the Current Working Directory
Consider Current Working Directory(CWD) as a folder, where the
Python is operating. Whenever the files are called only by their name,
Python assumes that it starts in the CWD which means that name-only
reference will be successful only if the file is in the Python’s CWD.
Note: The folder where the Python script is running is known as the
Current Directory. This is not the path where the Python script is
located.
Getting the Current working directory
To get the location of the current working directory os.getcwd() is used
Example:
# Python program to explain os.getcwd() method
# importing os module
import os
# Get the current working
# directory (CWD)
cwd = os.getcwd()
# Print the current working
# directory (CWD)
print("Current working directory:", cwd)
6.3 Webbrowser
In Python, webbrowser module is a convenient web browser controller. It
provides a high-level interface that allows displaying Web-based documents to
users.
webbrowser can also be used as a CLI tool. It accepts a URL as the argument
with the following optional parameters: -n opens the URL in a new browser
window, if possible, and -t opens the URL in a new browser tab.
Python
Example:
import webbrowser
webbrowser.open('http://www.python.org')
6.4. NumPy
NumPy is a general-purpose array-processing package. It provides a high-
performance multidimensional array object, and tools for working with these
arrays. It is the fundamental package for scientific computing with Python. It is
open-source software. It contains various features including these important
ones:
A powerful N-dimensional array object
Sophisticated (broadcasting) functions
Tools for integrating C/C++ and Fortran code
Useful linear algebra, Fourier transform, and random number
capabilities
Besides its obvious scientific uses, NumPy can also be used as an efficient
multi-dimensional container of generic data. Arbitrary data-types can be defined
using Numpy which allows NumPy to seamlessly and speedily integrate with a
wide variety of databases. Installation:
Mac and Linux users can install NumPy via pip command:
pip install numpy
Example:
# Python program to demonstrate
# basic array characteristics
import numpy as np
# Creating array object
arr = np.array( [[ 1, 2, 3],
[ 4, 2, 5]] )
# Printing type of arr object
print("Array is of type: ", type(arr))
# Printing array dimensions (axes)
print("No. of dimensions: ", arr.ndim)
# Printing shape of array
print("Shape of array: ", arr.shape)
# Printing size (total number of elements) of array
print("Size of array: ", arr.size)
# Printing type of elements in array
print("Array stores elements of type: ", arr.dtype)
6.5 Pandas
Pandas is an open-source library that is made mainly for working with relational
or labeled data both easily and intuitively. It provides various data structures
and operations for manipulating numerical data and time series. This library is
built on top of the NumPy library. Pandas is fast and it has high performance &
productivity for users.
Advantages
Example
import pandas as pd
import numpy as np
# simple array
data = np.array(['g', 'e', 'e', 'k', 's'])
ser = pd.Series(data)
print(ser)
6.6 Matplotlib
Matplotlib is an amazing visualization library in Python for 2D plots of arrays.
Matplotlib is a multi-platform data visualization library built on NumPy arrays
and designed to work with the broader SciPy stack. It was introduced by John
Hunter in the year 2002.
One of the greatest benefits of visualization is that it allows us visual access to
huge amounts of data in easily digestible visuals. Matplotlib consists of several
plots like line, bar, scatter, histogram etc.
Installation :
Windows, Linux and macOS distributions have matplotlib and most of its
dependencies as wheel packages. Run the following command to
install matplotlib package :
python -mpip install -U matplotlib
Example
# importing matplotlib module
from matplotlib import pyplot as plt
# x-axis values
x = [5, 2, 9, 4, 7]
# Y-axis values
y = [10, 5, 8, 4, 2]
# Function to plot
plt.plot(x,y)
There are countless cases where intelligent medical chatbots could help
physicians, nurses, therapists, patients, or their families. They can step
in and minimize the amount of time they spend on tasks like: