recheck-fix
This commit is contained in:
parent
8ebe5f82fc
commit
6385d48d7c
|
@ -114,13 +114,12 @@ async def messages_routing(msg, state):
|
||||||
toxic_score = detector(segmented_text)
|
toxic_score = detector(segmented_text)
|
||||||
toxic_perc = math.floor(toxic_score * 100)
|
toxic_perc = math.floor(toxic_score * 100)
|
||||||
|
|
||||||
if toxic_perc > 49:
|
logger.info('re-check this one...')
|
||||||
logger.info('re-check this one...')
|
nospaces_text = text.replace(' ', '')
|
||||||
nospaces_text = text.replace(' ', '')
|
nospaces_text_score = detector(nospaces_text)
|
||||||
nospaces_text_score = detector(nospaces_text)
|
logger.info(f'no spaces text toxic: {nospaces_text_score}')
|
||||||
logger.info(f'no spaces text toxic: {nospaces_text_score}')
|
if nospaces_text != text and nospaces_text_score > toxic_score:
|
||||||
if nospaces_text_score > toxic_score:
|
toxic_score = nospaces_text + 10
|
||||||
toxic_score = nospaces_text + 10
|
|
||||||
|
|
||||||
await redis.set(f"toxic:{cid}", mid)
|
await redis.set(f"toxic:{cid}", mid)
|
||||||
await redis.set(f"toxic:{cid}:{uid}:{mid}", toxic_perc, ex=60 * 60 * 24 * 3)
|
await redis.set(f"toxic:{cid}:{uid}:{mid}", toxic_perc, ex=60 * 60 * 24 * 3)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user