File size: 1,321 Bytes
09f141d 9b2d9e3 eb03344 9b2d9e3 eb03344 9b2d9e3 170b68e 9b2d9e3 170b68e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
import pandas as pd
import streamlit as st
st.set_page_config(
page_title="JuStRank",
page_icon="οΈπ§π»ββοΈ",
layout="wide",
initial_sidebar_state="auto",
menu_items=None,
)
st.title("JuStRank")
st.subheader("π§π»ββοΈ The Best Judges for Ranking Candidate Systems π§π»ββοΈ")
def prettify_judge_name(judge_name):
pretty_judge = (judge_name[0].upper()+judge_name[1:]).replace("Gpt", "GPT")
return pretty_judge
def format_digits(flt, num_digits=3):
format_str = "{:."+str(num_digits-1)+"f}"
format_str_zeroes = "{:."+str(num_digits)+"f}"
return format_str_zeroes.format(flt)[1:] if (0 < flt < 1) else format_str.format(flt)
df = pd.read_csv("./best_judges_single_agg.csv")[["Judge Model", "Realization", "Ranking Agreement", "Decisiveness", "Bias"]]
df["Judge Model"] = df["Judge Model"].apply(prettify_judge_name)
styled_data = (
df.style.background_gradient(subset=["Ranking Agreement"])
.background_gradient(
subset=["Ranking Agreement"],
cmap="RdYlGn",
vmin=0.5,
vmax=0.9,
)
.format(subset=["Ranking Agreement", "Decisiveness", "Bias"], formatter=format_digits)
.set_properties(**{"text-align": "center"})
)
st.dataframe(styled_data, use_container_width=True, height=800, hide_index=True)
|