Spaces:
Runtime error
Runtime error
magilogi
commited on
Commit
β’
8599bf2
1
Parent(s):
0b20d0d
robustness test
Browse files
app.py
CHANGED
@@ -58,8 +58,8 @@ df.rename(columns={
|
|
58 |
|
59 |
df['Average Accuracy (Original and G2B)'] = (df['Average G2B Accuracy'] + df['Average Original Accuracy']) / 2
|
60 |
|
61 |
-
df['Adjusted Robustness Score'] = df['Average Accuracy (Original and G2B)'] - 0.25 - df['Average Difference'].abs()
|
62 |
-
df['Adjusted Robustness Score'] = df['Adjusted Robustness Score'].round(2)
|
63 |
|
64 |
|
65 |
|
@@ -73,8 +73,13 @@ df['DrugMatchQA'] = df['DrugMatchQA'].apply(lambda x: None if x == 0 else x)
|
|
73 |
|
74 |
|
75 |
|
|
|
|
|
|
|
|
|
76 |
|
77 |
-
|
|
|
78 |
|
79 |
|
80 |
#Defining functions for filtering and plotting
|
@@ -318,7 +323,7 @@ with gr.Blocks(css="custom.css") as demo:
|
|
318 |
elem_classes="markdown-text"
|
319 |
)
|
320 |
|
321 |
-
|
322 |
|
323 |
with gr.Row():
|
324 |
bar3 = gr.Plot(
|
@@ -326,7 +331,8 @@ with gr.Blocks(css="custom.css") as demo:
|
|
326 |
elem_id="bar3"
|
327 |
)
|
328 |
bar4 = gr.Plot(
|
329 |
-
|
|
|
330 |
elem_id="bar4"
|
331 |
)
|
332 |
|
|
|
58 |
|
59 |
df['Average Accuracy (Original and G2B)'] = (df['Average G2B Accuracy'] + df['Average Original Accuracy']) / 2
|
60 |
|
61 |
+
#df['Adjusted Robustness Score'] = df['Average Accuracy (Original and G2B)'] - 0.25 - df['Average Difference'].abs()
|
62 |
+
#df['Adjusted Robustness Score'] = df['Adjusted Robustness Score'].round(2)
|
63 |
|
64 |
|
65 |
|
|
|
73 |
|
74 |
|
75 |
|
76 |
+
def remove_rows_with_strings(df, column, strings):
|
77 |
+
for string in strings:
|
78 |
+
df = df[~df[column].str.contains(string)]
|
79 |
+
return df
|
80 |
|
81 |
+
models_to_remove = ['microsoft-phi-1', 'microsoft-phi-1_5', 'meta-llama-Llama-2-7b-hf']
|
82 |
+
non_random_df = remove_rows_with_strings(df, 'Model', models_to_remove)
|
83 |
|
84 |
|
85 |
#Defining functions for filtering and plotting
|
|
|
323 |
elem_classes="markdown-text"
|
324 |
)
|
325 |
|
326 |
+
|
327 |
|
328 |
with gr.Row():
|
329 |
bar3 = gr.Plot(
|
|
|
331 |
elem_id="bar3"
|
332 |
)
|
333 |
bar4 = gr.Plot(
|
334 |
+
#remove model in model column
|
335 |
+
value=create_bar_plot_adjusted(non_random_df, "Average Difference", "Which LLMs are most robust to drug name synonym substitution?"),
|
336 |
elem_id="bar4"
|
337 |
)
|
338 |
|