logs
This commit is contained in:
parent
7fd358931a
commit
c86061be58
|
@ -3,6 +3,7 @@ from bot.config import FEEDBACK_CHAT_ID
|
|||
from nlp.toxicity import text2toxicity
|
||||
from nlp.replying import get_toxic_reply
|
||||
import logging
|
||||
import math
|
||||
|
||||
from handlers.handle_private import handle_private
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -31,6 +32,7 @@ async def messages_routing(msg, state):
|
|||
|
||||
elif bool(text):
|
||||
toxic_score = text2toxicity(text)
|
||||
logger.info(f'\ntext: {text}\ntoxic: {math.floor(toxic_score*100)}%')
|
||||
if toxic_score > 0.71:
|
||||
toxic_reply = get_toxic_reply(toxic_score)
|
||||
await telegram_api(
|
||||
|
|
Loading…
Reference in New Issue
Block a user