kcelia commited on
Commit
283afce
β€’
1 Parent(s): f45d8a5

chore: another representation for the check box

Browse files
Files changed (2) hide show
  1. app.py +26 -28
  2. 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
- "## Provide at least 5 chief complaints by filling in the boxes below. "
561
  )
 
 
562
 
563
  # Box symptoms
564
  check_boxes = []
565
- for i, category in enumerate(SYMPTOMS_LIST):
566
- with gr.Accordion(
567
- pretty_print(category.keys()),
568
- open=False,
569
- elem_classes="feedback",
570
- ) as accordion:
571
- check_box = gr.CheckboxGroup(
572
- pretty_print(category.values()),
573
- show_label=False,
574
- )
575
- check_boxes.append(check_box)
 
 
 
 
 
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
- "## You can choose an **existing disease** and explore its associated symptoms."
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("Confirm Symptoms πŸ‘†")
610
  with gr.Column():
611
- next_tab = gr.Button("Next Step πŸ‘‰")
612
- next_tab.click(lambda _: gr.Tabs.update(selected=1), None, tabs)
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("## Key Generation")
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
- SKIN_SYMPTOMS,
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
  ]