This project is a Python-based sentiment analysis tool that utilizes Natural Language Processing (NLP) techniques to determine the sentiment of textual data. It's designed to process and interpret large datasets, categorizing each text snippet as positive, neutral, or negative based on its sentiment.
- Text data preprocessing including tokenization, case normalization, punctuation removal, and stopwords elimination.
- Sentiment analysis using NLTK's VADER (Valence Aware Dictionary and sEntiment Reasoner) tool.
- Output categorization into positive, neutral, or negative sentiments.
Ensure you have Python installed on your system. This project is tested with Python 3.8+. You also need pip
for installing Python packages.
- Clone the repository:
git clone https://github.com/yourusername/sentiment-analysis-tool.git
cd sentiment-analysis-tool
- Install the required Python packages:
pip install pandas nltk
- Download NLTK data:
import nltk
nltk.download('vader_lexicon')
nltk.download('punkt')
nltk.download('stopwords')
-
Prepare your data in a CSV format with a column named
review_text
containing the text to be analyzed. -
Run the script:
python sentiment_analysis.py
- The script will print the first few rows of the analyzed data including the sentiment type and compound score. Optionally, you can uncomment the last line in the script to save the results to a new CSV file.