Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -252,7 +252,8 @@ def extract_problem_domains(df, text_column='Problem_Description', cluster_range
|
|
252 |
# Get representative words for each cluster
|
253 |
cluster_representations = {}
|
254 |
for i in range(optimal_n_clusters):
|
255 |
-
cluster_representations[i] = topic_model.get_topic_info(i)['words'][:top_words]
|
|
|
256 |
|
257 |
# Map cluster labels to representative words
|
258 |
df["Problem_Cluster"] = cluster_labels
|
|
|
252 |
# Get representative words for each cluster
|
253 |
cluster_representations = {}
|
254 |
for i in range(optimal_n_clusters):
|
255 |
+
# cluster_representations[i] = topic_model.get_topic_info(i)['words'][:top_words]
|
256 |
+
cluster_representations[i] = topic_model.get_topic_info(i).get('words', [])[:top_words]
|
257 |
|
258 |
# Map cluster labels to representative words
|
259 |
df["Problem_Cluster"] = cluster_labels
|