From ad0ad2febefea80c4098139b7d2512f3ad76eea6 Mon Sep 17 00:00:00 2001 From: Untone Date: Sun, 29 Sep 2024 10:25:09 +0300 Subject: [PATCH] stopwords-+40-- --- handlers/messages_routing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/messages_routing.py b/handlers/messages_routing.py index 176a193..57b2ed2 100644 --- a/handlers/messages_routing.py +++ b/handlers/messages_routing.py @@ -115,7 +115,7 @@ 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(' ', ''): - if check_stopwords(normalized_text): + if check_stopwords(normalized_text.replace(' ', '')): logger.info('stopword detected without spaces, toxicity +40%') toxic_perc += 40 logger.info(f"\text: {normalized_text}\ntoxic: {toxic_perc}%")