stopwords-fix2

This commit is contained in:
Untone 2024-09-29 13:18:19 +03:00
parent 5f3bbe6229
commit 335e65eaaa

View File

@ -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)