Spaces:
Sleeping
Sleeping
Commit
·
655cc9a
1
Parent(s):
31bc1d3
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ def login(username, password):
|
|
| 26 |
return False
|
| 27 |
|
| 28 |
def get_symp(symptoms,investigations,drugs,advices):
|
| 29 |
-
|
| 30 |
data_dict = eval(drugs)
|
| 31 |
print("DType of drugs is ",type(drugs))
|
| 32 |
print("Drugs :",drugs)
|
|
@@ -34,7 +34,7 @@ def get_symp(symptoms,investigations,drugs,advices):
|
|
| 34 |
for cat,med in data_dict.items():
|
| 35 |
|
| 36 |
for i in med:
|
| 37 |
-
|
| 38 |
return (gr.update(choices=eval(symptoms),visible=True,interactive=True)),(gr.update(choices=eval(investigations),visible=True,interactive=True)),(gr.update(choices=all,visible=True,interactive=True)),(gr.update(choices=eval(advices),visible=True,interactive=True))
|
| 39 |
|
| 40 |
|
|
@@ -79,12 +79,7 @@ def save_data(disease,symp_data,invest_data,drug_data,advice_data):
|
|
| 79 |
print("In open csv file",csvfile)
|
| 80 |
csv_writer = csv.writer(csvfile)
|
| 81 |
csv_writer.writerow([disease,symp_data,invest_data,drug_data,advice_data,user])
|
| 82 |
-
print("Done writing!!")
|
| 83 |
-
# raw_data = load_dataset("demo1.csv")
|
| 84 |
-
# print(raw_data)
|
| 85 |
-
# for split, dataset in raw_data.items():
|
| 86 |
-
# dataset.to_csv(f"cdss_v1_annotations.csv",index=None)
|
| 87 |
-
|
| 88 |
except:
|
| 89 |
print("An Exception occured")
|
| 90 |
|
|
|
|
| 26 |
return False
|
| 27 |
|
| 28 |
def get_symp(symptoms,investigations,drugs,advices):
|
| 29 |
+
drug_dict = []
|
| 30 |
data_dict = eval(drugs)
|
| 31 |
print("DType of drugs is ",type(drugs))
|
| 32 |
print("Drugs :",drugs)
|
|
|
|
| 34 |
for cat,med in data_dict.items():
|
| 35 |
|
| 36 |
for i in med:
|
| 37 |
+
drug_dict.append(i)
|
| 38 |
return (gr.update(choices=eval(symptoms),visible=True,interactive=True)),(gr.update(choices=eval(investigations),visible=True,interactive=True)),(gr.update(choices=all,visible=True,interactive=True)),(gr.update(choices=eval(advices),visible=True,interactive=True))
|
| 39 |
|
| 40 |
|
|
|
|
| 79 |
print("In open csv file",csvfile)
|
| 80 |
csv_writer = csv.writer(csvfile)
|
| 81 |
csv_writer.writerow([disease,symp_data,invest_data,drug_data,advice_data,user])
|
| 82 |
+
print("Done writing!!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
except:
|
| 84 |
print("An Exception occured")
|
| 85 |
|