|
|
import ast
|
|
|
import glob
|
|
|
import os
|
|
|
|
|
|
import pandas as pd
|
|
|
|
|
|
import streamlit as st
|
|
|
|
|
|
FILE_MAP = {
|
|
|
"Tag Scores": "data/tag_summary_group",
|
|
|
"Context Level Scores": "data/context_summary_group"
|
|
|
}
|
|
|
|
|
|
|
|
|
def format_df(df):
|
|
|
cols = []
|
|
|
for col in df.columns:
|
|
|
if col in ["family", "model", "tag"]:
|
|
|
continue
|
|
|
cols.append(col)
|
|
|
formatted_df = df.style.format({col: "{:.1f}" for col in cols})
|
|
|
return formatted_df
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
st.title("Interface")
|
|
|
selected = st.selectbox("Select a results data:", list(FILE_MAP.keys()))
|
|
|
files = sorted(glob.glob(os.path.join(FILE_MAP[selected], "*.csv")))
|
|
|
for df_file in files:
|
|
|
header_name = os.path.basename(df_file).split(".csv")[0]
|
|
|
st.markdown(f"## {header_name}")
|
|
|
df = format_df(pd.read_csv(df_file))
|
|
|
st.table(df)
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
main()
|
|
|
|