log-rechecked8
This commit is contained in:
parent
a16f0190f5
commit
20cbc6dab6
|
@ -113,14 +113,14 @@ async def messages_routing(msg, state):
|
|||
segmented_text = segment_text(normalized_text)
|
||||
toxic_score = detector(segmented_text)
|
||||
toxic_perc = math.floor(toxic_score * 100)
|
||||
logger.info(f"\ntext: {text}\ntoxic: {toxic_perc}%")
|
||||
logger.info(f"\segmented_text: {segmented_text}\ntoxic: {toxic_perc}%")
|
||||
|
||||
nospaces_text = text.replace(' ', '')
|
||||
nospaces_normalized_text = normalize(nospaces_text)
|
||||
nospaces_segmented_text = segment_text(nospaces_normalized_text)
|
||||
nospaces_text_score = detector(nospaces_segmented_text)
|
||||
nospaces_text_perc = math.floor(nospaces_text_score * 100)
|
||||
logger.info(f"\nnospaces_text: {text}\nnospaces_toxic: {toxic_perc}%")
|
||||
logger.info(f"\nospaces_segmented_text: {nospaces_segmented_text}\nnospaces_toxic: {toxic_perc}%")
|
||||
|
||||
if (nospaces_text != text and nospaces_text_score > toxic_score) or nospaces_text_perc > 95:
|
||||
text_perc = nospaces_text_perc
|
||||
|
|
Loading…
Reference in New Issue
Block a user