Spaces:
Runtime error
Runtime error
Szymon Woźniak
commited on
Commit
·
82faf22
1
Parent(s):
107d349
move results to main page
Browse files- MMS_Benchmark.py +64 -6
- pages/{2_Language_Statistics.py → 1_Language_Statistics.py} +0 -0
- pages/1_Results.py +0 -70
- pages/{3_Dataset_Statistics.py → 2_Dataset_Statistics.py} +0 -0
- pages/{4_Language_Typology.py → 3_Language_Typology.py} +0 -0
- pages/{5_Domain_Transfer.py → 4_Domain_Transfer.py} +0 -0
MMS_Benchmark.py
CHANGED
@@ -1,12 +1,70 @@
|
|
1 |
import streamlit as st
|
2 |
import pandas as pd
|
|
|
3 |
|
4 |
-
st.set_page_config(
|
5 |
-
page_title="Hello",
|
6 |
-
page_icon="👋",
|
7 |
-
)
|
8 |
|
9 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
st.write(
|
11 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
)
|
|
|
1 |
import streamlit as st
|
2 |
import pandas as pd
|
3 |
+
import plotly.express as px
|
4 |
|
|
|
|
|
|
|
|
|
5 |
|
6 |
+
@st.cache_data
|
7 |
+
def get_results(experiment: str):
|
8 |
+
path = {
|
9 |
+
"linear": "data/f1_linear.parquet",
|
10 |
+
"bilstm": "data/f1_bilstm.parquet",
|
11 |
+
"finetuning": "data/f1_finetuning.parquet",
|
12 |
+
}[experiment]
|
13 |
+
|
14 |
+
df = pd.read_parquet(path)
|
15 |
+
df = (df * 100).astype(int)
|
16 |
+
return df
|
17 |
+
|
18 |
+
TITLE = "F1 Macro scores"
|
19 |
+
|
20 |
+
st.set_page_config(page_title=TITLE, page_icon="📈")
|
21 |
+
|
22 |
+
st.markdown(f"# {TITLE}")
|
23 |
st.write(
|
24 |
+
"""TODO: Description"""
|
25 |
+
)
|
26 |
+
|
27 |
+
df_linear = get_results("linear")
|
28 |
+
df_linear["Experiment"] = "Linear Head"
|
29 |
+
df_bilstm = get_results("bilstm")
|
30 |
+
df_bilstm["Experiment"] = "BiLSTM Head"
|
31 |
+
df_finetuning = get_results("finetuning")
|
32 |
+
df_finetuning["Experiment"] = "Fine-tuning"
|
33 |
+
|
34 |
+
color_range_low = 40
|
35 |
+
color_range_high = 75
|
36 |
+
|
37 |
+
st.plotly_chart(
|
38 |
+
px.imshow(
|
39 |
+
df_linear,
|
40 |
+
title="Linear Head",
|
41 |
+
labels=dict(x="Language", y="Model", color="F1 Score"),
|
42 |
+
color_continuous_scale="viridis",
|
43 |
+
range_color=[color_range_low, color_range_high],
|
44 |
+
text_auto=True,
|
45 |
+
)
|
46 |
+
)
|
47 |
+
|
48 |
+
|
49 |
+
|
50 |
+
st.plotly_chart(
|
51 |
+
px.imshow(
|
52 |
+
df_bilstm,
|
53 |
+
title="BiLSTM Head",
|
54 |
+
labels=dict(x="Language", y="Model", color="F1 Score"),
|
55 |
+
color_continuous_scale="viridis",
|
56 |
+
range_color=[color_range_low, color_range_high],
|
57 |
+
text_auto=True,
|
58 |
+
)
|
59 |
+
)
|
60 |
+
|
61 |
+
st.plotly_chart(
|
62 |
+
px.imshow(
|
63 |
+
df_finetuning,
|
64 |
+
title="Fine-tuning",
|
65 |
+
labels=dict(x="Language", y="Model", color="F1 Score"),
|
66 |
+
color_continuous_scale="viridis",
|
67 |
+
range_color=[color_range_low, color_range_high],
|
68 |
+
text_auto=True,
|
69 |
+
)
|
70 |
)
|
pages/{2_Language_Statistics.py → 1_Language_Statistics.py}
RENAMED
File without changes
|
pages/1_Results.py
DELETED
@@ -1,70 +0,0 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
import pandas as pd
|
3 |
-
import plotly.express as px
|
4 |
-
|
5 |
-
|
6 |
-
@st.cache_data
|
7 |
-
def get_results(experiment: str):
|
8 |
-
path = {
|
9 |
-
"linear": "data/f1_linear.parquet",
|
10 |
-
"bilstm": "data/f1_bilstm.parquet",
|
11 |
-
"finetuning": "data/f1_finetuning.parquet",
|
12 |
-
}[experiment]
|
13 |
-
|
14 |
-
df = pd.read_parquet(path)
|
15 |
-
df = (df * 100).astype(int)
|
16 |
-
return df
|
17 |
-
|
18 |
-
TITLE = "F1 Macro scores"
|
19 |
-
|
20 |
-
st.set_page_config(page_title=TITLE, page_icon="📈")
|
21 |
-
|
22 |
-
st.markdown(f"# {TITLE}")
|
23 |
-
st.write(
|
24 |
-
"""TODO: Description"""
|
25 |
-
)
|
26 |
-
|
27 |
-
df_linear = get_results("linear")
|
28 |
-
df_linear["Experiment"] = "Linear Head"
|
29 |
-
df_bilstm = get_results("bilstm")
|
30 |
-
df_bilstm["Experiment"] = "BiLSTM Head"
|
31 |
-
df_finetuning = get_results("finetuning")
|
32 |
-
df_finetuning["Experiment"] = "Fine-tuning"
|
33 |
-
|
34 |
-
color_range_low = 40
|
35 |
-
color_range_high = 75
|
36 |
-
|
37 |
-
st.plotly_chart(
|
38 |
-
px.imshow(
|
39 |
-
df_linear,
|
40 |
-
title="Linear Head",
|
41 |
-
labels=dict(x="Language", y="Model", color="F1 Score"),
|
42 |
-
color_continuous_scale="viridis",
|
43 |
-
range_color=[color_range_low, color_range_high],
|
44 |
-
text_auto=True,
|
45 |
-
)
|
46 |
-
)
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
st.plotly_chart(
|
51 |
-
px.imshow(
|
52 |
-
df_bilstm,
|
53 |
-
title="BiLSTM Head",
|
54 |
-
labels=dict(x="Language", y="Model", color="F1 Score"),
|
55 |
-
color_continuous_scale="viridis",
|
56 |
-
range_color=[color_range_low, color_range_high],
|
57 |
-
text_auto=True,
|
58 |
-
)
|
59 |
-
)
|
60 |
-
|
61 |
-
st.plotly_chart(
|
62 |
-
px.imshow(
|
63 |
-
df_finetuning,
|
64 |
-
title="Fine-tuning",
|
65 |
-
labels=dict(x="Language", y="Model", color="F1 Score"),
|
66 |
-
color_continuous_scale="viridis",
|
67 |
-
range_color=[color_range_low, color_range_high],
|
68 |
-
text_auto=True,
|
69 |
-
)
|
70 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pages/{3_Dataset_Statistics.py → 2_Dataset_Statistics.py}
RENAMED
File without changes
|
pages/{4_Language_Typology.py → 3_Language_Typology.py}
RENAMED
File without changes
|
pages/{5_Domain_Transfer.py → 4_Domain_Transfer.py}
RENAMED
File without changes
|