Commit 40839379 authored by kurumuz's avatar kurumuz

maybe this fixes it

parent 5b242a97
...@@ -699,7 +699,7 @@ class EmbedderModel(nn.Module): ...@@ -699,7 +699,7 @@ class EmbedderModel(nn.Module):
#check if text is a substring in tag_count.keys() #check if text is a substring in tag_count.keys()
found = [] found = []
for tag, count in self.tag_count_sorted: for tag, count in self.tag_count_sorted:
if tag.startswith(text): if len(tag) > len(text) and tag.startswith(text):
found.append([tag, count]) found.append([tag, count])
results = [] results = []
...@@ -718,7 +718,7 @@ class EmbedderModel(nn.Module): ...@@ -718,7 +718,7 @@ class EmbedderModel(nn.Module):
results = sorted(results, key=lambda x: x[1], reverse=True) results = sorted(results, key=lambda x: x[1], reverse=True)
found = found[:5] found = found[:5]
for result in found: for result in found:
if result in results: if result[0] in results:
results.remove(result) results.remove(result)
results = results[:-len(found)] results = results[:-len(found)]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment