Spaces:
Runtime error
Runtime error
import streamlit as st | |
import pandas as pd | |
import plotly.express as px | |
def get_results(experiment: str): | |
path = { | |
"linear": "data/f1_linear.parquet", | |
"bilstm": "data/f1_bilstm.parquet", | |
"finetuning": "data/f1_finetuning.parquet", | |
}[experiment] | |
df = pd.read_parquet(path) | |
df = (df * 100).astype(int) | |
return df | |
TITLE = "F1 Macro scores" | |
st.set_page_config(page_title=TITLE, page_icon="📈") | |
st.markdown(f"# {TITLE}") | |
st.write( | |
"""TODO: Description""" | |
) | |
df_linear = get_results("linear") | |
df_linear["Experiment"] = "Linear Head" | |
df_bilstm = get_results("bilstm") | |
df_bilstm["Experiment"] = "BiLSTM Head" | |
df_finetuning = get_results("finetuning") | |
df_finetuning["Experiment"] = "Fine-tuning" | |
color_range_low = 40 | |
color_range_high = 75 | |
st.plotly_chart( | |
px.imshow( | |
df_linear, | |
title="Linear Head", | |
labels=dict(x="Language", y="Model", color="F1 Score"), | |
color_continuous_scale="viridis", | |
range_color=[color_range_low, color_range_high], | |
text_auto=True, | |
) | |
) | |
st.plotly_chart( | |
px.imshow( | |
df_bilstm, | |
title="BiLSTM Head", | |
labels=dict(x="Language", y="Model", color="F1 Score"), | |
color_continuous_scale="viridis", | |
range_color=[color_range_low, color_range_high], | |
text_auto=True, | |
) | |
) | |
st.plotly_chart( | |
px.imshow( | |
df_finetuning, | |
title="Fine-tuning", | |
labels=dict(x="Language", y="Model", color="F1 Score"), | |
color_continuous_scale="viridis", | |
range_color=[color_range_low, color_range_high], | |
text_auto=True, | |
) | |
) |