diff --git a/README.md b/README.md index 856b9db..0a3303e 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/chat_bot.py b/chat_bot.py index 923364a..0ca083b 100644 --- a/chat_bot.py +++ b/chat_bot.py @@ -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] @@ -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: @@ -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 @@ -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 @@ -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): @@ -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)