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}%")