Commit
·
95043cb
1
Parent(s):
f2ce4b7
Add
Browse files- app.py +7 -1
- style.css +13 -4
- tabs/data_viz_tab.py +1 -1
app.py
CHANGED
|
@@ -6,6 +6,8 @@ from streamlit_option_menu import option_menu
|
|
| 6 |
import config
|
| 7 |
from tabs.custom_vectorizer import custom_tokenizer, custom_preprocessor
|
| 8 |
|
|
|
|
|
|
|
| 9 |
# Initialize a session state variable that tracks the sidebar state (either 'expanded' or 'collapsed').
|
| 10 |
if 'sidebar_state' not in st.session_state:
|
| 11 |
st.session_state.sidebar_state = 'expanded'
|
|
@@ -23,6 +25,9 @@ thisfile = os.path.abspath(__file__)
|
|
| 23 |
if ('/' in thisfile):
|
| 24 |
os.chdir(os.path.dirname(thisfile))
|
| 25 |
|
|
|
|
|
|
|
|
|
|
| 26 |
# Tabs in the ./tabs folder, imported here.
|
| 27 |
from tabs import intro, exploration_tab, data_viz_tab, id_lang_tab, modelisation_dict_tab, modelisation_seq2seq_tab, game_tab
|
| 28 |
|
|
@@ -50,7 +55,8 @@ TABS = OrderedDict(
|
|
| 50 |
|
| 51 |
|
| 52 |
def run():
|
| 53 |
-
|
|
|
|
| 54 |
st.sidebar.image(
|
| 55 |
"assets/demosthene_logo.png",
|
| 56 |
width=270,
|
|
|
|
| 6 |
import config
|
| 7 |
from tabs.custom_vectorizer import custom_tokenizer, custom_preprocessor
|
| 8 |
|
| 9 |
+
|
| 10 |
+
|
| 11 |
# Initialize a session state variable that tracks the sidebar state (either 'expanded' or 'collapsed').
|
| 12 |
if 'sidebar_state' not in st.session_state:
|
| 13 |
st.session_state.sidebar_state = 'expanded'
|
|
|
|
| 25 |
if ('/' in thisfile):
|
| 26 |
os.chdir(os.path.dirname(thisfile))
|
| 27 |
|
| 28 |
+
# Nécessaire pour la version windows 11
|
| 29 |
+
os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'python'
|
| 30 |
+
|
| 31 |
# Tabs in the ./tabs folder, imported here.
|
| 32 |
from tabs import intro, exploration_tab, data_viz_tab, id_lang_tab, modelisation_dict_tab, modelisation_seq2seq_tab, game_tab
|
| 33 |
|
|
|
|
| 55 |
|
| 56 |
|
| 57 |
def run():
|
| 58 |
+
global lang_tgt, label_lang
|
| 59 |
+
|
| 60 |
st.sidebar.image(
|
| 61 |
"assets/demosthene_logo.png",
|
| 62 |
width=270,
|
style.css
CHANGED
|
@@ -11,15 +11,15 @@ h2 {
|
|
| 11 |
/* La ligne suivante est nécessaire à cause du module streamlit_option_menu qui "casse" les CSS suivants */
|
| 12 |
@media (prefers-color-scheme: dark) {
|
| 13 |
.st-cc {
|
| 14 |
-
|
| 15 |
}
|
| 16 |
-
.st-cg:hover {
|
| 17 |
-
|
| 18 |
}
|
| 19 |
}
|
| 20 |
|
| 21 |
p {
|
| 22 |
-
|
| 23 |
}
|
| 24 |
|
| 25 |
code {
|
|
@@ -91,6 +91,15 @@ section[data-testid="stSidebar"] h2 {
|
|
| 91 |
color: white;
|
| 92 |
}
|
| 93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
/* Images */
|
| 95 |
|
| 96 |
button[title="View fullscreen"] {
|
|
|
|
| 11 |
/* La ligne suivante est nécessaire à cause du module streamlit_option_menu qui "casse" les CSS suivants */
|
| 12 |
@media (prefers-color-scheme: dark) {
|
| 13 |
.st-cc {
|
| 14 |
+
color: #fff!important; /* Couleur du texte en mode sombre */
|
| 15 |
}
|
| 16 |
+
.st-cg:hover {
|
| 17 |
+
color: rgb(255, 75, 75)!important; /* Couleur du texte en mode sombre */
|
| 18 |
}
|
| 19 |
}
|
| 20 |
|
| 21 |
p {
|
| 22 |
+
margin-bottom:0.1rem;
|
| 23 |
}
|
| 24 |
|
| 25 |
code {
|
|
|
|
| 91 |
color: white;
|
| 92 |
}
|
| 93 |
|
| 94 |
+
section[data-testid="stSidebar"] .stSelectbox .st-bk {
|
| 95 |
+
background-color: #a0d3de;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
section[data-testid="stSidebar"] .stSelectbox .st-cc {
|
| 99 |
+
color: rgb(255, 43, 43);
|
| 100 |
+
font-weight: bold;
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
/* Images */
|
| 104 |
|
| 105 |
button[title="View fullscreen"] {
|
tabs/data_viz_tab.py
CHANGED
|
@@ -366,7 +366,7 @@ def run():
|
|
| 366 |
else:
|
| 367 |
dist_frequence_mots(df_count_word_fr)
|
| 368 |
with tab3:
|
| 369 |
-
st.subheader("Distribution des longueurs de
|
| 370 |
st.markdown(
|
| 371 |
"""
|
| 372 |
Malgré quelques différences entre les 2 langues (les phrases anglaises sont généralement un peu plus courtes),
|
|
|
|
| 366 |
else:
|
| 367 |
dist_frequence_mots(df_count_word_fr)
|
| 368 |
with tab3:
|
| 369 |
+
st.subheader("Distribution des longueurs de phrases")
|
| 370 |
st.markdown(
|
| 371 |
"""
|
| 372 |
Malgré quelques différences entre les 2 langues (les phrases anglaises sont généralement un peu plus courtes),
|