JuStRank / app.py
per's picture
Update app.py
70fab96 verified
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: The Best Judges for Ranking Systems πŸ§‘πŸ»β€βš–οΈ")
url = "https://arxiv.org/pdf/2412.09569"
st.subheader("Check out our [Arxiv submission](%s) for more details" % url)
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)