Welcome to the Persian Email Spam Detection repository! 📧🚫
This project leverages the power of cutting-edge Machine Learning algorithms to effectively identify and classify email spam written in Persian. We employ two sophisticated word embedding algorithms for feature representation:
-
TF-IDF (Term Frequency-Inverse Document Frequency):
- A powerful algorithm capturing the importance of words in the document.
-
Frequency-based Word Embedding:
- Utilizing word frequency to understand the underlying patterns in the text.
For text preprocessing, we rely on the robust Hazm library, ensuring that our data is well-prepared for the subsequent machine learning pipeline.
Our project implements six state-of-the-art classification algorithms:
-
K-Nearest Neighbors (KNN):
- A non-parametric method for classification based on the similarity of data points.
-
Logistic Regression:
- A linear model for binary classification tasks, providing a solid baseline for comparison.
-
Decision Tree:
- A tree-like model that makes decisions based on the input features, offering interpretability.
-
Random Forest:
- An ensemble of decision trees, enhancing the robustness and accuracy of the model.
-
Naive Bayes:
- A probabilistic model that assumes independence among features, suitable for text classification.
-
Support Vector Machine (SVM):
- Although not uploaded yet, SVM will be incorporated for its effectiveness in high-dimensional spaces.
The preprocessing stage is a crucial step in our pipeline, and we employ the Hazm library to handle tasks such as stemming and tokenization. This ensures that our input data is cleaned and ready for feature extraction.
Check out our accuracy plot to get a visual representation of the performance across different algorithms.
Here's a detailed table showcasing the accuracy of each algorithm with both TF-IDF and frequency-based word embedding:
Algorithm | Accuracy with TF-IDF | Accuracy with Frequency Word |
---|---|---|
Logistic Regression | 43.5% | 97.5% |
Decision Tree | 90.0% | 93.0% |
Random Forest | 92.5% | 95.5% |
Naive Bayes | 43.5% | 75.0% |
K-Nearest Neighbors | 92.5% | 96.0% |
Feel free to explore the code and experiment with different algorithms and embeddings to enhance the performance of our Persian Email Spam Detection system. Happy coding! 🚀✨