stopwords-fix
This commit is contained in:
@@ -115,12 +115,8 @@ async def messages_routing(msg, state):
|
||||
toxic_score = detector(normalized_text)
|
||||
toxic_perc = math.floor(toxic_score * 100)
|
||||
if toxic_score < 0.9 and text != text.replace(' ', ''):
|
||||
logger.info('check without spaces')
|
||||
if check_stopwords(normalized_text):
|
||||
logger.info('stopword detected without spaces, toxicity +40%')
|
||||
toxic_perc += 40
|
||||
else:
|
||||
logger.info('ok')
|
||||
logger.info('re-check without spaces')
|
||||
toxic_perc += check_stopwords(normalized_text):
|
||||
logger.info(f"text: {normalized_text}\ntoxic: {toxic_perc}%")
|
||||
|
||||
await redis.set(f"toxic:{cid}", mid)
|
||||
|
Reference in New Issue
Block a user