An open API service indexing awesome lists of open source software.

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.

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.