wilmerags commited on
Commit
29060ca
·
1 Parent(s): c7010dd

feat: Add numpy coercion to be able to delete items

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -153,6 +153,7 @@ def generate_plot(
153
  cluster_embeddings_avg = np.mean(cluster_embeddings, axis=0)
154
  cluster_words_embeddings = embed_text(cluster_words, model)
155
  cluster_to_words_similarities = util.dot_score(cluster_embeddings_avg, cluster_words_embeddings)
 
156
  while len(cluster_keyword[label]) < 3:
157
  most_descriptive = np.argmax(cluster_to_words_similarities)
158
  del cluster_to_words_similarities[most_descriptive]
 
153
  cluster_embeddings_avg = np.mean(cluster_embeddings, axis=0)
154
  cluster_words_embeddings = embed_text(cluster_words, model)
155
  cluster_to_words_similarities = util.dot_score(cluster_embeddings_avg, cluster_words_embeddings)
156
+ cluster_to_words_similarities = cluster_to_words_similarities.numpy()
157
  while len(cluster_keyword[label]) < 3:
158
  most_descriptive = np.argmax(cluster_to_words_similarities)
159
  del cluster_to_words_similarities[most_descriptive]