Skip to content

Commit

Permalink
Added additional icons for better display
Browse files Browse the repository at this point in the history
  • Loading branch information
picaultj committed Jan 3, 2025
1 parent fd3a038 commit 2469952
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
9 changes: 8 additions & 1 deletion bertrend/demos/demos_utils/data_loading_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
CSV_ICON,
PARQUET_ICON,
XLSX_ICON,
CLIENT_STORAGE_ICON,
SERVER_STORAGE_ICON,
)
from bertrend.demos.demos_utils.messages import NO_DATA_AFTER_PREPROCESSING_MESSAGE
from bertrend.demos.demos_utils.state_utils import (
Expand Down Expand Up @@ -99,7 +101,12 @@ def display_data_loading_component():
state variable "time_filtered_df".
"""
# Find files in the current directory and subdirectories
tab1, tab2 = st.tabs(["Data from local storage", "Data from server data"])
tab1, tab2 = st.tabs(
[
CLIENT_STORAGE_ICON + " Data from local storage",
SERVER_STORAGE_ICON + " Data from server data",
]
)
compatible_extensions = FORMAT_ICONS.keys()

with tab1:
Expand Down
5 changes: 5 additions & 0 deletions bertrend/demos/demos_utils/icons.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
TOPIC_VISUALIZATION_ICON = ":material/monitoring:"
TEMPORAL_VISUALIZATION_ICON = ":material/timelapse:"
NEWSLETTER_ICON = ":material/newspaper:"
ANALYSIS_ICON = ":material/query_stats:"
DATA_LOADING_ICON = ":material/drive_folder_upload:"
MODEL_TRAINING_ICON = ":material/cognition:"
SERVER_STORAGE_ICON = ":material/database:"
CLIENT_STORAGE_ICON = ":material/upload:"

JSON_ICON = "🧾"
PARQUET_ICON = "📦️"
Expand Down
3 changes: 1 addition & 2 deletions bertrend/demos/topic_analysis/demo_pages/training_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,9 @@ def train_model():
representation_models=SessionStateManager.get("representation_models"),
)
embeddings = st.session_state["embeddings"]
embedding_model_name = st.session_state["embedding_model_name"]
topic_model_output = topic_model.fit(
docs=dataset,
embedding_model=embedding_model_name,
embedding_model=st.session_state["embedding_model_name"],
embeddings=embeddings,
)
bertopic = topic_model_output.topic_model
Expand Down
15 changes: 12 additions & 3 deletions bertrend/demos/weak_signals/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
TOPIC_ICON,
TREND_ICON,
ERROR_ICON,
ANALYSIS_ICON,
MODEL_TRAINING_ICON,
DATA_LOADING_ICON,
)
from bertrend.demos.demos_utils.messages import (
NO_EMBEDDINGS_WARNING_MESSAGE,
Expand Down Expand Up @@ -174,7 +177,7 @@ def load_data_page():
def training_page():
st.header("Model Training")

if not SessionStateManager.get("data_embedded", False):
if not SessionStateManager.get("data_embedded"):
st.warning(NO_EMBEDDINGS_WARNING_MESSAGE, icon=WARNING_ICON)
st.stop()

Expand Down Expand Up @@ -306,7 +309,7 @@ def training_page():
def analysis_page():
st.header("Results Analysis")

if not SessionStateManager.get("data_embedded", False):
if not SessionStateManager.get("data_embedded"):
st.warning(
EMBED_TRAIN_WARNING,
icon=WARNING_ICON,
Expand Down Expand Up @@ -520,7 +523,13 @@ def main():
display_bertrend_hyperparameters()

# Main content
tab1, tab2, tab3 = st.tabs(["Data Loading", "Model Training", "Results Analysis"])
tab1, tab2, tab3 = st.tabs(
[
DATA_LOADING_ICON + " Data Loading",
MODEL_TRAINING_ICON + " Model Training",
ANALYSIS_ICON + " Results Analysis",
]
)

with tab1:
load_data_page()
Expand Down

0 comments on commit 2469952

Please sign in to comment.