Skip to content

SwapysProject/Sentiment_Analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Interactive Sentiment Analyzer

Project Overview

This project is an interactive web application designed to analyze the sentiment of text input. Leveraging the principles of Natural Language Processing (NLP), the application classifies text as having a positive, negative, or neutral sentiment. It provides a user-friendly interface built with Streamlit, allowing users to easily input text and receive immediate sentiment analysis results.

Sentiment analysis is a crucial technique within NLP, focusing on determining the emotional tone behind textual data. It finds applications across various domains, including customer feedback analysis, social media monitoring, brand reputation management, and understanding public opinion. This application serves as a practical demonstration of sentiment analysis in action.

Features

  • Real-time Sentiment Analysis: Instantly analyzes text input and provides sentiment classification.
  • Visual Sentiment Intensity Indicator: Utilizes a progress bar to represent the intensity of the detected sentiment.
  • Clear Sentiment Classification: Categorizes the sentiment as Positive, Negative, or Neutral, accompanied by an intuitive emoji representation for quick understanding.
  • User-Friendly Interface: Offers a clean and interactive web interface powered by Streamlit, making it accessible and easy to use for anyone.
  • Polarity Score Display: Presents the underlying polarity score, providing a numerical measure of sentiment ranging from -1 (most negative) to 1 (most positive).

Technologies Used

  • Python: The primary programming language for the application's logic and backend processing.
  • Streamlit: An open-source Python library used to create the interactive web user interface.
  • TextBlob: A Python library for processing textual data, employed for its straightforward sentiment analysis capabilities.

Setup and Local Execution

To run the Sentiment Analyzer locally, follow these steps:

  1. Prerequisites: Ensure you have Python installed on your system. It is recommended to use Python 3.7 or later.
  2. Clone the Repository: (If you are distributing this project via a repository, include this step)
    git clone [repository URL]
    cd [project directory]
  3. Create a Virtual Environment (Recommended):
    python -m venv venv
  4. Activate the Virtual Environment:
    • On Windows: venv\Scripts\activate
    • On macOS/Linux: source venv/bin/activate
  5. Install Dependencies:
    pip install -r requirements.txt
    python -m textblob.download_corpora
  6. Run the Streamlit Application:
    streamlit run streamlit_app.py
  7. Access the Application: Open your web browser and navigate to the URL provided in the terminal (typically http://localhost:8501 or http://127.0.0.1:8501).

Deployment

This application can be easily deployed using Streamlit Cloud for free. The process generally involves:

  1. Create a GitHub Repository: Host the project files ( streamlit_app.py and requirements.txt) in a GitHub repository.
  2. Sign up for Streamlit Cloud: Create an account at https://streamlit.io/cloud using your GitHub account.
  3. Deploy from GitHub: In your Streamlit Cloud dashboard, select "New app", choose your GitHub repository, branch, and specify streamlit_app.py as the main file. Click "Deploy!".

Streamlit Cloud will automatically build and deploy your application, providing you with a public URL to access your Sentiment Analyzer.

Potential Enhancements

While functional and demonstrative, this project can be further enhanced with additional features:

  • Expanded Sentiment Categories: Refine sentiment classification beyond Positive, Negative, and Neutral to include more granular categories like "Very Positive," "Slightly Negative," etc., based on polarity score ranges.
  • Advanced NLP Libraries: Explore and integrate more sophisticated NLP libraries like NLTK or spaCy for improved accuracy and handling of nuanced language, slang, and emojis.
  • Language Support: Extend the application to support sentiment analysis in multiple languages.
  • Data Visualization: Incorporate more advanced data visualizations to represent sentiment trends or summaries, especially if analyzing larger volumes of text.
  • Input from Files/URLs: Allow users to upload text files or provide URLs to analyze content from external sources.

This project serves as a solid foundation for understanding and demonstrating sentiment analysis. Its simplicity and interactive nature make it an excellent tool for educational purposes and a compelling addition to a portfolio showcasing NLP skills.

About

Click the below link for see the deployed web app of this project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages