shgao commited on
Commit
2cb9bff
·
1 Parent(s): 3622597
Files changed (1) hide show
  1. app.py +16 -16
app.py CHANGED
@@ -189,7 +189,7 @@ criteria_for_comparison = [
189
  {
190
  "label": "Alignment with clinical consensus",
191
  "text": (
192
- "Which response is more consistent with established clinical guidelines and widely accepted practice standards?"
193
  )
194
  },
195
  {
@@ -394,10 +394,10 @@ def calculate_progress_info(progress_state, remaining_count=None):
394
  # Create progress text - show remaining questions if remaining_count is available
395
  if remaining_count_to_use is not None and total_pairs > 0:
396
  num_remaining_questions = remaining_count_to_use // total_pairs
397
- pairwise_progress_text = f"Current Question Evaluation Progress: {num_remaining_questions} question(s) remaining to evaluate"
398
- # pairwise_progress_text = f"Current Question Evaluation Progress: {pairwise_done}/{total_pairs} pairs completed ({num_remaining_questions} question(s) remaining to evaluate)"
399
  else:
400
- pairwise_progress_text = f"Current Question Evaluation Progress: {pairwise_done}/{total_pairs} pairs completed ({pairwise_remaining} remaining)"
401
 
402
  return {
403
  'pairwise_completed': pairwise_done,
@@ -1075,7 +1075,7 @@ def advance_workflow(progress_state, data_subset_state, current_pairwise=None, c
1075
  missing_comparisons.append(criteria_for_comparison[i]['label'])
1076
 
1077
  missing_text = ", ".join(missing_comparisons)
1078
- error_msg = f"Please select an option for the following pairwise comparison(s): {missing_text}"
1079
  gr.Info(error_msg)
1080
  return {
1081
  'progress_state': progress_state,
@@ -1663,13 +1663,13 @@ with gr.Blocks(css=centered_col_css) as demo:
1663
  with gr.Column(visible=True, elem_id="page0") as page0:
1664
  gr.HTML("""
1665
  <div>
1666
- <h1>TxAgent Evaluation Portal</h1>
1667
  </div>
1668
  """)
1669
- gr.Markdown("## Information:")
1670
  name = gr.Textbox(label="Name (required)", value="")
1671
  email = gr.Textbox(
1672
- label="Email (required). Please use the same email every time you log onto this evaluation portal, as we use your email to prevent showing repeat questions.", value="")
1673
  evaluator_id = gr.Textbox(
1674
  label="Evaluator ID (auto-filled from email above)", interactive=False, visible=False)
1675
 
@@ -1684,26 +1684,26 @@ with gr.Blocks(css=centered_col_css) as demo:
1684
  )
1685
 
1686
  specialty_dd = gr.Dropdown(
1687
- choices=specialties_list, label="Primary Medical Specialty (required). Go to https://www.abms.org/member-boards/specialty-subspecialty-certificates/ for categorization)", multiselect=True, value=["None"], visible=False)
1688
  subspecialty_dd = gr.Dropdown(
1689
- choices=subspecialties_list, label="Subspecialty (if applicable). Go to https://www.abms.org/member-boards/specialty-subspecialty-certificates/ for categorization)", multiselect=True, value=["None"], visible=False)
1690
  npi_id = gr.Textbox(
1691
- label="National Provider Identifier ID (optional). Got to https://npiregistry.cms.hhs.gov/search to search for your NPI ID. If you do not have an NPI ID, please leave this blank.")
1692
  years_exp_radio = gr.Radio(
1693
  choices=["0-2 years", "3-5 years", "6-10 years",
1694
  "11-20 years", "20+ years", "Not Applicable"],
1695
- label="How many years have you been involved in clinical and/or research activities related to your biomedical area of expertise? (required)",
1696
  value="Not Applicable",
1697
  visible=False
1698
  )
1699
  exp_explanation_tb = gr.Textbox(
1700
- label="Please briefly explain your expertise/experience relevant to evaluating AI for clinical decision support (optional)")
1701
 
1702
  page0_error_box = gr.Markdown("")
1703
  with gr.Row():
1704
  next_btn_0 = gr.Button("Next")
1705
 
1706
- gr.Markdown("""By clicking 'Next' below, you will start the study, with your progress saved after submitting each question. If you have any other questions or concerns, please contact us directly. Thank you for your participation!
1707
  """)
1708
 
1709
  # gr.Markdown("""
@@ -1849,12 +1849,12 @@ with gr.Blocks(css=centered_col_css) as demo:
1849
  with gr.Row():
1850
  with gr.Column(scale=1):
1851
  rating_a = gr.Radio(choices=sorted(crit_score["scores"]), # ["1", "2", "3", "4", "5", "Unable to Judge"],
1852
- label=f"Response A - {crit_score['text']}",
1853
  interactive=True,
1854
  elem_classes="criteria-radio-score-label")
1855
  with gr.Column(scale=1):
1856
  rating_b = gr.Radio(choices=sorted(crit_score["scores"]), # ["1", "2", "3", "4", "5", "Unable to Judge"],
1857
- label=f"Response B - {crit_score['text']}",
1858
  interactive=True,
1859
  elem_classes="criteria-radio-score-label")
1860
 
 
189
  {
190
  "label": "Alignment with clinical consensus",
191
  "text": (
192
+ "Which response aligns better with clinical guidelines and practice standards?"
193
  )
194
  },
195
  {
 
394
  # Create progress text - show remaining questions if remaining_count is available
395
  if remaining_count_to_use is not None and total_pairs > 0:
396
  num_remaining_questions = remaining_count_to_use // total_pairs
397
+ pairwise_progress_text = f"Current Evaluation Progress: {num_remaining_questions} questions remaining."
398
+ # pairwise_progress_text = f"Current Evaluation Progress: {pairwise_done}/{total_pairs} pairs completed ({num_remaining_questions} question(s) remaining to evaluate)"
399
  else:
400
+ pairwise_progress_text = f"Current Evaluation Progress: {pairwise_done}/{total_pairs} pairs completed ({pairwise_remaining} remaining)"
401
 
402
  return {
403
  'pairwise_completed': pairwise_done,
 
1075
  missing_comparisons.append(criteria_for_comparison[i]['label'])
1076
 
1077
  missing_text = ", ".join(missing_comparisons)
1078
+ error_msg = f"Your response is missing for: {missing_text}"
1079
  gr.Info(error_msg)
1080
  return {
1081
  'progress_state': progress_state,
 
1663
  with gr.Column(visible=True, elem_id="page0") as page0:
1664
  gr.HTML("""
1665
  <div>
1666
+ <h1>TxAgent Portal: AI Agent Evaluation</h1>
1667
  </div>
1668
  """)
1669
+ gr.Markdown("## Sign Up")
1670
  name = gr.Textbox(label="Name (required)", value="")
1671
  email = gr.Textbox(
1672
+ label="Email (required). Use the same email each time you log into the evaluation portal. Your email ensures you will not receive repeat questions.", value="")
1673
  evaluator_id = gr.Textbox(
1674
  label="Evaluator ID (auto-filled from email above)", interactive=False, visible=False)
1675
 
 
1684
  )
1685
 
1686
  specialty_dd = gr.Dropdown(
1687
+ choices=specialties_list, label="Primary Medical Specialty (required). Visit https://www.abms.org/member-boards/specialty-subspecialty-certificates/ for categories.", multiselect=True, value=["None"], visible=False)
1688
  subspecialty_dd = gr.Dropdown(
1689
+ choices=subspecialties_list, label="Subspecialty (if applicable). Visit https://www.abms.org/member-boards/specialty-subspecialty-certificates/ for categories.", multiselect=True, value=["None"], visible=False)
1690
  npi_id = gr.Textbox(
1691
+ label="National Provider Identifier ID (optional). Visit https://npiregistry.cms.hhs.gov/search to find your NPI ID. Leave blank if you do not have an NPI ID.")
1692
  years_exp_radio = gr.Radio(
1693
  choices=["0-2 years", "3-5 years", "6-10 years",
1694
  "11-20 years", "20+ years", "Not Applicable"],
1695
+ label="Years of experience in clinical and/or research activities related to your biomedical expertise (required).",
1696
  value="Not Applicable",
1697
  visible=False
1698
  )
1699
  exp_explanation_tb = gr.Textbox(
1700
+ label="Briefly describe your expertise in AI (optional).")
1701
 
1702
  page0_error_box = gr.Markdown("")
1703
  with gr.Row():
1704
  next_btn_0 = gr.Button("Next")
1705
 
1706
+ gr.Markdown("""Click Next to start the study. Your progress will be saved after you submit each question. For questions or concerns, contact us directly. Thank you for participating!
1707
  """)
1708
 
1709
  # gr.Markdown("""
 
1849
  with gr.Row():
1850
  with gr.Column(scale=1):
1851
  rating_a = gr.Radio(choices=sorted(crit_score["scores"]), # ["1", "2", "3", "4", "5", "Unable to Judge"],
1852
+ label=f"Model A Response - {crit_score['text']}",
1853
  interactive=True,
1854
  elem_classes="criteria-radio-score-label")
1855
  with gr.Column(scale=1):
1856
  rating_b = gr.Radio(choices=sorted(crit_score["scores"]), # ["1", "2", "3", "4", "5", "Unable to Judge"],
1857
+ label=f"Model B Response - {crit_score['text']}",
1858
  interactive=True,
1859
  elem_classes="criteria-radio-score-label")
1860