Update app.py
Browse files
app.py
CHANGED
@@ -78,7 +78,8 @@ def find_matching_diseases(query: SymptomQuery):
|
|
78 |
matching_diseases = df[df['Symptoms'].apply(lambda x: any(s in matching_symptoms for s in x))]
|
79 |
|
80 |
return {"matching_diseases": matching_diseases['Name'].tolist()}
|
81 |
-
|
|
|
82 |
# Endpoint to handle symptom query and return detailed disease list
|
83 |
@app.post("/find_disease_list")
|
84 |
def find_disease_list(query: SymptomQuery):
|
@@ -93,7 +94,7 @@ def find_disease_list(query: SymptomQuery):
|
|
93 |
|
94 |
# Extract matching symptoms
|
95 |
matching_symptoms = results['documents'][0]
|
96 |
-
|
97 |
# Filter diseases that match the symptoms
|
98 |
matching_diseases = df[df['Symptoms'].apply(lambda x: any(s in matching_symptoms for s in x))]
|
99 |
|
|
|
78 |
matching_diseases = df[df['Symptoms'].apply(lambda x: any(s in matching_symptoms for s in x))]
|
79 |
|
80 |
return {"matching_diseases": matching_diseases['Name'].tolist()}
|
81 |
+
all_symptoms=[]
|
82 |
+
all_selected_symptoms=[]
|
83 |
# Endpoint to handle symptom query and return detailed disease list
|
84 |
@app.post("/find_disease_list")
|
85 |
def find_disease_list(query: SymptomQuery):
|
|
|
94 |
|
95 |
# Extract matching symptoms
|
96 |
matching_symptoms = results['documents'][0]
|
97 |
+
all_symptoms.append(matching_symptoms)
|
98 |
# Filter diseases that match the symptoms
|
99 |
matching_diseases = df[df['Symptoms'].apply(lambda x: any(s in matching_symptoms for s in x))]
|
100 |
|