Spaces:
Sleeping
Sleeping
update
Browse files
app.py
CHANGED
@@ -189,7 +189,7 @@ criteria_for_comparison = [
|
|
189 |
{
|
190 |
"label": "Alignment with clinical consensus",
|
191 |
"text": (
|
192 |
-
"Which response
|
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
|
398 |
-
# pairwise_progress_text = f"Current
|
399 |
else:
|
400 |
-
pairwise_progress_text = f"Current
|
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"
|
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
|
1667 |
</div>
|
1668 |
""")
|
1669 |
-
gr.Markdown("##
|
1670 |
name = gr.Textbox(label="Name (required)", value="")
|
1671 |
email = gr.Textbox(
|
1672 |
-
label="Email (required).
|
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).
|
1688 |
subspecialty_dd = gr.Dropdown(
|
1689 |
-
choices=subspecialties_list, label="Subspecialty (if applicable).
|
1690 |
npi_id = gr.Textbox(
|
1691 |
-
label="National Provider Identifier ID (optional).
|
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="
|
1696 |
value="Not Applicable",
|
1697 |
visible=False
|
1698 |
)
|
1699 |
exp_explanation_tb = gr.Textbox(
|
1700 |
-
label="
|
1701 |
|
1702 |
page0_error_box = gr.Markdown("")
|
1703 |
with gr.Row():
|
1704 |
next_btn_0 = gr.Button("Next")
|
1705 |
|
1706 |
-
gr.Markdown("""
|
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"
|
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"
|
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 |
|