Commit a30d25c0 authored by Vasyl Bodnaruk's avatar Vasyl Bodnaruk

Tags will be empty if teach=false

parent 793b4a18
......@@ -105,12 +105,13 @@ class ExaPipeline(object):
:param text: Text for searching tags
:return: json object with tags that are relevant for text
'''
self.classifier.classify(text)
tags = list()
for i in self.classifier.tag_accordance:
tags.append(i[0])
if len(tags) > 0:
return tags
if self.classifier:
self.classifier.classify(text)
tags = list()
for i in self.classifier.tag_accordance:
tags.append(i[0])
if len(tags) > 0:
return tags
return None
def get_radar(self, tags):
......
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