{"id":18888463,"url":"https://github.com/sahiltiwariiii/email-spam-classifier","last_synced_at":"2026-04-09T18:13:28.120Z","repository":{"id":243252413,"uuid":"811913936","full_name":"sahilTiwariiii/Email-Spam-Classifier","owner":"sahilTiwariiii","description":"This model will tell you weather mail is spam or not ","archived":false,"fork":false,"pushed_at":"2024-06-07T14:58:22.000Z","size":1300,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-31T05:30:04.940Z","etag":null,"topics":["dataanalysis","datacleaning","datascience","eda","machine-learning","nlp-machine-learning","nltk","numpy","pandas","python","scikit-learn","streamlit","streamlit-webapp","tfidf-vectorizer","wordcloud-visualization","wordtovec"],"latest_commit_sha":null,"homepage":"https://email-spam-classifier-sahil.streamlit.app","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sahilTiwariiii.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-07T14:52:40.000Z","updated_at":"2024-06-07T15:10:02.000Z","dependencies_parsed_at":"2024-06-07T16:28:08.333Z","dependency_job_id":"5757dc63-2fa7-4f3d-acba-5cb8f6f8634a","html_url":"https://github.com/sahilTiwariiii/Email-Spam-Classifier","commit_stats":null,"previous_names":["sahiltiwariiii/email-spam-classifier"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahilTiwariiii%2FEmail-Spam-Classifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahilTiwariiii%2FEmail-Spam-Classifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahilTiwariiii%2FEmail-Spam-Classifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahilTiwariiii%2FEmail-Spam-Classifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sahilTiwariiii","download_url":"https://codeload.github.com/sahilTiwariiii/Email-Spam-Classifier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239859566,"owners_count":19708864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dataanalysis","datacleaning","datascience","eda","machine-learning","nlp-machine-learning","nltk","numpy","pandas","python","scikit-learn","streamlit","streamlit-webapp","tfidf-vectorizer","wordcloud-visualization","wordtovec"],"created_at":"2024-11-08T07:44:16.653Z","updated_at":"2025-10-13T07:35:33.806Z","avatar_url":"https://github.com/sahilTiwariiii.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📧 Email Spam Classification Project\n\n## Overview\nThis project focuses on building a machine learning model to classify emails as spam or not spam using natural language processing (NLP) techniques. The dataset used is the [SMS Spam Collection Dataset](https://www.kaggle.com/uciml/sms-spam-collection-dataset) from Kaggle, which contains 5572 SMS messages labeled as spam or ham (not spam).\n\n![Problem Statement](images/front.png)\n\n\n## Motivation\nSpam emails are a significant issue, causing inconvenience and security risks. This project aims to develop an effective spam classification model to help filter out unwanted messages, enhancing email security and user experience.\n\n## Problem Statement\nThe goal is to classify emails as spam or ham using various NLP and machine learning techniques, focusing on achieving high precision to minimize false positives.\n\n## Not Spam Email\n![Model](images/m.png)\n\n## Success Metrics\nThe performance of the models is evaluated using the following metrics:\n- **Accuracy**\n- **Precision**\n\n## Spam Email\n![Spam Email](images/spam.png)\n\nGiven the imbalanced nature of the dataset, precision is prioritized over accuracy.\n\n## Methodology\n1. **Data Cleaning** 🧹\n   - Removed duplicates, handled missing values, and transformed the text data.\n\n2. **Exploratory Data Analysis (EDA)** 📊\n   - Analyzed the distribution of spam and ham emails.\n\n3. **Text Preprocessing** ✍️\n   - Converted text to lower case, removed stop words, and applied stemming.\n\n4. **Vectorization** 🧮\n   - Used Bag of Words (BoW) and Term Frequency-Inverse Document Frequency (TF-IDF) techniques for text vectorization.\n\n5. **Model Building** 🛠️\n   - Implemented various models including:\n     - **Multinomial Naive Bayes**\n     - **Bernoulli Naive Bayes**\n     - **Gaussian Naive Bayes**\n\n6. **Evaluation** 📈\n   - Evaluated models based on accuracy, precision, \n\n7. **Improvement** 🔧\n   - Tuned hyperparameters and tried different vectorization techniques to improve performance.\n\n8. **Website** 🌐\n   - Built a user-friendly web interface using Streamlit.\n\n9. **Deployment** 🚀\n   - Deployed the application on Streamlit Cloud.\n\n## Best Model\nThe **Multinomial Naive Bayes** model performed best in terms of precision, making it the chosen model for this project. Despite BernoulliNB and GaussianNB showing better overall performance, the high precision of MultinomialNB makes it more suitable for our needs.\n\n## Dataset\nThe raw dataset contained 5572 rows and 5 columns. After data cleaning and EDA, the focus was on two columns:\n- **target**: The label indicating if the message is spam or ham.\n- **transformed_text**: The cleaned and preprocessed text of the message.\n\n## Requirements\nThe following libraries were used in this project:\n- Streamlit\n- NLTK\n- Pandas\n- Numpy\n- Scikit-learn\n- Wordcloud\n\n## Steps Followed\n1. **Data Cleaning** 🧹\n2. **EDA** 📊\n3. **Text Preprocessing** ✍️\n4. **Model Building** 🛠️\n5. **Evaluation** 📈\n6. **Improvement** 🔧\n7. **Website** 🌐\n8. **Deployment** 🚀\n\n## Conclusion\nThis project successfully built an email spam classifier with high precision using the Multinomial Naive Bayes model. The application is deployed and accessible through a user-friendly Streamlit interface.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahiltiwariiii%2Femail-spam-classifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsahiltiwariiii%2Femail-spam-classifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahiltiwariiii%2Femail-spam-classifier/lists"}