wilmerags commited on
Commit
401a74f
·
1 Parent(s): 4b206d5

fix: Fix typo in index array for accessing cluster embeddings

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -158,7 +158,7 @@ def generate_plot(
158
  cluster_words = [tw.split(' ') for tw in cluster_tws]
159
  cluster_words = list(set(itertools.chain.from_iterable(cluster_words)))
160
  # cluster_embeddings = embed_text(cluster_tws, model)
161
- cluster_embeddings = [embeddings[i] for i in ixs]
162
  cluster_embeddings_avg = np.mean(cluster_embeddings, axis=0)
163
  cluster_words_embeddings = embed_text(cluster_words, model)
164
  cluster_to_words_similarities = util.dot_score(cluster_embeddings_avg, cluster_words_embeddings)
 
158
  cluster_words = [tw.split(' ') for tw in cluster_tws]
159
  cluster_words = list(set(itertools.chain.from_iterable(cluster_words)))
160
  # cluster_embeddings = embed_text(cluster_tws, model)
161
+ cluster_embeddings = [embeddings[i] for i in cluster_ixs]
162
  cluster_embeddings_avg = np.mean(cluster_embeddings, axis=0)
163
  cluster_words_embeddings = embed_text(cluster_words, model)
164
  cluster_to_words_similarities = util.dot_score(cluster_embeddings_avg, cluster_words_embeddings)