An intelligent Python-based tool that identifies scam messages using a custom rule-based and machine learning model. Designed to analyze message patterns, assign scores to multiple scam indicators, and classify input as SCAM or REAL — all while explaining why.
- Classifies input messages as SCAM or REAL
- Uses a custom-built feature extractor for:
- Money requests
- Urgency
- Grammar issues
- Suspicious links
- Upfront payments
- Celebrity references
- Reward offers
- Pressure tactics
- Unusual contact methods
- Official appearance fakes
- Unsecured sources
- Threats or blackmail
- Machine Learning classifier (Random Forest)
- Accuracy report with precision, recall, and F1-score
Your dataset file labeled_dataset.csv should look like this:
message,label,urgency,money_request,official_appearance,reward_offer,celebrity_reference,grammar_issues,unusual_contact_method,pressure_to_act,suspicious_link,upfront_payment
"Message text",scam,0.9,1.0,0.7,0.6,0.0,0.4,0.2,0.9,0.0,0.5
git clone https://github.com/Debottam1234567890/Scam_Detector.git
cd scam_detectorMake sure you're using Python 3.12 or higher.
python3 -m venv venv
source venv/bin/activate # On Mac/Linux
venv\Scripts\activate # On Windows
pip install -r requirements.txt
If there's no requirements.txt, install dependencies manually:
pip install scikit-learn pandas
python3 scam_detector.py
You will see a classification report and a prompt for entering messages.
Enter a message to check (or 'quit' to exit):
Congratulations! You've won $5,000! Claim now or lose it forever.
Prediction: SCAM
Enter a message to check (or 'quit' to exit):
python3 endpoints.py
You will see a website with the same scam detector
Each message is processed by a feature extraction system that searches for 100+ scammy keywords across 12 different psychological and linguistic factors. These values are then used by a Random Forest model to classify the message.
This project is licensed under the MIT License — feel free to use, modify, and share.
Debottam Ghosh
GitHub: @Debottam1234567890
Contributions are welcome! To contribute:
- Fork the repo
- Create your feature branch:
git checkout -b feature/new-keywords - Commit your changes:
git commit -m 'Add new keywords' - Push to the branch:
git push origin feature/new-keywords - Open a pull request
For questions or suggestions, feel free to open an issue or contact via GitHub.