An Intelligent Email Spam Detection System Using Machine Learning and Natural Language Processing
An Intelligent Email Spam Detection System Using Machine Learning and Natural Language Processing
G. Amaladevi, Byreddi Ganesh
Avanthi’s St. Theressa Institute of Engineering and Technology
Abstract
Email spam is a persistent problem in digital communication because unsolicited advertisements, phishing attempts, malicious links, and fraudulent messages consume attention and can expose users and organizations to security risks. This paper presents an intelligent email spam detection system that combines Natural Language Processing (NLP) with supervised machine learning to classify email text as spam or non-spam. The system processes labeled email datasets through data cleaning, tokenization, stop-word removal, lemmatization, and feature-vector formation using Bag-of-Words (BoW) and Term Frequency-Inverse Document Frequency (TF-IDF). Five classifiers—Naïve Bayes, Logistic Regression, Random Forest, K-Nearest Neighbors (KNN), and Support Vector Machine (SVM)—are evaluated. The project also implements a proposed ensemble decision in which predictions from the individual classifiers are combined by majority voting. The supplied project experiments use an 80:20 training/testing split and compare models using accuracy, precision, and F1-score. The documented results show that TF-IDF performs better than BoW across the tested models and that the proposed ensemble reaches 99.0% accuracy, 98.5% precision, and 98.6% F1-score in the reported evaluation. A Streamlit interface allows users to enter email text or upload a text file and view the classification, model confidence, extracted nouns, and named entities.
Keywords: Email Spam Detection, Machine Learning, Natural Language Processing, TF-IDF, Random Forest, Ensemble Learning, Text Classification