log-rechecked2
This commit is contained in:
parent
af6669a8e8
commit
9db8f50663
|
@ -118,9 +118,9 @@ async def messages_routing(msg, state):
|
|||
nospaces_text = text.replace(' ', '')
|
||||
nospaces_text_score = detector(nospaces_text)
|
||||
nospaces_text_perc = math.floor(toxic_score * 100)
|
||||
logger.info(f'no spaces text toxic: {nospaces_text_score}')
|
||||
if nospaces_text != text and nospaces_text_score > toxic_score:
|
||||
toxic_perc = nospaces_text_perc + 10
|
||||
logger.info(f'no spaces text toxic: {nospaces_text_perc}%')
|
||||
if (nospaces_text != text and nospaces_text_score > toxic_score) or nospaces_text_perc > 95:
|
||||
text_perc = nospaces_text_perc
|
||||
|
||||
await redis.set(f"toxic:{cid}", mid)
|
||||
await redis.set(f"toxic:{cid}:{uid}:{mid}", toxic_perc, ex=60 * 60 * 24 * 3)
|
||||
|
|
Loading…
Reference in New Issue
Block a user