{"id":29787878,"url":"https://github.com/farukseker/ml-spam-detection-api","last_synced_at":"2026-05-18T02:35:45.325Z","repository":{"id":305072533,"uuid":"1021840194","full_name":"farukseker/ML-Spam-Detection-API","owner":"farukseker","description":"🚀 A FastAPI-powered project that uses a trained ML model to classify incoming emails as spam 🛑 or ham 📧 in real-time. Supports CSV batch processing 📂, multi-query input 🔄, and detailed logging with usage stats 📊.","archived":false,"fork":false,"pushed_at":"2025-07-18T03:22:36.000Z","size":498,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-27T20:21:20.317Z","etag":null,"topics":["fastapi","machine-learning","model-extraction","model-train","model-training","predict-api","prediction","prediction-api","prediction-model","skicit","skicit-learn"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/farukseker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-07-18T03:18:56.000Z","updated_at":"2025-07-18T03:30:14.000Z","dependencies_parsed_at":"2025-07-18T07:34:03.985Z","dependency_job_id":null,"html_url":"https://github.com/farukseker/ML-Spam-Detection-API","commit_stats":null,"previous_names":["farukseker/ml-spam-mail-detection-api__machine-learning"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/farukseker/ML-Spam-Detection-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farukseker%2FML-Spam-Detection-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farukseker%2FML-Spam-Detection-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farukseker%2FML-Spam-Detection-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farukseker%2FML-Spam-Detection-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/farukseker","download_url":"https://codeload.github.com/farukseker/ML-Spam-Detection-API/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farukseker%2FML-Spam-Detection-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33162684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["fastapi","machine-learning","model-extraction","model-train","model-training","predict-api","prediction","prediction-api","prediction-model","skicit","skicit-learn"],"created_at":"2025-07-27T20:10:43.598Z","updated_at":"2026-05-18T02:35:45.309Z","avatar_url":"https://github.com/farukseker.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📧 Spam Mail Detection API\n\nA FastAPI-based project to detect spam emails using machine learning. This repository includes everything from training to deploying a REST API powered by a trained model.\n\n---\n\n## 🚀 Getting Started\n\n### Requirements\n\n* Python 3.8+ | dev --version: Python 3.13\n* pip\n\n### Installation\n\n```bash\npip install -r requirements.txt\n```\n\n### Running the API\n\n```bash\nuvicorn app:app --reload\n```\n\nOr using the `Procfile` (e.g., for Heroku):\n\n```bash\nweb: uvicorn app:app --host=0.0.0.0 --port=${PORT:-8000}\n```\n\n---\n\n## 📊 Dataset Overview\n\n* Dataset file: `email.csv`\n\n* Contains real-world email examples labeled as `ham` or `spam`\n\n* Mapping used in preprocessing:\n\n  ```python\n  df[\"Category\"] = df[\"Category\"].map({\"ham\": 0, \"spam\": 1})\n  ```\n\n* Total records: **\\[ADD\\_TOTAL\\_RECORDS]**\n\n  * 🟢 Ham: **\\[ADD\\_HAM\\_COUNT]**\n  * 🔴 Spam: **\\[ADD\\_SPAM\\_COUNT]**\n\n### 📈 Data Distribution\n\n![Spam vs Ham Pie Chart](docs/spam_pie_chart.png)\n\n\u003e Replace this image path with your actual chart at `docs/spam_pie_chart.png`\n\n---\n\n## 🧐 Model Information\n\n* Training notebook: `Spam Email Detection Machine Learning Train Script.ipynb`\n* Saved models:\n\n  * `models/spam_model.pkl`\n  * `models/tfidf_vectorizer.pkl`\n\n---\n\n## 🔮 API Usage\n\n### Endpoint: `POST /predict`\n\n#### Request:\n\n```json\n{\n  \"text\": \"Congratulations! You've won a free iPhone. Click here to claim.\"\n}\n\n```\n\n#### Response:\n\n```json\n{\n  \"prediction\": \"spam\"\n}\n```\n\n---\n\n## 📃 Notebooks\n\n* `notebooks/Api Example.ipynb`: Example API interactions\n* `notebooks/Spam Email Detection Machine Learning Train Script.ipynb`: Model training and evaluation\n\n---\n\n## 📁 File Structure\n\n```\n.\n├── app.py\n├── requirements.txt\n├── requirements.lock.txt\n├── Dockerfile\n├── docker-compose.yml\n├── AUTHOR\n├── data/\n│   └── email.csv\n├── models/\n│   ├── spam_model.pkl\n│   └── tfidf_vectorizer.pkl\n├── notebooks/\n│   ├── Api Example.ipynb\n│   └── Spam Email Detection Machine Learning Train Script.ipynb\n└── docs/\n    └── spam_pie_chart.png\n    └── avatar.png\n```\n\n---\n\n## 📢 License\n\nGNU Affero General Public License v3.0\n\n\n## Faruk şeker | Code ninja\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarukseker%2Fml-spam-detection-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarukseker%2Fml-spam-detection-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarukseker%2Fml-spam-detection-api/lists"}