{"id":22169190,"url":"https://github.com/blacknahil/spam-detection","last_synced_at":"2026-05-06T23:31:47.269Z","repository":{"id":253232468,"uuid":"842680956","full_name":"Blacknahil/Spam-Detection","owner":"Blacknahil","description":" A simple web application for detecting spam messages using a machine learning model. The application is built using Flask and provides an interactive interface for users to input a message and get a prediction whether it is spam or ham along with the probability.","archived":false,"fork":false,"pushed_at":"2024-08-15T10:49:06.000Z","size":46586,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T17:22:45.208Z","etag":null,"topics":["flask","html-css-javascript","pandas","scikit-learn"],"latest_commit_sha":null,"homepage":"https://spam-detection-sandy.vercel.app","language":"HTML","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/Blacknahil.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-08-14T21:04:13.000Z","updated_at":"2024-09-24T17:45:42.000Z","dependencies_parsed_at":"2024-08-15T14:19:27.013Z","dependency_job_id":null,"html_url":"https://github.com/Blacknahil/Spam-Detection","commit_stats":null,"previous_names":["blacknahil/spam-detection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Blacknahil/Spam-Detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blacknahil%2FSpam-Detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blacknahil%2FSpam-Detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blacknahil%2FSpam-Detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blacknahil%2FSpam-Detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Blacknahil","download_url":"https://codeload.github.com/Blacknahil/Spam-Detection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blacknahil%2FSpam-Detection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32716055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T19:35:05.142Z","status":"ssl_error","status_checked_at":"2026-05-06T19:35:03.996Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["flask","html-css-javascript","pandas","scikit-learn"],"created_at":"2024-12-02T06:29:18.981Z","updated_at":"2026-05-06T23:31:47.256Z","avatar_url":"https://github.com/Blacknahil.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spam Detection Web Application\n\nThis project is a simple web application for detecting spam messages using a machine learning model. The application is built using Flask and provides an interactive interface for users to input a message and get a prediction whether it is spam or ham along with the probability of being one.\n\n## Project Structure Explanation\n\n- `app.py`: Main Flask application file.\n- `train_model.py`: Script to train the spam detection model and save it.\n- `templates/`: Directory containing HTML templates.\n  - `index.html`: Main HTML file for the user interface.\n- `model.pkl`: Pickle file containing the trained machine learning model.\n- `vectorizer.pkl`: Pickle file containing the vectorizer.\n\n## How It Works?\n\n1. **Data Loading and Preprocessing**:\n   - The dataset `SMSSpamCollection` is loaded and preprocessed using `CountVectorizer` to convert text messages into numerical data.\n\n2. **Model Training**:\n   - A `MultinomialNB` (Naive Bayes) model is trained on the preprocessed data.\n   - The trained model and vectorizer are saved to disk using `pickle`.\n\n3. **Web Application**:\n   - A Flask web application is created with an endpoint to render the HTML form and an endpoint to handle predictions.\n   - Users can input a message, which is sent to the server for prediction.\n   - The server processes the input through the saved model and returns the prediction and probability.\n\n## Prerequisites\n\n- Python 3.x\n- Flask\n- scikit-learn\n- pandas\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/Teklez/AI.git\n   cd AI\n2. Install the required python packages\n\n    - Flask\n        ```bash\n        pip install flask \n\n    - scikit-learn\n        ```bash\n        pip install scikit-learn\n    - pandas\n        ```bash\n        pip install pandas\n\n# How to run our program?\n\n1. Go to the correct path which is spam_detection and run app.py\n\n    ```bash\n        cd project/spam_detection\n        python3 app.py\n\n2. Open a web browser and enetr the Url printed on the terminal when running the app.py. This url is Usually\n     ```\n        http://127.0.0.1:5000\n\n    But to avoid any trouble check out the terminal.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacknahil%2Fspam-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblacknahil%2Fspam-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacknahil%2Fspam-detection/lists"}