nosegm7
This commit is contained in:
parent
1cd21b5026
commit
2344928934
|
@ -114,8 +114,8 @@ async def messages_routing(msg, state):
|
||||||
toxic_score = detector(normalized_text)
|
toxic_score = detector(normalized_text)
|
||||||
toxic_perc = math.floor(toxic_score * 100)
|
toxic_perc = math.floor(toxic_score * 100)
|
||||||
logger.info(f"\text: {normalized_text}\ntoxic: {toxic_perc}%")
|
logger.info(f"\text: {normalized_text}\ntoxic: {toxic_perc}%")
|
||||||
if len(text) != len(normalized_text) and check_stopwords(normalized_text):
|
if text !== text.replace(' ', '') and check_stopwords(normalized_text):
|
||||||
logger.info('stopword detected with no spaces, toxicity +40%')
|
logger.info('stopword detected without spaces, toxicity +40%')
|
||||||
toxic_perc += 40
|
toxic_perc += 40
|
||||||
|
|
||||||
await redis.set(f"toxic:{cid}", mid)
|
await redis.set(f"toxic:{cid}", mid)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user