Spaces:
Running
Running
FoodDesert
commited on
Commit
•
075d09e
1
Parent(s):
6ec6a41
Upload app.py
Browse files
app.py
CHANGED
@@ -116,11 +116,17 @@ def find_similar_tags(test_tags):
|
|
116 |
if similar_tag not in seen:
|
117 |
result.append((similar_tag.replace('_', ' '), round(similarity, 3)))
|
118 |
seen.add(similar_tag)
|
|
|
119 |
# Append tag and formatted similar tags to results_data
|
|
|
120 |
for word, sim in result:
|
121 |
-
|
122 |
-
|
123 |
-
|
|
|
|
|
|
|
|
|
124 |
|
125 |
return results_data # Return list of lists for Dataframe
|
126 |
|
|
|
116 |
if similar_tag not in seen:
|
117 |
result.append((similar_tag.replace('_', ' '), round(similarity, 3)))
|
118 |
seen.add(similar_tag)
|
119 |
+
|
120 |
# Append tag and formatted similar tags to results_data
|
121 |
+
first_entry_for_tag = True
|
122 |
for word, sim in result:
|
123 |
+
if first_entry_for_tag:
|
124 |
+
results_data.append([tag, word, sim])
|
125 |
+
first_entry_for_tag = False
|
126 |
+
else:
|
127 |
+
results_data.append(["", word, sim])
|
128 |
+
results_data.append(["", "", ""]) # Adds a blank line after each group of tags
|
129 |
+
|
130 |
|
131 |
return results_data # Return list of lists for Dataframe
|
132 |
|