Spaces:
Sleeping
Sleeping
sarahselim18
commited on
Commit
·
17fe766
1
Parent(s):
666b2d1
updated app get_sorted_CS
Browse files
app.py
CHANGED
@@ -182,7 +182,7 @@ def get_sorted_cosine_similarity(embeddings_metadata):
|
|
182 |
(50 pts)
|
183 |
"""
|
184 |
categories = st.session_state.categories.split(" ")
|
185 |
-
|
186 |
if embeddings_metadata["embedding_model"] == "glove":
|
187 |
word_index_dict = embeddings_metadata["word_index_dict"]
|
188 |
embeddings = embeddings_metadata["embeddings"]
|
@@ -196,8 +196,8 @@ def get_sorted_cosine_similarity(embeddings_metadata):
|
|
196 |
## TODO: Get embeddings for categories ###
|
197 |
cat_embed = []
|
198 |
for cat in categories:
|
199 |
-
cat_embed
|
200 |
-
|
201 |
|
202 |
##########################################
|
203 |
|
@@ -236,11 +236,11 @@ def get_sorted_cosine_similarity(embeddings_metadata):
|
|
236 |
# Add list to Map
|
237 |
result = sorted_cats[0]
|
238 |
selected_cat = categories[result]
|
239 |
-
|
240 |
# TODO: Update category embeddings if category not found
|
241 |
##########################################
|
242 |
|
243 |
-
return
|
244 |
|
245 |
|
246 |
def plot_piechart(sorted_cosine_scores_items):
|
|
|
182 |
(50 pts)
|
183 |
"""
|
184 |
categories = st.session_state.categories.split(" ")
|
185 |
+
|
186 |
if embeddings_metadata["embedding_model"] == "glove":
|
187 |
word_index_dict = embeddings_metadata["word_index_dict"]
|
188 |
embeddings = embeddings_metadata["embeddings"]
|
|
|
196 |
## TODO: Get embeddings for categories ###
|
197 |
cat_embed = []
|
198 |
for cat in categories:
|
199 |
+
cat_embed = get_glove_embeddings(categories)
|
200 |
+
cat_embed.append(get_glove_embeddings(categories))
|
201 |
|
202 |
##########################################
|
203 |
|
|
|
236 |
# Add list to Map
|
237 |
result = sorted_cats[0]
|
238 |
selected_cat = categories[result]
|
239 |
+
print(selected_cat)
|
240 |
# TODO: Update category embeddings if category not found
|
241 |
##########################################
|
242 |
|
243 |
+
return selected_cat
|
244 |
|
245 |
|
246 |
def plot_piechart(sorted_cosine_scores_items):
|