The problem of spam in large chats is common. Spam makes it difficult to communicate between people, search for the right information, which may eventually lead to people starting to leave the chat, because it will be impossible to be in it because of the abundance of spam.
By getting rid of spam in the chat, we will be able to make communication between people more comfortable, because it is unpleasant to correspond in the chat or search for information and often stumble upon fraudulent information about discounts of 90%, etc.
In general, the goal of this project is to reduce the amount of spam to a minimum, free administrators from routine viewing of the chat for spam, round-the-clock monitoring of the chat by a bot, timely decision-making on blocking the user and deleting spam.
This version of the bot uses a primitive model based on heuristic rules. This is justified in order to start with a simple one and complicate the model step by step and understand whether it is worth spending human resources on developing a more complex model when a simpler model can cope with the task.
The following structure is used in this project:
-
src module
: contains the main code of the project,app.py
- the main file in which the bot is launched
-
data module
: not available in the public version -
logs module
: contains project logs,logs_from_bot.log
- the main log file in which all the actions of the bot are recorded (not available in the public version);temp_list_with_new_user.json
is a temporary file to which the user is added until he sends his first message to the chat
-
scripts modele
: contains scripts for working with data,data_preprocessing.py
- performs data cleaningmake_metrics.py
- calculates the quality metrics of the modelpredict_spam_scores.py
- makes predictions from the modelwatching.py
- in development
-
src module
: contains the source codedata module
data.py
- source code for data cleaningmodel module
model.py
- source code for the modelscripts module
make_metrics.py
- source code for calculating the quality metrics of the modeladd_new_user_id.py
- source code for adding a new user to the temporary filecommands.py
- source code for bot commandssend_messages.py
- source code for sending messages to admins and a group
The following structure is used in this project:
-
src module
: contains the main code of the project, 1.1app.py
- the main file in which the bot is launched -
data module
: not available in the public version -
logs module
: contains project logs,logs_from_bot.log
- the main log file in which all the actions of the bot are recorded (not available in the public version);temp_list_with_new_user.json
is a temporary file to which the user is added until he sends his first message to the chat
-
scripts modele
: contains scripts for working with data,data_preprocessing.py
- performs data cleaningmake_metrics.py
- calculates the quality metrics of the modelpredict_spam_scores.py
- makes predictions from the modelwatching.py
- in development
-
src module
: contains the source codedata module
data.py
- source code for data cleaningmodel module
model.py
- source code for the modelscripts module
make_metrics.py
- source code for calculating the quality metrics of the modeladd_new_user_id.py
- source code for adding a new user to the temporary filecommands.py
- source code for bot commandssend_messages.py
- source code for sending messages to admins and a group