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