Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kapooraryan/sentiment-analysis-twitter
🛩️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.
https://github.com/kapooraryan/sentiment-analysis-twitter
kaggle model-deployment naive-bayes-classifier sentiment-analysis streamlit
Last synced: 28 days ago
JSON representation
🛩️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.
- Host: GitHub
- URL: https://github.com/kapooraryan/sentiment-analysis-twitter
- Owner: kapooraryan
- Created: 2023-07-12T17:06:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-12T18:36:55.000Z (over 1 year ago)
- Last Synced: 2024-10-25T14:35:14.803Z (3 months ago)
- Topics: kaggle, model-deployment, naive-bayes-classifier, sentiment-analysis, streamlit
- Language: Jupyter Notebook
- Homepage: https://sentiment-analysis-twitter-aryan.streamlit.app/
- Size: 2.94 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sentiment-analysis-twitter
🛩️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.
![Streamlit Web App](https://github.com/kapooraryan/sentiment-analysis-twitter/assets/69362333/2de288c9-e184-451e-b31d-e4ad09525b8a)
# Dataset
The 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.Find the dataset used at - [Kaggle](https://www.kaggle.com/datasets/crowdflower/twitter-airline-sentiment)
# Model Training and Evaluation
The 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.# Deployment
The 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.# Usage
To run the sentiment analysis app, follow these steps:1. Clone the repository:
```shell
git clone https://github.com/kapooraryan/sentiment-analysis-twitter.git
2. Install the required dependencies:```shell
pip install -r requirements.txt
3. Run the Streamlit app:```shell
streamlit run app.py
**Note:** Access the app in your browser at http://localhost:8501.# Requirements
- Python 3.7 or above
- pandas
- nltk
- scikit-learn
- streamlit