log-rechecked4

This commit is contained in:
Untone 2024-09-29 08:40:25 +03:00
parent 35823c43a0
commit 36fa8ebd85

View File

@ -117,10 +117,12 @@ async def messages_routing(msg, state):
nospaces_text = text.replace(' ', '') nospaces_text = text.replace(' ', '')
logger.info(f're-check this one: {nospaces_text}') logger.info(f're-check this one: {nospaces_text}')
nospaces_text_score = detector(nospaces_text) nospaces_normalized_text = normalize(nospaces_text)
nospaces_text_perc = math.floor(toxic_score * 100) nospaces_text_score = detector(nospaces_nospaces_text)
nospaces_segmented_text = segment_text(nospaces_normalized_text)
nospaces_text_perc = math.floor(nospaces_text_score * 100)
logger.info(f'no spaces text toxic: {nospaces_text_perc}%') 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: if (nospaces_text != text and nospaces_text_score > toxic_score) or nospaces_text_perc > 95:
text_perc = nospaces_text_perc text_perc = nospaces_text_perc