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_perc = math.floor(toxic_score * 100)
|
||||
logger.info(f"\text: {normalized_text}\ntoxic: {toxic_perc}%")
|
||||
if len(text) != len(normalized_text) and check_stopwords(normalized_text):
|
||||
logger.info('stopword detected with no spaces, toxicity +40%')
|
||||
if text !== text.replace(' ', '') and check_stopwords(normalized_text):
|
||||
logger.info('stopword detected without spaces, toxicity +40%')
|
||||
toxic_perc += 40
|
||||
|
||||
await redis.set(f"toxic:{cid}", mid)
|
||||
|
|
Loading…
Reference in New Issue
Block a user