{"id":24154867,"url":"https://github.com/prince2004patel/sentiment-spam-detection","last_synced_at":"2026-04-09T18:07:22.425Z","repository":{"id":271587550,"uuid":"913919685","full_name":"prince2004patel/sentiment-spam-detection","owner":"prince2004patel","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-23T15:10:57.000Z","size":39140,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-01T22:28:12.259Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://sentiment-spam-detection-by-prince.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/prince2004patel.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":"2025-01-08T15:52:04.000Z","updated_at":"2025-01-29T16:05:34.000Z","dependencies_parsed_at":"2025-01-23T15:37:57.243Z","dependency_job_id":null,"html_url":"https://github.com/prince2004patel/sentiment-spam-detection","commit_stats":null,"previous_names":["prince2004patel/sentiment-analysis-amazon-kindle","prince2004patel/sentiment-spam-detection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/prince2004patel/sentiment-spam-detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prince2004patel%2Fsentiment-spam-detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prince2004patel%2Fsentiment-spam-detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prince2004patel%2Fsentiment-spam-detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prince2004patel%2Fsentiment-spam-detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prince2004patel","download_url":"https://codeload.github.com/prince2004patel/sentiment-spam-detection/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prince2004patel%2Fsentiment-spam-detection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286079811,"owners_count":27282121,"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","status":"online","status_checked_at":"2025-11-25T02:00:05.816Z","response_time":54,"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":["flask","machine-learning","natural-language-processing","python","sentiment-analysis","streamlit"],"created_at":"2025-01-12T12:26:18.963Z","updated_at":"2025-11-25T18:05:16.974Z","avatar_url":"https://github.com/prince2004patel.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sentiment Analysis and Spam Detection\n\n## Live Demo :-\n\n[![Streamlit App](https://img.shields.io/badge/Streamlit-App-blue)](https://sentiment-spam-detection-by-prince.streamlit.app/)\n\n## Best Practices (As Suggested by Krish Naik)\n\n### 1. Preprocessing and Cleaning\n\n- **Text Cleaning**: Remove stop words, punctuation, special characters, and handle case sensitivity.\n- **Tokenization**: Split the text into individual words (tokens).\n- **Lemmatization**: Reduce words to their base or root form to improve uniformity.\n- **Removing Duplicates**: Remove duplicate entries to avoid biases in model training.\n\n### 2. Train Test Split\n\n- **Data Split**: Split the dataset into a training set (typically 80%) and a test set (20%) to evaluate the model's performance on unseen data.\n\n### 3. Feature Extraction: BOW, TF-IDF, Word2Vec\n\n- **Bag of Words (BOW)**: Convert the text into a set of features based on word frequencies.\n- **TF-IDF**: Weigh words based on their importance using term frequency and inverse document frequency.\n- **Word2Vec**: Generate word vectors that capture semantic relationships between words.\n\n### 4. Training ML Algorithms\n\n- Start with simple and effective models like **Multinomial Naive Bayes (MNB)**, and explore other algorithms like **Support Vector Machines (SVM)**, **Logistic Regression**, or **Random Forest** for more complex tasks.\n\n## Models Used\n\n### Sentiment Analysis\n\n1. **Bag of Words (BoW) with Multinomial Naive Bayes (MNB)**\n\n   - **Accuracy**: 85%\n   - This model uses the Bag of Words approach to convert text into feature vectors and then classifies sentiments using Multinomial Naive Bayes.\n\n2. **TF-IDF (Term Frequency-Inverse Document Frequency)**\n\n   - **Accuracy**: 70%\n   - TF-IDF evaluates the importance of words based on their frequency and inverse document frequency, and uses a machine learning classifier to predict sentiment.\n\n3. **Average Word2Vec**\n   - **Accuracy**: 75%\n   - This model uses Word2Vec to convert words into vectors and averages the vectors to classify the sentiment of the text.\n\n### Spam Detection\n\n1. **Bag of Words (BoW) with Multinomial Naive Bayes (MNB)**\n\n   - **Accuracy**: 98%\n   - This model uses the Bag of Words approach to convert text into feature vectors and then classifies messages as Spam or Ham using Multinomial Naive Bayes.\n\n2. **TF-IDF**\n\n   - **Accuracy**: 97%\n   - This model evaluates the importance of words and classifies messages based on term frequency and inverse document frequency.\n\n3. **Word2Vec**\n   - **Accuracy**: 94%\n   - This model uses Word2Vec to generate word embeddings and classifies the messages.\n\n## Setup Instructions\n\n### 1. Clone the Repository\n\nTo clone the repository, use the following command:\n\n```bash[\ngit clone https://github.com/prince2004patel/sentiment-spam-detection.git\n```\n\n### 2. Install Dependencies\n\nTo install the required dependencies for this project, use the following command:\n\n1. Ensure you are in the project directory:\n\n```bash\ncd sentiment-spam-detection\n```\n\n2. This will install all the necessary Python libraries required for both the Flask back-end and Streamlit front-end to work properly:\n\n```bash\npip install -r requirements.txt\n```\n\n### 3. Run the Application\n\n1. Ensure you are in the project directory:\n\n```bash\ncd sentiment-spam-detection\n```\n\n2. Start the Streamlit app:\n\n```bash\nstreamlit run app.py\n```\n\n## Some Screenshots\n\n![Kindle Sentiment Analysis](img/img1.png)\n\n![SMS Spam Detection](img/img2.png)\n\n![About This Project](img/img3.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprince2004patel%2Fsentiment-spam-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprince2004patel%2Fsentiment-spam-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprince2004patel%2Fsentiment-spam-detection/lists"}