{"id":26707249,"url":"https://github.com/machinelearningprodigy/sentiment-analysis","last_synced_at":"2026-04-28T13:35:04.116Z","repository":{"id":253627132,"uuid":"844062203","full_name":"machinelearningprodigy/sentiment-analysis","owner":"machinelearningprodigy","description":"The Twitter Sentiment Analysis app predicts whether a tweet has a Positive 😊 or Negative 😞 sentiment using Logistic Regression and Naive Bayes models. It preprocesses text with stemming and stopword removal for better accuracy and provides color-coded visual feedback for easy interpretation. ","archived":false,"fork":false,"pushed_at":"2024-08-24T02:43:21.000Z","size":18179,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T06:32:26.238Z","etag":null,"topics":["ai","notebook-jupyter","pip","python","random-forest","request","sentiment-analysis","streamlit"],"latest_commit_sha":null,"homepage":"https://sentiment-analysis-23.streamlit.app/","language":"Python","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/machinelearningprodigy.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-18T09:06:40.000Z","updated_at":"2025-02-27T19:15:47.000Z","dependencies_parsed_at":"2025-03-27T06:38:25.857Z","dependency_job_id":null,"html_url":"https://github.com/machinelearningprodigy/sentiment-analysis","commit_stats":null,"previous_names":["machinelearningprodigy/sentiment-analysis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/machinelearningprodigy/sentiment-analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinelearningprodigy%2Fsentiment-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinelearningprodigy%2Fsentiment-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinelearningprodigy%2Fsentiment-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinelearningprodigy%2Fsentiment-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/machinelearningprodigy","download_url":"https://codeload.github.com/machinelearningprodigy/sentiment-analysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machinelearningprodigy%2Fsentiment-analysis/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262406936,"owners_count":23306281,"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":["ai","notebook-jupyter","pip","python","random-forest","request","sentiment-analysis","streamlit"],"created_at":"2025-03-27T06:28:20.527Z","updated_at":"2026-04-28T13:34:59.079Z","avatar_url":"https://github.com/machinelearningprodigy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Twitter Sentiment Analysis with Streamlit 😃\n\nWelcome to the **Twitter Sentiment Analysis** project! This application allows you to analyze the sentiment of Twitter comments, predicting whether a comment is **Positive** 😊 or **Negative** 😞.\n\n## Features ✨\n\n- **Dual Model Predictions**: This app uses two powerful machine learning models:\n  - **Logistic Regression**\n  - **Naive Bayes**\n  \n- **Text Preprocessing**: The app preprocesses the input text using stemming and stopword removal to improve prediction accuracy.\n\n- **User-Friendly Interface**: Enter your comment, hit the \"Predict Sentiment\" button, and instantly see whether the sentiment is positive or negative!\n\n- **Visual Feedback**: Sentiment predictions are displayed with clear, color-coded messages and expressive emojis.\n\n## How It Works 🔍\n\n### 1. Text Preprocessing 🛠️\nThe input text goes through several preprocessing steps:\n- **Stemming**: Words are reduced to their root forms using the Porter Stemmer.\n- **Stopword Removal**: Commonly used English words that do not contribute much to the meaning (e.g., \"the\", \"is\") are removed.\n\n### 2. Model Prediction 🤖\nThe preprocessed text is then transformed using a **vectorizer** (`vectorizer.pkl`) and fed into the machine learning models:\n- **Logistic Regression Model** (`logistic_regression_model.pkl`)\n- **Naive Bayes Model** (`naive_bayes_model.pkl`)\n\n### 3. Output 🎯\nThe sentiment prediction is displayed on the screen:\n- **Positive Sentiment**: Shown with a green background and a happy emoji 😊.\n- **Negative Sentiment**: Shown with a red background and a sad emoji 😞.\n\n## How to Use the App 📝\n\n1. **Enter Your Comment**: Type in the comment you want to analyze.\n2. **Predict Sentiment**: Click the \"Predict Sentiment\" button.\n3. **View Results**: See whether your comment is predicted to be positive or negative.\n\n## Installation and Setup ⚙️\n\n1. **Clone the Repository**:\n    ```bash\n    git clone https://github.com/machinelearningprodigy/sentiment-analysis.git\n    ```\n2. **Navigate to the Project Directory**:\n    ```bash\n    cd twitter-sentiment-analysis\n    ```\n3. **Install the Required Packages**:\n    ```bash\n    pip install -r requirements.txt\n    ```\n4. **Run the Streamlit App**:\n    ```bash\n    streamlit run app.py\n    ```\n\n## Live Demo 🚀\n\nCheck out the live demo of this app here: [Twitter Sentiment Analysis](https://sentiment-analysis-23.streamlit.app/)\n\n## Acknowledgments 🙌\n\n- **NLTK**: For providing tools for natural language processing.\n- **Scikit-learn**: For machine learning model implementation.\n- **Streamlit**: For making the web app creation process simple and intuitive.\n\nHappy analyzing! 🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachinelearningprodigy%2Fsentiment-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmachinelearningprodigy%2Fsentiment-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachinelearningprodigy%2Fsentiment-analysis/lists"}