chore: another representation for the check box
Browse files- app.py +26 -28
- symptoms_categories.py +7 -4
app.py
CHANGED
@@ -540,7 +540,6 @@ if __name__ == "__main__":
|
|
540 |
</p>
|
541 |
"""
|
542 |
)
|
543 |
-
|
544 |
gr.Markdown("## Notes")
|
545 |
gr.Markdown(
|
546 |
"""
|
@@ -548,39 +547,42 @@ if __name__ == "__main__":
|
|
548 |
- The evaluation key is a public key that the server needs to process encrypted data.
|
549 |
"""
|
550 |
)
|
551 |
-
|
552 |
gr.Markdown(
|
553 |
"Disclaimer: this demo is not to be used as a substitute for medical advice, diagnosis or treatment of any health condition. Any questions regarding your own health should be addressed to your physician or other healthcare provider."
|
554 |
)
|
555 |
|
556 |
with gr.Tabs(eelem_id="them") as tabs:
|
557 |
with gr.TabItem("1. Chief Complaints", id=0):
|
558 |
-
gr.Markdown("<span style='color:grey'>Client Side</span>")
|
559 |
gr.Markdown(
|
560 |
-
"##
|
561 |
)
|
|
|
|
|
562 |
|
563 |
# Box symptoms
|
564 |
check_boxes = []
|
565 |
-
|
566 |
-
with gr.
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
|
|
|
|
|
|
|
|
|
|
576 |
|
577 |
error_box1 = gr.Textbox(label="Error β", visible=False)
|
578 |
|
579 |
-
# <!> This part has been paused due to UI issues.
|
580 |
-
|
581 |
# Default disease, picked from the dataframe
|
582 |
gr.Markdown(
|
583 |
-
"
|
584 |
)
|
585 |
|
586 |
with gr.Row():
|
@@ -599,24 +601,20 @@ if __name__ == "__main__":
|
|
599 |
"#### Submit your chief complaints by clicking on **Confirm Symptoms π** then go to the **Next Step π**"
|
600 |
)
|
601 |
|
602 |
-
user_vect_box1 = gr.Textbox(
|
603 |
-
visible=False,
|
604 |
-
)
|
605 |
|
606 |
with gr.Row():
|
607 |
with gr.Column():
|
608 |
# Submit botton
|
609 |
-
submit_button = gr.Button("
|
610 |
with gr.Column():
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
# Clear botton
|
615 |
-
clear_button = gr.Button("Reset Space π")
|
616 |
|
617 |
with gr.TabItem("2. Data Encryption", id=1):
|
|
|
618 |
gr.Markdown("<span style='color:grey'>Client Side</span>")
|
619 |
-
gr.Markdown("
|
620 |
gr.Markdown(
|
621 |
"In FHE schemes, a secret (enc/dec)ryption keys are generated for encrypting and decrypting data owned by the client. \n\n"
|
622 |
"Additionally, a public evaluation key is generated, enabling external entities to perform homomorphic operations on encrypted data, without the need to decrypt them. \n\n"
|
|
|
540 |
</p>
|
541 |
"""
|
542 |
)
|
|
|
543 |
gr.Markdown("## Notes")
|
544 |
gr.Markdown(
|
545 |
"""
|
|
|
547 |
- The evaluation key is a public key that the server needs to process encrypted data.
|
548 |
"""
|
549 |
)
|
|
|
550 |
gr.Markdown(
|
551 |
"Disclaimer: this demo is not to be used as a substitute for medical advice, diagnosis or treatment of any health condition. Any questions regarding your own health should be addressed to your physician or other healthcare provider."
|
552 |
)
|
553 |
|
554 |
with gr.Tabs(eelem_id="them") as tabs:
|
555 |
with gr.TabItem("1. Chief Complaints", id=0):
|
|
|
556 |
gr.Markdown(
|
557 |
+
"## Step 1: Select chief complaints"
|
558 |
)
|
559 |
+
gr.Markdown("<span style='color:grey'>Client Side</span>")
|
560 |
+
gr.Markdown("Select at least 5 symptoms from the list below.")
|
561 |
|
562 |
# Box symptoms
|
563 |
check_boxes = []
|
564 |
+
with gr.Row():
|
565 |
+
with gr.Column():
|
566 |
+
for category in SYMPTOMS_LIST[:3]:
|
567 |
+
with gr.Accordion(pretty_print(category.keys()), open=False):
|
568 |
+
check_box = gr.CheckboxGroup( pretty_print(category.values()), show_label=False)
|
569 |
+
check_boxes.append(check_box)
|
570 |
+
with gr.Column():
|
571 |
+
for category in SYMPTOMS_LIST[3:6]:
|
572 |
+
with gr.Accordion(pretty_print(category.keys()), open=False):
|
573 |
+
check_box = gr.CheckboxGroup( pretty_print(category.values()), show_label=False)
|
574 |
+
check_boxes.append(check_box)
|
575 |
+
with gr.Column():
|
576 |
+
for category in SYMPTOMS_LIST[6:]:
|
577 |
+
with gr.Accordion(pretty_print(category.keys()), open=False):
|
578 |
+
check_box = gr.CheckboxGroup( pretty_print(category.values()), show_label=False)
|
579 |
+
check_boxes.append(check_box)
|
580 |
|
581 |
error_box1 = gr.Textbox(label="Error β", visible=False)
|
582 |
|
|
|
|
|
583 |
# Default disease, picked from the dataframe
|
584 |
gr.Markdown(
|
585 |
+
"You can choose an **existing disease** and explore its associated symptoms."
|
586 |
)
|
587 |
|
588 |
with gr.Row():
|
|
|
601 |
"#### Submit your chief complaints by clicking on **Confirm Symptoms π** then go to the **Next Step π**"
|
602 |
)
|
603 |
|
604 |
+
user_vect_box1 = gr.Textbox(visible=False)
|
|
|
|
|
605 |
|
606 |
with gr.Row():
|
607 |
with gr.Column():
|
608 |
# Submit botton
|
609 |
+
submit_button = gr.Button("Submit Symptoms π")
|
610 |
with gr.Column():
|
611 |
+
# Clear botton
|
612 |
+
clear_button = gr.Button("Reset Space π")
|
|
|
|
|
|
|
613 |
|
614 |
with gr.TabItem("2. Data Encryption", id=1):
|
615 |
+
gr.Markdown("## Step 2: Encrypt data")
|
616 |
gr.Markdown("<span style='color:grey'>Client Side</span>")
|
617 |
+
gr.Markdown("### Key Generation")
|
618 |
gr.Markdown(
|
619 |
"In FHE schemes, a secret (enc/dec)ryption keys are generated for encrypting and decrypting data owned by the client. \n\n"
|
620 |
"Additionally, a public evaluation key is generated, enabling external entities to perform homomorphic operations on encrypted data, without the need to decrypt them. \n\n"
|
symptoms_categories.py
CHANGED
@@ -182,13 +182,16 @@ GENERAL_SYMPTOMS = {
|
|
182 |
}
|
183 |
|
184 |
SYMPTOMS_LIST = [
|
185 |
-
|
186 |
-
EYES_SYMPTOMS,
|
187 |
-
ORL_SYMPTOMS,
|
188 |
-
THORAX_SYMPTOMS,
|
189 |
DIGESTIVE_SYSTEM_SYMPTOMS,
|
190 |
UROLOGICAL_SYMPTOMS,
|
191 |
VASCULAR_LYMPHATIC_SYMPTOMS,
|
|
|
|
|
|
|
192 |
MUSCULOSKELETAL_SYMPTOMS,
|
|
|
|
|
|
|
193 |
GENERAL_SYMPTOMS,
|
194 |
]
|
|
|
182 |
}
|
183 |
|
184 |
SYMPTOMS_LIST = [
|
185 |
+
# Column 1
|
|
|
|
|
|
|
186 |
DIGESTIVE_SYSTEM_SYMPTOMS,
|
187 |
UROLOGICAL_SYMPTOMS,
|
188 |
VASCULAR_LYMPHATIC_SYMPTOMS,
|
189 |
+
# Column 2
|
190 |
+
ORL_SYMPTOMS,
|
191 |
+
SKIN_SYMPTOMS,
|
192 |
MUSCULOSKELETAL_SYMPTOMS,
|
193 |
+
# Column 3
|
194 |
+
EYES_SYMPTOMS,
|
195 |
+
THORAX_SYMPTOMS,
|
196 |
GENERAL_SYMPTOMS,
|
197 |
]
|