SATVA is an advanced spam detection and analysis tool that integrates multiple layers of text analysis, including Spam Classification, Named Entity Recognition (NER) Extraction, Sentiment Analysis, and Blacklisted URL Tagging. It also leverages Generative AI to produce detailed responses based on the analysis. The project offers two main utilities:
- Telegram Bot Integration: Users can interact with a registered Telegram bot to analyze messages and receive detailed spam analysis.
- Streamlit Web Application: Users can input text for analysis via a web interface with built-in authentication features.
- Spam Classification: Detects and categorizes different types of spam (e.g., phishing, promotional).
- NER Extraction: Identifies key entities and personal information within the text.
- Sentiment Analysis: Analyzes the sentiment (subjectivity and polarity) of the message.
- Blacklisted URL Tagging: Checks URLs against a blacklist to flag malicious links.
- Generative AI Response: Provides a human-readable explanation and detailed analysis of the message.
- Python 3.9 (or above)
- Virtual Environment (optional but recommended)
- Telegram API credentials
- Azure OpenAI credentials
- Clone the Repository:
git clone <repository_url>
- Create a Python Virtual Environment:
python -m venv env source env/bin/activate # On Windows use `env\Scripts\activate`
- Install Dependencies:
pip install -r requirements.txt
-
Update the
.envFile:- Navigate to the
satvadirectory. - Update the
.envfile with your TelegramAPI_IDandAPI_HASH. Obtain these credentials from here.
Example
.envfile:API_ID=<your_telegram_api_id> API_HASH=<your_telegram_api_hash>
- Navigate to the
-
Update NER and Spam Classification Config Files:
- In the
nlp_pipelinefolder, update the.env,ner.cfgandspam_classification.cfgfiles with your Azure OpenAI credentials. Obtain these credentials from here.
Example configuration for
.env:AZURE_OPENAI_API_KEY=<your_azure_openai_api_key> OPENAI_API_TYPE=<your_azure_openai_type e.g azure> OPENAI_API_VERSION=<your_azure_openai_version> AZURE_OPENAI_ENDPOINT=<your_azure_openai_endpoint>
Example configuration for
.cfg:deployment_name=<your_azure_openai_model_name e.g gpt-35-turbo, gpt-4, gpt-4-turbo> name=<your_azure_openai_model_name e.g gpt-35-turbo, gpt-4, gpt-4-turbo> model_type=<your_azure_openai_model_type e.g chat,instruct> api_version=<your_azure_openai_version> base_url=<your_azure_openai_endpoint>
- In the
-
Create a Telegram Session File:
cd telegram python create_telegram_sessionfile.py- Follow the steps to create a session file using your Telegram credentials.
-
Start the Telegram Session:
python message_handler.py
- Now, you can send messages to the registered Telegram channel, and SATVA will analyze them.
Note: To receive a response, start your message with:
SATVA: <your_message_content>
Here is few screenshots of SATVA Telegram Bot in action:
-
Navigate to the Streamlit Package Directory:
cd streamlit_package -
Start the Application:
python start_app.py
- Open the application in your web browser.
Default Login Credentials:
- Username: admin
- Password: admin
- Email: admin@gmail.com
After logging in, you can update your username and password using the "Update User Details" feature.
Here is a demonstration video of SATVA Web Application in action:
satwa_webapp_compressed.mp4
- Security: Ensure that your API credentials are kept secure and not exposed in public repositories.
- Scalability: The architecture can be expanded with additional layers or integrated with other messaging platforms.

