From 335e65eaaae260e29818b32f92ec2a3c1770d3ba Mon Sep 17 00:00:00 2001 From: Untone Date: Sun, 29 Sep 2024 13:18:19 +0300 Subject: [PATCH] stopwords-fix2 --- handlers/messages_routing.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/handlers/messages_routing.py b/handlers/messages_routing.py index f588efa..a93c4a9 100644 --- a/handlers/messages_routing.py +++ b/handlers/messages_routing.py @@ -70,7 +70,8 @@ async def messages_routing(msg, state): if toxic_score: emoji = ( - "😳" + "🤯" if toxic_score > 100 + else "😳" if toxic_score > 90 else "😟" if toxic_score > 80 @@ -116,7 +117,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('re-check without spaces') - toxic_perc += check_stopwords(normalized_text): + toxic_perc += check_stopwords(normalized_text) logger.info(f"text: {normalized_text}\ntoxic: {toxic_perc}%") await redis.set(f"toxic:{cid}", mid)