{"id":18058238,"url":"https://github.com/rizz1406/spam-email-detector","last_synced_at":"2026-04-09T23:00:44.821Z","repository":{"id":259189417,"uuid":"876545036","full_name":"rizz1406/Spam-Email-Detector","owner":"rizz1406","description":"Spam Email Classifier using Python and Streamlit  A simple machine learning project that classifies emails as **spam** or **ham** using the **Naive Bayes algorithm** and **TF-IDF** for text feature extraction. The project includes a user-friendly web app built with Streamlit","archived":false,"fork":false,"pushed_at":"2024-10-22T06:42:32.000Z","size":247,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T11:14:31.916Z","etag":null,"topics":["nlp","pandas","pytho3","scikit-learn","streamlit"],"latest_commit_sha":null,"homepage":"","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/rizz1406.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-10-22T06:40:48.000Z","updated_at":"2024-10-22T06:46:07.000Z","dependencies_parsed_at":"2024-10-23T11:06:23.188Z","dependency_job_id":null,"html_url":"https://github.com/rizz1406/Spam-Email-Detector","commit_stats":null,"previous_names":["rizz1406/spam-email-detector"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rizz1406%2FSpam-Email-Detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rizz1406%2FSpam-Email-Detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rizz1406%2FSpam-Email-Detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rizz1406%2FSpam-Email-Detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rizz1406","download_url":"https://codeload.github.com/rizz1406/Spam-Email-Detector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325701,"owners_count":20920714,"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":["nlp","pandas","pytho3","scikit-learn","streamlit"],"created_at":"2024-10-31T03:05:43.311Z","updated_at":"2026-04-09T23:00:44.764Z","avatar_url":"https://github.com/rizz1406.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Spam Email Classifier using Python and Streamlit**\n\n## Project Overview\n\nThis project demonstrates a simple **Spam Email Classifier** using Natural Language Processing (NLP) and machine learning techniques. The classifier is capable of predicting whether a given message is **spam** or **ham** (not spam) based on the message content. The model is trained on the popular **SMS Spam Collection Dataset** and is deployed via a **Streamlit** web application for easy user interaction.\n\n## Features\n\n- **Machine Learning Model**: Naive Bayes classifier\n- **Text Preprocessing**: TF-IDF (Term Frequency-Inverse Document Frequency) for feature extraction\n- **Web Application**: User-friendly interface built with Streamlit for real-time message classification\n- **Dataset**: SMS Spam Collection dataset from the UCI Machine Learning Repository\n- **Performance**: Achieved ~98% accuracy on the test data\n\n## Technologies Used\n\n- **Python**: Core language for data processing, machine learning, and web app development\n- **Pandas**: Data manipulation and analysis\n- **Scikit-learn**: Machine learning model and feature extraction\n- **Streamlit**: Framework for building a simple web interface\n- **NLP**: Natural Language Processing for text analysis and classification\n- **TF-IDF**: For converting text to numerical feature vectors\n\n## Installation \u0026 Setup\n\n1. Clone the repository to your local machine:\n   ```bash\n   git clone https://github.com/your-username/spam-classifier.git\n   ```\n\n2. Navigate to the project directory:\n   ```bash\n   cd spam-classifier\n   ```\n\n3. Install the required dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. Run the Streamlit app:\n   ```bash\n   streamlit run spam_classifier.py\n   ```\n\n5. Open your browser and go to `http://localhost:8501/`. Enter a message to classify it as **spam** or **ham**.\n\n## Dataset\n\nThe dataset used in this project is the **SMS Spam Collection** dataset, which can be downloaded from the [UCI Machine Learning Repository](https://archive.ics.uci.edu/ml/datasets/sms+spam+collection). It consists of 5,574 messages labeled as spam or ham.\n\n## Project Structure\n\n```bash\n.\n├── spam_classifier.py                 # Main Python script to run the Streamlit app\n├── spam.csv                           # SMS Spam Collection dataset (must be in this folder)\n├── requirements.txt                   # Dependencies for the project\n└── spam_classifier_project.ipynb      # Jupyter notebook with a step-by-step guide\n```\n\n## How It Works\n\n1. **Loading the Dataset**: The SMS Spam Collection dataset is loaded and cleaned. The labels (`spam` or `ham`) are mapped to binary values (1 for spam, 0 for ham).\n   \n2. **Text Vectorization**: The message content is transformed into numerical features using **TF-IDF vectorization**, which converts the raw text into a format that can be used by the machine learning model.\n   \n3. **Model Training**: A **Naive Bayes classifier** is trained using the vectorized text data. This model is known to perform well on text classification problems like spam detection.\n   \n4. **Prediction \u0026 Evaluation**: The trained model is evaluated on the test data, and metrics such as **accuracy** and **confusion matrix** are computed.\n\n5. **Streamlit Application**: The model is deployed on a Streamlit web app where users can input a message and receive a real-time prediction (spam/ham).\n\n## Example Output\n\nWhen you input a message into the Streamlit app, it will classify it as **Spam** or **Ham** based on the trained model.\n\n## Future Improvements\n\n- Enhance the UI and add more interactivity to the web app.\n- Implement additional machine learning models (e.g., SVM, deep learning models) for improved accuracy.\n- Incorporate other datasets to improve the generalization of the classifier.\n- Add NLP techniques for better preprocessing, such as lemmatization or stemming.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frizz1406%2Fspam-email-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frizz1406%2Fspam-email-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frizz1406%2Fspam-email-detector/lists"}