Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates in repo #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
# healthcare-chatbot
a chatbot based on sklearn where you can give a symptom and it will ask you questions and will tell you the details and give some advice.

1.Healthcare chatbot trained on top of this prediction model:
https://www.kaggle.com/datasets/itachi9604/disease-symptom-description-dataset/code
use to predict disease as well as remedies on the basis of below given inputs:
Name:
Age:
Gender:
Symptoms:
Number of Days from which a person is facing symptoms:
This will automatically predict the disease and gives Remedies as well as some common techniques of cure of that disease.
As the dataset increases with time and timely update in contribution leads to increase in accuracy of the chatbot(Medical Chatbot).
24 changes: 18 additions & 6 deletions chat_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
warnings.filterwarnings("ignore", category=DeprecationWarning)


training = pd.read_csv('Data/Training.csv')
testing= pd.read_csv('Data/Testing.csv')
training = pd.read_csv('./Data/Training.csv')
testing= pd.read_csv('./Data/Testing.csv')
cols= training.columns
cols= cols[:-1]
x = training[cols]
Expand Down Expand Up @@ -84,7 +84,7 @@ def calc_condition(exp,days):

def getDescription():
global description_list
with open('MasterData/symptom_Description.csv') as csv_file:
with open('./MasterData/symptom_Description.csv') as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',')
line_count = 0
for row in csv_reader:
Expand All @@ -96,7 +96,7 @@ def getDescription():

def getSeverityDict():
global severityDictionary
with open('MasterData/symptom_severity.csv') as csv_file:
with open('./MasterData/Symptom_severity.csv') as csv_file:

csv_reader = csv.reader(csv_file, delimiter=',')
line_count = 0
Expand All @@ -110,7 +110,7 @@ def getSeverityDict():

def getprecautionDict():
global precautionDictionary
with open('MasterData/symptom_precaution.csv') as csv_file:
with open('./MasterData/symptom_precaution.csv') as csv_file:

csv_reader = csv.reader(csv_file, delimiter=',')
line_count = 0
Expand All @@ -123,6 +123,18 @@ def getInfo():
print("-----------------------------------HealthCare ChatBot-----------------------------------")
print("\nYour Name? \t\t\t\t",end="->")
name=input("")
print("\nYour Age? \t\t\t\t",end="->")
age=int(input(""))
while True:
gender = input("Please enter your gender (male/female/other): ").lower() # Convert input to lowercase for case-insensitivity

if gender in ['male', 'female', 'other']:
break # Exit the loop if the input is valid
else:
print("Invalid input. Please enter 'male', 'female', or 'other'.")

print("Your gender is:",gender)

print("Hello, ",name)

def check_pattern(dis_list,inp):
Expand All @@ -136,7 +148,7 @@ def check_pattern(dis_list,inp):
else:
return 0,[]
def sec_predict(symptoms_exp):
df = pd.read_csv('Data/Training.csv')
df = pd.read_csv('./Data/Training.csv')
X = df.iloc[:, :-1]
y = df['prognosis']
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=20)
Expand Down