Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -242,8 +242,11 @@ def extract_problem_domains(df, text_column='Problem_Description', cluster_range
|
|
242 |
|
243 |
|
244 |
# BERTopic for topic modelling
|
245 |
-
topic_model = BERTopic(num_topics=optimal_n_clusters)
|
|
|
|
|
246 |
topics, _ = topic_model.fit_transform(df[text_column].tolist())
|
|
|
247 |
|
248 |
|
249 |
# Get representative words for each cluster
|
|
|
242 |
|
243 |
|
244 |
# BERTopic for topic modelling
|
245 |
+
# topic_model = BERTopic(num_topics=optimal_n_clusters)
|
246 |
+
# topics, _ = topic_model.fit_transform(df[text_column].tolist())
|
247 |
+
topic_model = BERTopic()
|
248 |
topics, _ = topic_model.fit_transform(df[text_column].tolist())
|
249 |
+
topic_model.reduce_topics(df[text_column].tolist(), nr_topics=optimal_n_clusters)
|
250 |
|
251 |
|
252 |
# Get representative words for each cluster
|