stopwords-fix

This commit is contained in:
2024-09-29 13:02:30 +03:00
parent 4b517441ee
commit 3e4aefc429
3 changed files with 76 additions and 11 deletions

View File

@@ -116,7 +116,7 @@ async def messages_routing(msg, state):
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.replace(' ', '')):
if check_stopwords(normalized_text):
logger.info('stopword detected without spaces, toxicity +40%')
toxic_perc += 40
else: