Spaces:
Sleeping
Sleeping
Commit
·
033550b
1
Parent(s):
bf350d1
Update app.py
Browse files
app.py
CHANGED
@@ -216,11 +216,11 @@ with tab1:
|
|
216 |
""", unsafe_allow_html=True)
|
217 |
|
218 |
# Dropdown menu to filter tiers
|
219 |
-
tiers = ['All
|
220 |
-
selected_tier = st.selectbox('Select
|
221 |
|
222 |
# Filter the data based on the selected tier
|
223 |
-
if selected_tier != 'All
|
224 |
filtered_df = df[df['tier'] == selected_tier]
|
225 |
else:
|
226 |
filtered_df = df
|
@@ -230,7 +230,7 @@ with tab1:
|
|
230 |
# Sort the dataframe based on Factuality Score if the checkbox is selected
|
231 |
if sort_by_factuality:
|
232 |
updated_filtered_df = filtered_df.sort_values(
|
233 |
-
by=['tier', '
|
234 |
)
|
235 |
else:
|
236 |
updated_filtered_df = filtered_df.sort_values(
|
@@ -243,15 +243,12 @@ with tab1:
|
|
243 |
<table>
|
244 |
<thead>
|
245 |
<tr>
|
246 |
-
<th>
|
247 |
<th>Rank</th>
|
248 |
<th>Model</th>
|
249 |
-
<th
|
250 |
-
<th
|
251 |
-
<th>
|
252 |
-
<th>Avg. # Units</th>
|
253 |
-
<th>Avg. # Undecidable</th>
|
254 |
-
<th>Avg. # Unsupported</th>
|
255 |
</tr>
|
256 |
</thead>
|
257 |
<tbody>
|
@@ -263,12 +260,9 @@ with tab1:
|
|
263 |
<tr>
|
264 |
<th>Rank</th>
|
265 |
<th>Model</th>
|
266 |
-
<th
|
267 |
-
<th
|
268 |
-
<th>
|
269 |
-
<th>Avg. # Units</th>
|
270 |
-
<th>Avg. # Undecidable</th>
|
271 |
-
<th>Avg. # Unsupported</th>
|
272 |
</tr>
|
273 |
</thead>
|
274 |
<tbody>
|
@@ -280,21 +274,18 @@ with tab1:
|
|
280 |
html += '<tr>'
|
281 |
|
282 |
# Only display the 'Tier' column if 'All Tiers' is selected
|
283 |
-
if selected_tier == 'All
|
284 |
if row['tier'] != current_tier:
|
285 |
current_tier = row['tier']
|
286 |
-
html += f'<td rowspan="
|
287 |
|
288 |
# Fill in model and scores
|
289 |
html += f'''
|
290 |
<td>{row['rank']}</td>
|
291 |
<td>{row['model']}</td>
|
292 |
-
<td>{row['
|
293 |
-
<td>{row['
|
294 |
-
<td>{row['
|
295 |
-
<td>{row['avg_factual_units']}</td>
|
296 |
-
<td>{row['avg_undecidable_units']:.2f}</td>
|
297 |
-
<td>{row['avg_unsupported_units']:.2f}</td>
|
298 |
</tr>
|
299 |
'''
|
300 |
|
|
|
216 |
""", unsafe_allow_html=True)
|
217 |
|
218 |
# Dropdown menu to filter tiers
|
219 |
+
tiers = ['All Metrics', 'Precision', 'Recall', 'F1']
|
220 |
+
selected_tier = st.selectbox('Select metric:', tiers)
|
221 |
|
222 |
# Filter the data based on the selected tier
|
223 |
+
if selected_tier != 'All Metrics':
|
224 |
filtered_df = df[df['tier'] == selected_tier]
|
225 |
else:
|
226 |
filtered_df = df
|
|
|
230 |
# Sort the dataframe based on Factuality Score if the checkbox is selected
|
231 |
if sort_by_factuality:
|
232 |
updated_filtered_df = filtered_df.sort_values(
|
233 |
+
by=['tier', 'Overall'], ascending=[True, False]
|
234 |
)
|
235 |
else:
|
236 |
updated_filtered_df = filtered_df.sort_values(
|
|
|
243 |
<table>
|
244 |
<thead>
|
245 |
<tr>
|
246 |
+
<th>Metric</th>
|
247 |
<th>Rank</th>
|
248 |
<th>Model</th>
|
249 |
+
<th>Factbench</th>
|
250 |
+
<th>Reddit</th>
|
251 |
+
<th>Overall</th>
|
|
|
|
|
|
|
252 |
</tr>
|
253 |
</thead>
|
254 |
<tbody>
|
|
|
260 |
<tr>
|
261 |
<th>Rank</th>
|
262 |
<th>Model</th>
|
263 |
+
<th>Factbench</th>
|
264 |
+
<th>Reddit</th>
|
265 |
+
<th>Overall</th>
|
|
|
|
|
|
|
266 |
</tr>
|
267 |
</thead>
|
268 |
<tbody>
|
|
|
274 |
html += '<tr>'
|
275 |
|
276 |
# Only display the 'Tier' column if 'All Tiers' is selected
|
277 |
+
if selected_tier == 'All Metrics':
|
278 |
if row['tier'] != current_tier:
|
279 |
current_tier = row['tier']
|
280 |
+
html += f'<td rowspan="8" style="vertical-align: middle;">{current_tier}</td>'
|
281 |
|
282 |
# Fill in model and scores
|
283 |
html += f'''
|
284 |
<td>{row['rank']}</td>
|
285 |
<td>{row['model']}</td>
|
286 |
+
<td>{row['FactBench']}</td>
|
287 |
+
<td>{row['Reddit']}</td>
|
288 |
+
<td>{row['Overall']}</td>
|
|
|
|
|
|
|
289 |
</tr>
|
290 |
'''
|
291 |
|