magilogi
commited on
Commit
Β·
7918cff
1
Parent(s):
be36629
layout update
Browse files
app.py
CHANGED
|
@@ -65,17 +65,22 @@ def create_scatter_plot(df, x_col, y_col, title, x_title, y_title):
|
|
| 65 |
fig.update_traces(marker=dict(size=10), selector=dict(mode='markers'))
|
| 66 |
return fig
|
| 67 |
|
| 68 |
-
|
| 69 |
def create_bar_plot(df, col, title):
|
| 70 |
sorted_df = df.sort_values(by=col, ascending=True)
|
| 71 |
-
fig = px.bar(sorted_df,
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
return fig
|
| 74 |
|
| 75 |
with gr.Blocks(css="custom.css") as demo:
|
| 76 |
with gr.Column():
|
| 77 |
gr.Markdown(
|
| 78 |
-
"""<div style="text-align: center;"><h1> <span style='color: #E6B800;'>π° RABBITS</span
|
| 79 |
<span style='color: #E6B800;'>T</span>erm <span style='color: #E6B800;'>S</span>ubstitutions for Language Models <span style='color: #E6B800;'></span></h1></div>"""
|
| 80 |
)
|
| 81 |
with gr.Row():
|
|
@@ -95,6 +100,16 @@ with gr.Blocks(css="custom.css") as demo:
|
|
| 95 |
with gr.Row():
|
| 96 |
gr.Markdown(""" """)
|
| 97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
with gr.Row():
|
| 99 |
gr.Dataframe(
|
| 100 |
value=explanation_df,
|
|
@@ -211,15 +226,9 @@ with gr.Blocks(css="custom.css") as demo:
|
|
| 211 |
</div>""",
|
| 212 |
elem_classes="markdown-text"
|
| 213 |
)
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
elem_id="bar1"
|
| 218 |
-
)
|
| 219 |
-
bar2 = gr.Plot(
|
| 220 |
-
value=create_bar_plot(df, "medqa_diff", "Impact of G2B swap on MedQA Accuracy"),
|
| 221 |
-
elem_id="bar2"
|
| 222 |
-
)
|
| 223 |
|
| 224 |
if __name__ == "__main__":
|
| 225 |
demo.launch()
|
|
|
|
| 65 |
fig.update_traces(marker=dict(size=10), selector=dict(mode='markers'))
|
| 66 |
return fig
|
| 67 |
|
|
|
|
| 68 |
def create_bar_plot(df, col, title):
|
| 69 |
sorted_df = df.sort_values(by=col, ascending=True)
|
| 70 |
+
fig = px.bar(sorted_df,
|
| 71 |
+
x=col,
|
| 72 |
+
y='Model',
|
| 73 |
+
orientation='h',
|
| 74 |
+
title=title,
|
| 75 |
+
color=col,
|
| 76 |
+
color_continuous_scale='solar')
|
| 77 |
+
fig.update_layout(xaxis_title=col, yaxis_title='Model', height=600, coloraxis_showscale=False)
|
| 78 |
return fig
|
| 79 |
|
| 80 |
with gr.Blocks(css="custom.css") as demo:
|
| 81 |
with gr.Column():
|
| 82 |
gr.Markdown(
|
| 83 |
+
"""<div style="text-align: center;"><h1> <span style='color: #E6B800;'>π° RABBITS</span>: <span style='color: #E6B800;'>R</span>obust <span style='color: #E6B800;'>A</span>ssessment of <span style='color: #E6B800;'>B</span>iomedical <span style='color: #E6B800;'>B</span>enchmarks <span style='color: #E6B800;'>I</span>nvolving drug
|
| 84 |
<span style='color: #E6B800;'>T</span>erm <span style='color: #E6B800;'>S</span>ubstitutions for Language Models <span style='color: #E6B800;'></span></h1></div>"""
|
| 85 |
)
|
| 86 |
with gr.Row():
|
|
|
|
| 100 |
with gr.Row():
|
| 101 |
gr.Markdown(""" """)
|
| 102 |
|
| 103 |
+
with gr.Row():
|
| 104 |
+
bar1 = gr.Plot(
|
| 105 |
+
value=create_bar_plot(df, "medmcqa_diff", "Impact of Generic2Brand swap on MedMCQA Accuracy"),
|
| 106 |
+
elem_id="bar1"
|
| 107 |
+
)
|
| 108 |
+
bar2 = gr.Plot(
|
| 109 |
+
value=create_bar_plot(df, "medqa_diff", "Impact of Generic2Brand swap on MedQA Accuracy"),
|
| 110 |
+
elem_id="bar2"
|
| 111 |
+
)
|
| 112 |
+
|
| 113 |
with gr.Row():
|
| 114 |
gr.Dataframe(
|
| 115 |
value=explanation_df,
|
|
|
|
| 226 |
</div>""",
|
| 227 |
elem_classes="markdown-text"
|
| 228 |
)
|
| 229 |
+
|
| 230 |
+
|
| 231 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 232 |
|
| 233 |
if __name__ == "__main__":
|
| 234 |
demo.launch()
|