Skip to content

Abh3shek/sentiment_analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages