https://github.com/abh3shek/sentiment_analysis
A simple web app built with Streamlit that predicts the sentiment of a text as Positive or Negative. Uses NLTK for text preprocessing (stopword removal & stemming) and a trained Naive Bayes model for prediction. Works on movie reviews and general statements.
https://github.com/abh3shek/sentiment_analysis
multinomial-naive-bayes naive-bayes-classifier nlp sentiment-analysis streamlit
Last synced: 5 months ago
JSON representation
A simple web app built with Streamlit that predicts the sentiment of a text as Positive or Negative. Uses NLTK for text preprocessing (stopword removal & stemming) and a trained Naive Bayes model for prediction. Works on movie reviews and general statements.
- Host: GitHub
- URL: https://github.com/abh3shek/sentiment_analysis
- Owner: Abh3shek
- Created: 2025-10-29T12:58:07.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-10-29T13:51:24.000Z (8 months ago)
- Last Synced: 2025-10-29T15:16:22.036Z (8 months ago)
- Topics: multinomial-naive-bayes, naive-bayes-classifier, nlp, sentiment-analysis, streamlit
- Language: Jupyter Notebook
- Homepage: https://nb-nlp-sentiment-analysis.streamlit.app/
- Size: 44.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sentiment Classifier
A simple web application built with **Naive-Bayes, nltk & Streamlit** to predict the sentiment of text as **Positive** or **Negative**. Originally trained on movie reviews, but it can handle general text statements as well.
## Features
- Text preprocessing using **NLTK**:
- Lowercasing
- Removing HTML tags and special characters
- Stopword removal
- Stemming with **Porter Stemmer**
- Sentiment prediction using a pre-trained **Naive Bayes model**
- Real-time predictions via a **user-friendly Streamlit interface**
## Installation
1. Clone the repository:
```
git clone https://github.com/Abh3shek/sentiment_analysis.git
cd sentiment_classifier
```
2. Create a virtual environment (optional but recommended):
```
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
```
3. Install Dependencies:
```
pip install -r requirements.txt
```
4. Ensure the `Model/` contains:
```
- vectorizer.joblib
- model.joblib
```
5. Run:
` streamlit run app.py
`
Open your browser at the URL provided (usually http://localhost:8501) and enter a text to get the sentiment prediction.