stopwords-+40
This commit is contained in:
parent
6fffea0df4
commit
c8582b8ac8
|
@ -111,11 +111,13 @@ async def messages_routing(msg, state):
|
||||||
text += '\n'
|
text += '\n'
|
||||||
|
|
||||||
normalized_text = normalize(text)
|
normalized_text = normalize(text)
|
||||||
|
logger.info(f'noramalized: {normalized_text}')
|
||||||
toxic_score = detector(normalized_text)
|
toxic_score = detector(normalized_text)
|
||||||
toxic_perc = math.floor(toxic_score * 100)
|
toxic_perc = math.floor(toxic_score * 100)
|
||||||
if toxic_score < 0.9 and text != text.replace(' ', '') and check_stopwords(normalized_text):
|
if toxic_score < 0.9 and text != text.replace(' ', ''):
|
||||||
logger.info('stopword detected without spaces, toxicity +40%')
|
if check_stopwords(normalized_text):
|
||||||
toxic_perc += 40
|
logger.info('stopword detected without spaces, toxicity +40%')
|
||||||
|
toxic_perc += 40
|
||||||
logger.info(f"\text: {normalized_text}\ntoxic: {toxic_perc}%")
|
logger.info(f"\text: {normalized_text}\ntoxic: {toxic_perc}%")
|
||||||
|
|
||||||
await redis.set(f"toxic:{cid}", mid)
|
await redis.set(f"toxic:{cid}", mid)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user