Spaces:
Sleeping
Sleeping
Arko Banik
commited on
Commit
·
8243f22
1
Parent(s):
32a0a02
this time return list of tuples instead of list of words
Browse files
app.py
CHANGED
@@ -219,16 +219,16 @@ def get_sorted_cosine_similarity(embeddings_metadata):
|
|
219 |
|
220 |
|
221 |
sorted_list = sorted(cat_scores, key=lambda x: x[1])
|
222 |
-
|
|
|
223 |
sorted_cats = [element[0] for element in sorted_list]
|
224 |
|
225 |
#flip sorting order
|
226 |
-
sorted_cats = sorted_cats[::-1]
|
227 |
# Add list to Map
|
228 |
for cat_pair in sorted_cats:
|
229 |
cosine_sim[cat_pair[0]] = cat_pair[1]
|
230 |
|
231 |
-
return
|
232 |
|
233 |
|
234 |
def plot_piechart(sorted_cosine_scores_items):
|
|
|
219 |
|
220 |
|
221 |
sorted_list = sorted(cat_scores, key=lambda x: x[1])
|
222 |
+
sorted_list = sorted_list[::-1]
|
223 |
+
|
224 |
sorted_cats = [element[0] for element in sorted_list]
|
225 |
|
226 |
#flip sorting order
|
|
|
227 |
# Add list to Map
|
228 |
for cat_pair in sorted_cats:
|
229 |
cosine_sim[cat_pair[0]] = cat_pair[1]
|
230 |
|
231 |
+
return sorted_list
|
232 |
|
233 |
|
234 |
def plot_piechart(sorted_cosine_scores_items):
|