wilmerags commited on
Commit
ea87688
1 Parent(s): 6319da9

fix: Improve null keywords resulting for topics

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -175,6 +175,7 @@ def generate_plot(
175
  elif len(cluster_keyword[label]) == 0:
176
  cluster_keyword[label] = '-'
177
  elif len(cluster_keyword[label]) > 1:
 
178
  cluster_keyword[label] = ', '.join(cluster_keyword[label])
179
  encoded_labels_keywords = [cluster_keyword[encoded_label] for encoded_label in encoded_labels]
180
  embeddings_2d = get_tsne_embeddings(embeddings)
 
175
  elif len(cluster_keyword[label]) == 0:
176
  cluster_keyword[label] = '-'
177
  elif len(cluster_keyword[label]) > 1:
178
+ cluster_keyword[label] = [word for word in cluster_keyword[label] if word != '']
179
  cluster_keyword[label] = ', '.join(cluster_keyword[label])
180
  encoded_labels_keywords = [cluster_keyword[encoded_label] for encoded_label in encoded_labels]
181
  embeddings_2d = get_tsne_embeddings(embeddings)