Spaces:
Running
Running
sarahselim18
commited on
Commit
·
dd3e553
1
Parent(s):
2f52104
restored with prints
Browse files
app.py
CHANGED
@@ -211,8 +211,10 @@ def get_sorted_cosine_similarity(embeddings_metadata):
|
|
211 |
# TODO: Compute cosine similarity between input sentence and categories
|
212 |
# TODO: Update category embeddings if category not found
|
213 |
##########################################
|
214 |
-
|
215 |
-
|
|
|
|
|
216 |
# Calc cosine sim
|
217 |
cat_scores.append((index, np.dot(input_embedding,cat_embed)))
|
218 |
# Store doc_id and score as a tuple
|
|
|
211 |
# TODO: Compute cosine similarity between input sentence and categories
|
212 |
# TODO: Update category embeddings if category not found
|
213 |
##########################################
|
214 |
+
cat = categories[index]
|
215 |
+
print('categories', categories)
|
216 |
+
print('cat_embeddings', category_embeddings)
|
217 |
+
cat_embed = category_embeddings[cat]
|
218 |
# Calc cosine sim
|
219 |
cat_scores.append((index, np.dot(input_embedding,cat_embed)))
|
220 |
# Store doc_id and score as a tuple
|