File size: 957 Bytes
5ad2e6e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import streamlit as st
from tabs import comparison, leaderboard, about
import pandas as pd

dataframe_path = "darija_tokenizers_leaderboard.jsonl"
try:
    df = pd.read_json(dataframe_path, lines=True)
    assert all(col in df.columns for col in ["Tokenizer", "Vocabulary Size", "Token Count", "Tokens/Character Ratio", "Latin Support", "Tokenizer Class"]), "Invalid columns in leaderboard"
except:
    df = pd.DataFrame(
        columns=[
            "Tokenizer",
            "Vocabulary Size",
            "Token Count",
            "Tokens/Character Ratio",
            "Latin Support",
            "Tokenizer Class"
        ]
    )

def main():
    st.title("Darija Tokenizer Explorer 🧭")

    tab1, tab2, tab3 = st.tabs(["Leaderboard", "Comparison", "About"])

    with tab1:
        leaderboard.leaderboard_tab(df)
    with tab2:
        comparison.comparison_tab(df)
    with tab3:
        about.about_tab()

if __name__ == "__main__":
    main()