This project provides a GUI application to analyze the sentiment of Amazon reviews using Natural Language Processing (NLP) techniques. The application allows users to input reviews directly or fetch reviews from an Amazon product page and visualize the sentiment distribution.
- Input Reviews Directly: Users can type or paste Amazon reviews into the application.
- Fetch Reviews from Amazon: Automatically fetch reviews from an Amazon product page URL.
- Visualize Sentiment Distribution: Display a visual representation of the sentiment distribution of the reviews.
- pandas: For data manipulation and analysis. Used to load and preprocess the dataset containing Amazon reviews.
- scikit-learn: Provides tools for data mining and analysis. Includes
TfidfVectorizer
for converting text data into numerical features. - nltk: The Natural Language Toolkit for natural language processing. Uses
SentimentIntensityAnalyzer
from the VADER module for sentiment analysis. - matplotlib: For creating visualizations. Plots the sentiment distribution of reviews.
- requests: For sending HTTP requests to fetch reviews from Amazon product pages.
- beautifulsoup4: Parses HTML and XML documents to extract review text from Amazon product pages.
- tqdm: Provides a progress bar to indicate the status of fetching reviews.
- tkinter: Standard Python interface for creating the graphical user interface (GUI) of the application.
- Python 3.x
- Required Python libraries listed in
requirements.txt
-
Clone the Repository
git clone https://github.com/PayalLakra/Sentiment-Analysis-Using-Python.git cd Sentiment-Analysis-Using-Python
-
Create Virtual Environment
python -m venv venv #to create Virtual Environment .\venv\Scripts\activate #to activate virtual environment (for Windows)
-
Install the Required Python Packages
pip install -r requirements.txt
Ensure that you have the following libraries installed:
pandas
,scikit-learn
,nltk
,matplotlib
,requests
,beautifulsoup4
,tqdm
,tkinter
.
-
Run the Application
Execute the following command to start the application:
python CodeSentimentAnalysis.py
-
Using the Application
- Input Reviews Directly: Type or paste the review text into the input area and click the analyze button.
- Fetch Reviews from Amazon: Enter an Amazon product page URL and click the fetch button to retrieve and analyze reviews.
- View Results: The sentiment distribution of the reviews will be displayed visually.