JuStRank / app.py
arielgera's picture
emoji
eb03344
raw
history blame
1.32 kB
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)