Skip to content

Commit

Permalink
fx
Browse files Browse the repository at this point in the history
  • Loading branch information
picaultj committed Dec 30, 2024
1 parent 2035357 commit f0444c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}


def generate_newsletter_wrapper():
def generate_newsletter_wrapper(df, df_split):
"""Wrapper function to generate newsletters based on user settings."""
top_n_topics = (
None
Expand Down Expand Up @@ -154,7 +154,7 @@ def main():
df_split = None

with st.spinner("Generating newsletters..."):
st.session_state["newsletters"] = generate_newsletter_wrapper()
st.session_state["newsletters"] = generate_newsletter_wrapper(df, df_split)

# Display generated newsletters
if "newsletters" in st.session_state:
Expand Down
4 changes: 2 additions & 2 deletions bertrend/demos/topic_analysis/demo_pages/training_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
)
from bertrend.demos.demos_utils.session_state_manager import SessionStateManager
from bertrend.demos.topic_analysis.data_utils import data_overview
from bertrend.metrics.topic_metrics import compute_cluster_metrics
from bertrend.parameters import BERTOPIC_SERIALIZATION
from bertrend.topic_model import TopicModel
from bertrend.utils.data_loading import (
Expand Down Expand Up @@ -143,8 +144,7 @@ def train_model():
] # exclude -1 topic from topic list

# compute cluster metrics (optional)
# TODO: fix session state parameter
# compute_cluster_metrics(bertopic, st.session_state["topics"], dataset)
compute_cluster_metrics(bertopic, st.session_state["topics"], dataset)

# update state
st.session_state["model_trained"] = True
Expand Down

0 comments on commit f0444c3

Please sign in to comment.