This commit is contained in:
Untone 2024-09-29 10:10:12 +03:00
parent 5a6a48c41c
commit a7abe92d3c

View File

@ -114,7 +114,7 @@ async def messages_routing(msg, state):
toxic_score = detector(normalized_text)
toxic_perc = math.floor(toxic_score * 100)
logger.info(f"\text: {normalized_text}\ntoxic: {toxic_perc}%")
if check_stopwords(normalized_text):
if len(text) != len(normalized_text) and check_stopwords(normalized_text):
logger.info('stopword detected with no spaces, toxicity +40%')
toxic_perc += 40