From 029d5ac5d37714d1443d15dc0a945db147b23bbe Mon Sep 17 00:00:00 2001 From: Egor Kokush <46494602+Egoluback@users.noreply.github.com> Date: Tue, 18 May 2021 09:41:59 +0300 Subject: [PATCH] Add files via upload --- main.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/main.py b/main.py index 42420bc..56a85a3 100644 --- a/main.py +++ b/main.py @@ -28,9 +28,6 @@ def tokenize_sentence(sentence: str, remove_stop_words: bool = True): @bot.message_handler(content_types = ['text']) def reply(message): text = message.text - # result_ins = model_ins.predict([text])[0] - # result_thr = model_thr.predict([text])[0] - # result_obs = model_obs.predict([text])[0] result_ins = round(model_ins.predict_proba([text]).T[1][0], 4) result_thr = round(model_thr.predict_proba([text]).T[1][0], 4) @@ -41,10 +38,8 @@ def reply(message): print('------') if (result_ins < 0.5 and result_thr < 0.5 and result_obs < 0.5): return - - ans = f"Это оскорбление с вероятностью {result_ins}\nЭто угроза с вероятностью {result_thr}\nЭто домогательство с вероятностью {result_obs}\n" - bot.reply_to(message, ans) + bot.reply_to(message, f"Это оскорбление с вероятностью {result_ins}\nЭто угроза с вероятностью {result_thr}\nЭто домогательство с вероятностью {result_obs}\n") bot.polling() \ No newline at end of file