陈俊杰
commited on
Commit
·
f48f907
1
Parent(s):
79291d4
table4
Browse files
app.py
CHANGED
|
@@ -331,7 +331,32 @@ This leaderboard is used to show the performance of the <strong>automatic evalua
|
|
| 331 |
|
| 332 |
with tab4:
|
| 333 |
st.markdown("""<p class='main-text'>Task: Non-Factoid QA; Dataset: NF_CATS</p>""", unsafe_allow_html=True)
|
| 334 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 335 |
elif page == "Organisers":
|
| 336 |
st.header("Organisers")
|
| 337 |
st.markdown("""
|
|
|
|
| 331 |
|
| 332 |
with tab4:
|
| 333 |
st.markdown("""<p class='main-text'>Task: Non-Factoid QA; Dataset: NF_CATS</p>""", unsafe_allow_html=True)
|
| 334 |
+
# 将 DataFrame 转换为 HTML 表格
|
| 335 |
+
html_table = df4.to_html(index=False)
|
| 336 |
+
|
| 337 |
+
# 定义样式并使用 DataTables 使表格具有排序、搜索、放大等功能
|
| 338 |
+
styled_table = f"""
|
| 339 |
+
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css">
|
| 340 |
+
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
|
| 341 |
+
<script src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js"></script>
|
| 342 |
+
<script>
|
| 343 |
+
$(document).ready(function() {{
|
| 344 |
+
$('#dataframe').DataTable();
|
| 345 |
+
}});
|
| 346 |
+
</script>
|
| 347 |
+
<style>
|
| 348 |
+
table {{
|
| 349 |
+
font-size: 16px;
|
| 350 |
+
width: 100%;
|
| 351 |
+
}}
|
| 352 |
+
</style>
|
| 353 |
+
<table id="dataframe" class="display">
|
| 354 |
+
{html_table[html_table.find('<thead>') : ]}
|
| 355 |
+
</table>
|
| 356 |
+
"""
|
| 357 |
+
|
| 358 |
+
# 在 Streamlit 中显示 HTML 表格
|
| 359 |
+
st.write(styled_table, unsafe_allow_html=True)
|
| 360 |
elif page == "Organisers":
|
| 361 |
st.header("Organisers")
|
| 362 |
st.markdown("""
|