{"id":17699459,"url":"https://github.com/kapooraryan/sentiment-analysis-twitter","last_synced_at":"2025-03-31T01:40:59.260Z","repository":{"id":180768854,"uuid":"665646349","full_name":"kapooraryan/sentiment-analysis-twitter","owner":"kapooraryan","description":"🛩️This project is an interactive web application built using Streamlit for sentiment analysis of text data. It uses a pre-trained Naive Bayes classifier to predict the sentiment of a given text input. The application allows users to enter a text and get the predicted sentiment, whether it is negative, neutral, or positive.","archived":false,"fork":false,"pushed_at":"2023-07-12T18:36:55.000Z","size":3081,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T06:49:45.536Z","etag":null,"topics":["kaggle","model-deployment","naive-bayes-classifier","sentiment-analysis","streamlit"],"latest_commit_sha":null,"homepage":"https://sentiment-analysis-twitter-aryan.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/kapooraryan.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}},"created_at":"2023-07-12T17:06:41.000Z","updated_at":"2023-07-18T09:45:00.000Z","dependencies_parsed_at":"2023-07-16T06:16:38.413Z","dependency_job_id":null,"html_url":"https://github.com/kapooraryan/sentiment-analysis-twitter","commit_stats":null,"previous_names":["kapooraryan/sentiment-analysis-twitter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kapooraryan%2Fsentiment-analysis-twitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kapooraryan%2Fsentiment-analysis-twitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kapooraryan%2Fsentiment-analysis-twitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kapooraryan%2Fsentiment-analysis-twitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kapooraryan","download_url":"https://codeload.github.com/kapooraryan/sentiment-analysis-twitter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246403893,"owners_count":20771526,"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":["kaggle","model-deployment","naive-bayes-classifier","sentiment-analysis","streamlit"],"created_at":"2024-10-24T16:41:54.849Z","updated_at":"2025-03-31T01:40:59.215Z","avatar_url":"https://github.com/kapooraryan.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sentiment-analysis-twitter\n\n🛩️This project is an interactive web application built using Streamlit for sentiment analysis of text data. It uses a pre-trained Naive Bayes classifier to predict the sentiment of a given text input. The application allows users to enter a text and get the predicted sentiment, whether it is negative, neutral, or positive.\n\n![Streamlit Web App](https://github.com/kapooraryan/sentiment-analysis-twitter/assets/69362333/2de288c9-e184-451e-b31d-e4ad09525b8a)\n\n# Dataset\nThe sentiment analysis model is trained on a dataset of tweets. The dataset, stored in a file named tweets.csv, contains text data along with corresponding sentiment labels. The dataset is preprocessed to filter out entries with low confidence scores, and the text data is cleaned by removing stopwords, punctuation, and converting words to their base forms using lemmatization.\n\nFind the dataset used at - [Kaggle](https://www.kaggle.com/datasets/crowdflower/twitter-airline-sentiment)\n\n# Model Training and Evaluation\nThe cleaned text data is transformed into numerical features using the CountVectorizer from scikit-learn. The vectorized data is then split into training and testing sets. A Multinomial Naive Bayes classifier is trained on the training set and evaluated on the testing set. The performance of the model is evaluated using a classification report, which includes precision, recall, F1-score, and support for each sentiment class.\n\n# Deployment\nThe trained model is saved as a pickle file named sent_model.pkl. The Streamlit application loads this saved model for sentiment prediction. The application allows users to input text and obtain the predicted sentiment by leveraging the trained model.\n\n# Usage\nTo run the sentiment analysis app, follow these steps:\n\n1. Clone the repository:\n\n   ```shell\n   git clone https://github.com/kapooraryan/sentiment-analysis-twitter.git\n   \n2. Install the required dependencies:\n\n    ```shell\n    pip install -r requirements.txt\n    \n3. Run the Streamlit app:\n\n   ```shell\n   streamlit run app.py\n   \n**Note:** Access the app in your browser at http://localhost:8501.\n\n# Requirements\n- Python 3.7 or above\n- pandas\n- nltk\n- scikit-learn\n- streamlit\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkapooraryan%2Fsentiment-analysis-twitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkapooraryan%2Fsentiment-analysis-twitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkapooraryan%2Fsentiment-analysis-twitter/lists"}