Batch-17 Report Final
Batch-17 Report Final
INTRODUCTION
In the new age of the internet, shopping over the web has changed the consumers' buying behaviors.
With numerous websites like Amazon offering millions of products, customers' reviews now play a
very important role in decision-making. Reviews offer users significant insights regarding a product's
quality, robustness, useability, and general satisfaction by the customers. Yet, there are too many
reviews to take care of and it becomes tricky for the end-users to evaluate them manually to gather
relevant data.
Conventional sentiment analysis methods, including lexicon-based methods and simple machine
learning classifiers, tend to find it challenging to handle subtle linguistic structures, sarcasm, and
blended sentiments found in reviews by customers. In addition, they are not capable of creating
human-like summaries of highlights, which can complicate the process of extracting actionable insights
from unprocessed sentiment scores.
In response to these difficulties, this project proposes an intelligent product review assessment
system based on LLMs. Through powerful NLP abilities, the system picks out important conclusions,
summarizes opinion, and groups advantages and disadvantages of a specified product from customer
reviews. The system seeks to give users concise and organized access to customer sentiment, saving
them time and energy to manually scan numerous reviews.
In today's digital market, consumers depend significantly on product reviews to determine the
quality and reliability of a product prior to purchase. Manually sorting through hundreds or thousands
of reviews is time-consuming and not feasible. Key information regarding a product can be lost in
lengthy review threads, causing biased or partial decision-making.
● Pull out pros and cons from several reviews and present them in a readable manner.
● Provide framed insights to assist consumers in making more informed purchasing decisions.
With this system, we will provide better user experience, save time, and make better decisions by
providing high-accuracy automated review summarization.
The goal of this project is to create a strong and smart product review assessment system that can:
● Retrieve customer reviews automatically from online shopping sites such as Amazon.
● Employ advanced LLMs to identify the sentiment of the reviews with high accuracy.
● Create an interactive web-based program through which a user can input a product name and
get real-time review analysis.
By doing so, this system will really make online shopping easier by enabling users to easily know
the advantages and disadvantages of a product quickly without manually reading several reviews.
2
1.3 PROJECT DOMAIN
The goal of this project is to create a strong and smart product review assessment system that is able
to:
● Utilize powerful LLMs to assess the sentiment of the reviews with high accuracy.
● Create an interactive web application in which users can input a product name and get
real-time review analysis.
By doing these, this system will greatly improve online shopping experiences through aiding users
to grasp the advantages and disadvantages of a product quickly without reading multiple reviews
personally.
The project scope is wide and encompasses various data collection, analysis, and visualization
aspects to make meaningful observations from product reviews. The most important parts of the project
scope are:
○ Product reviews scraping from Amazon through web scraping tools such as
BeautifulSoup or Scrapy.
3
○ Normalizing text to improve the performance of the sentiment analysis model.
○ Categorizing review aspects into Pros & Cons for better user understanding.
1.5 METHODOLOGY
The project executes through an organized approach which optimizes the efficient process of
collecting data while analyzing and visualizing customer feedback. The project begins with collecting
product reviews through Amazon web scraping tools including BeautifulSoup or Scrapy. Data
extraction comes from review text together with ratings and reviewer information and timestamp as
extracted data gets stored in a structured format. The text goes through data preprocessing which
includes the removal of duplicate entries with normalization of words through stopword filtering and
special character and irrelevant content removal. The accuracy of the sentiment analysis model
increases because of this step.
The preprocessed data goes through sentiment analysis with LLMs as the next stage. The system
implements GPT API capabilities from OpenAI to identify review sentiments which result in positive
or negative or neutral classifications. User opinions serve as the basis for the model to identify both
positive aspects and negative aspects of products. The processed data enables visualization by
simplifying multidimensional insights which show trends of sentiment in addition to product benefits.
Through Django-based web application development the user gains access to immediate review
analysis capabilities for entered product names. The system displays its results using interactive
displays which combine graphical information with tables alongside descriptive text for better user
comprehension. The system design ensures it delivers significant information that is related to the user's
needs and simple to produce for enhancing their purchasing decisions.
4
1.6 ORGANIZATION OF THE REPORT
This document follows a logical structure of six chapters to showcase the essential information about
the project. Chapter 1: Introduction offers a project overview through its coverage of project
background together with problem statements and objectives in addition to project domain and scope.
The text highlights that an automated product review evaluation system stands essential while LLMs
function as effective tools for sentiment analysis. The second chapter presents an analysis of present
sentiment analysis methods and traditional machine learning methods along with the benefits of using
LLM-based models. The chapter conducts a comparative assessment of different methods while
indicating the fundamental reasons behind using high-level NLP techniques in this project.
The methodology section in Chapter 3 explains how the project executed its steps including data
gathering and preparation followed by sentiment analysis before concluding with visualization
procedures. The section demonstrates the web scraping method for data acquisition and explains the
LLM-based sentiment analysis process before detailing result presentation standards for optimization.
The technology stack coupled with system architecture as well as database design and web application
development form the core content of Chapter 4. The report introduces the adopted backend and
frontend technological components for creating the platform alongside its performance optimization
methods.
The system data and technical assessments with case examples together with implementation
obstacles are included in the Chapter 5 Results and Discussion section. The analysis evaluates both the
model performance and effectiveness when analyzing real product reviews. The conclusion section
outlines project achievements alongside suggestions for platform enhancement through more
e-commerce platform integration and multilingual analysis improvements because of additional AI
methods for review understanding. This report provides an organized structure which ensures both
readability and completeness of information about project aims and methodology and findings.
5
CHAPTER 2
LITERATURE REVIEW
The document takes a comprehensive approach to investigate recent scholarly research publications
which relate to the project subject. The review examines key knowledge about this topic together with
technological advancements and procedural developments. The evaluation of multiple methods
alongside their models enhances knowledge about contemporary practices while pinpointing
unaddressed problems and new possibilities for research development. The research builds its project
context through previous study knowledge which allows positioning within the wider perspective.
A Sentiment Analysis of Product Review Data Through Large Language Models (LLMs) (2024) -
IEEE Xplore: The author, Himanshu Sinha, performed a comparative analysis of BERT and TF-IDF for
sentiment analysis on a dataset of 59,794 Amazon reviews using LLMs in 2024. The reviews were
labeled as positive, negative, and neutral sentiments, and the models were compared on important
metrics like accuracy, precision, recall, and F1 score. Surprisingly, TF-IDF performed better than BERT
and attained a 15.59% improvement in accuracy, implying that in specific situations, age-old techniques
continue to be immensely useful. The current research establishes the groundwork for more accurate
sentiment prediction models and presents opportunities to further explore powerful techniques such as
ensemble learning towards better performance and fewer prediction mistakes.[1]
Sentiment Analysis of Product Reviews Using Machine Learning and Pre-Trained LLM (2024) - Big
Data Cognitive Computing: The integration of machine learning and large language models (LLMs) in
artificial intelligence plays a crucial role in sentiment analysis by enabling the transformation of
unstructured textual data into categorized sentiments such as positive, negative, or neutral. These
intelligent systems can automatically detect emotional cues and contextual meanings within the text,
allowing them to deliver in-depth sentiment interpretations without the need for human intervention. By
leveraging advanced natural language understanding, LLMs enhance the precision and scalability of
sentiment analysis, making it a powerful tool for businesses to gauge public opinion, monitor brand
perception, and make data-driven decisions.[2]
Customer Sentiments in Product Reviews: A Comparative Study with GooglePaLM (2024) - Natural
Language Processing Journal 6: The research compares the performance of generative models such as
GPT-3.5 and LLaMA-2 with transformer-based classifiers like BERT and RoBERTa to compare their
6
performance in evaluating customer satisfaction in e-commerce from product reviews. The research
analyzes performance metrics of these models before and after domain-specific data fine-tuning which
encompassed accuracy and F1-score measurements and contextual awareness metrics. Researchers seek
to determine the difference between basic sentiment polarity detection and deeper recognition of
emotions that span from frustration through excitement to bridge the gap between emotion
understanding and sentiment analysis. This evaluation examines how LLMs perform few-shot and
zero-shot learning while using attention mechanisms to explain model behavior for creating more
effective customer-oriented e-commerce strategies.[3]
The Rise of Large Language Models in Automatic Evaluation (2024) - Thomson Reuters Blog: This
article discusses the increasing function of LLMs in automating assessment tasks across various fields. It
examines how LLMs improve accuracy, uniformity, and speed in evaluating text-based material like
legal documents, academic papers, and financial reports. Employing advanced NLP methods, LLMs
drastically cut down on the necessity for human intervention, making large-scale evaluation tasks more
efficient. The research further considers the capabilities and constraints of these models, pointing out
that they hold the promise to transform the evaluation process while stressing the need for continuous
improvement to tackle issues related to bias, transparency, and equity in computerized grading.[6]
Extracting marketing information from product reviews: A comparative study of latent semantic
analysis and probabilistic latent semantic analysis (2023). Unger comments and feedback offered by
consumers deliver authentic knowledge about customers since they present real opinions and specific
experiences. Through social media platforms combined with product review pages and discussion
boards companies achieve better understanding of customer requirements and tastes and their
encountered issues. Companies should conduct systematic analysis of UGC to perform trusted market
7
surveillance while discovering emerging industry trends and digital innovation opportunities. By
utilizing UGC businesses enhance their operational strategies and enhance customer relationships which
leads to better customer loyalty and satisfaction in competitive internet settings.[9]
8
CHAPTER 3
PROJECT DESCRIPTION
In the modern e-commerce marketplace buyers depend on product reviews as a basis for making
intelligent purchasing decisions. The present review analysis framework proves both useless and
complicated to implement. Customers must examine hundreds or thousands of customer reviews
manually in order to obtain essential insights regarding a product. Receiving information through
e-commerce sites usually displays average star ratings (e.g., 4.5/5) without providing real opinions or
lists of pros and cons. The traditional approaches in sentiment analysis including rule-based and
lexicon-based systems exhibit limitations in processing sarcasm and mixed emotions together with
domain-specific words. Machine learning-based classifiers produce insufficient sentiment predictions
because they both lack domain-specific understanding and functional capabilities.
Constructing reviews manually lacks proper organization which makes it difficult for users to
extract essential information without delay. The keyword filtering methods offered by websites fail to
produce proper general sentiment summaries. Decision-making suffers from inadequate functionality
because the system lacks intelligent summarization abilities as well as clear structured insights along
with pros-and-cons extraction capabilities. Users need an AI-based solution that can conduct automatic
reviews followed by summary preparation for displaying key insights in a straightforward manner.
LLMs enable this proposed review analysis system to conduct sophisticated sentiment analysis and
summarization of product assessments. The system utilizes an automatic review scraping process from
Amazon which allows NLP technologies with leading methods to analyze and extract meaningful
insights from the text content. The system uses a different approach which detects meaningful context
while spotting sarcastic remarks and compiling necessary product benefit and drawback information
from user comments.
Through a structured method the system provides users with condensed and impactful summaries
9
of what customers express. Users need to enter their product search term into the internet interface for
the system to generate an instant response.
● Users will find a compiled list of advantages and disadvantages from product reviews within
the system.
● The system presents customers with a brief evaluation that contains the most important
points customers mentioned in their reviews.
● Bar charts together with trends in sentiment and word clouds help users understand
information better.
The system implements deep learning technology for sentiment analysis and review summarization
which boosts both accuracy and efficiency of online review examination. The user-friendly Django
web platform allows consumers to interact and experience better purchasing choices through authentic
customer feedback.
3.2.1 ADVANTAGES
The proposed system delivers enhanced advantages when compared to standard review assessment procedures.
○ Reading manually through multiple reviews becomes unnecessary with this system design.
○ The system detects sarcasm together with conflicting viewpoints and domain-specific emotional
expressions.
10
● Automated Pros & Cons Extraction:
○ Users gain quick access to product advantages and drawbacks through this system.
○ The system provides enhanced user experience through its well-organized interactive display.
○ The system shows potential for expansion that will support the development of
different e-commerce platforms in upcoming periods.
● Enhances Decision-Making:
○ The summaries resolve confusion that arises from biased or extended review content.
A feasibility study is conducted to assess the viability of the project and analyze its strengths and
weaknesses. In this context, the feasibility study is conducted across three dimensions:
• Economic Feasibility
11
• Technical Feasibility
• Social Feasibility
The cost efficiency prediction for this project remains positive because it establishes efficient
solutions for consumers and businesses at scale. The development costs mainly involve:
● Users can obtain free or low-cost APIs that help extract reviews through web scraping
tools.
● The system uses OpenAI’s API with its flexible price plans to perform sentiment analysis
through LLM.
● The Django web application requires hosting together with maintenance services.
● The system operates without needing high-end infrastructure because it functions through
cloud-based AI services. This solution serves businesses by merging with their platforms
which increases customer engagement as well as strengthens product feedback evaluation
and improves marketing plan optimization. The solution holds opportunities for financial
gain through subscription plans and API connections with e-commerce services alongside
premium analytical information sales.
The project is technologically viable with the presence of sophisticated AI models, web scraping
libraries, and scalable web frameworks. The most important parts of the system are:
● Web Scraping Libraries (BeautifulSoup, Scrapy): Utilized to scrape product reviews from
Amazon effectively.
● LLMs (OpenAI GPT API): Utilized for sentiment analysis, pros/cons extraction, and
summarization.
12
● Python & Django Framework: Utilized for creating the backend web application.
● Database (SQLite/PostgreSQL): Employed for data storage and handling of extracted review
data.
Because all these technologies are popular, well-documented, and supported, the creation and
deployment of this system are very possible with little technical risk. Moreover, cloud-based APIs
provide scalability so that the system can process a huge number of product reviews without the need
for high-end hardware.
The project is highly socially feasible because it is catering to an actual problem that internet
shoppers face. Consumers get confused with too many product reviews, and hence they experience
decision fatigue. The system, by offering automated, neutral, and easily comprehensible insights,
enhances the shopping process as a whole.
Besides, the project also encourages consumer consciousness and transparency since it ensures
product reviews are critically analyzed. It also favors online businesses by boosting customer trust,
product recommendations, and lowering return rates. The system is also in line with today's trends in
AI automation, hence relevant and socially acceptable for mass usage.
In addition, the possible future development of this project—like multi-lingual capability and
accessibility options—can cause it useful for international consumers, enhancing its reach on diverse
consumer bases.
An effective system is crucial for any computational task. It's important to have the correct
hardware and software components to ensure everything runs smoothly. From strong processors to
13
essential software packages, each part helps create an efficient environment for data analysis and
machine learning tasks
● Libraries and Frameworks: BeautifulSoup, OpenAI API, NumPy, Pandas, Matplotlib, Seaborn, D3
14
CHAPTER 4
PROPOSED WORK
Figure 4.1 shows the overall system architecture that shows how the various components interact
with each other to carry out product review evaluation. The user interacts with the frontend by passing a
product name, and this is processed by the Django-based backend. The backend invokes a web scraping
module that scrapes reviews from Amazon and pushes the gathered data to the API for sentiment
analysis. The computed output, in the form of a list of pros and cons with their frequency of mentions, is
then formatted and sent to the frontend to be displayed. This architecture allows for smooth data flow and
modular task execution.
Multiple diagram and model designs represent different system features during the design phase
which describes its components while detailing data structures and user communication paths. These
diagrams including UML together with sequence and use case and data flow enable stakeholders and
developers to understand the system design and functionality. During the design phase reality plays an
essential role in ensuring that the software solution delivers its specified requirements effectively while
being efficient.
15
4.2.1 DATA FLOW DIAGRAM
This Figure 4.2 illustrates the data flow in the system, starting from the user's entry of a product
name. This entry is passed to the backend server, which invokes the scraping module to fetch product
reviews. The retrieved reviews are then fed to the LLM-based sentiment analyzer, which gives back
structured pros and cons. These are then returned to the server and shown to the user on the frontend.
The figure illustrates quite vividly the flow of data between modules and the change it experiences at
every step.
16
4.2.2 UML DIAGRAM
The Figure 4.3 represents the UML component diagram of the system, highlighting the interaction
between different modules. It includes the user interface for collecting input and displaying results, the
controller for managing logic, the scraper for retrieving reviews, and the LLM component for
processing sentiments. Each module is represented as an independent component, yet connected to
ensure smooth operation and integration. This modular structure supports easier maintenance and
scalability.
17
4.2.3 USE CASE DIAGRAM
The diagram in Figure 4.4 illustrates the users and the system interaction. The main system
participant who does the interacting is the user who performs operations including product entry then
gets feedback from analysis. The system performs three functions including scraping reviews to
analyze the content through language modeling and displaying structured outputs. The Figure 4.4
shows how the system handles error handling and no results scenarios as complementing features that
facilitate the full depiction of user interactions.
The sequence diagram depicts the order of interaction among the various components of the system
under a normal user request. It begins with the user providing a product name, which is received in the
frontend and forwarded to the backend. The backend invokes the scraper, then sends the data to the
LLM API for processing. Once the results are returned, the backend structures the data and sends it
back to the frontend to display. This chart shows the time order and communication among components
in satisfying the user request.
19
4.3 MODULE DESCRIPTION
The following modules form the core components of our data processing and analysis pipeline, each
serving a distinct yet interconnected role in product review evaluation using large language models.
The Product Input Module serves as the interface for users to enter the product they want to
conduct research on. It enhances the user experience by confirming input, requiring users to enter
normalized text, and giving autocompleted options based on user searches or publicly available
Company APIs. Once the product name is entered, the details are sent to the server for processing.
The Server Module is the other main module that is responsible for storing product data, handling the
requests, communicating with APIs, and returning the completing data back to the Application
Module. The Server works as an intermediary and ensures data integrity by using structured
databases to store data such as PostgreSQL, and for NoSQL data stores such as MongoDB, the
Server will use authentication and secure protocols to prevent security vulnerability. The server will
also provide support for third-party APIs to pull product information from external databases in
real-time.
To extract information related to products from various web sources, the Web Scraper Module
will automatically extract data using packages like BeautifulSoup, Scrapy, or Selenium for content
that is generated dynamically. The information that is extracted includes product specifications,
descriptions, and prices from e-commerce sites and discussion boards, and organizes the information
into a neat and usable format. Because there are anti-bot detection mechanisms on most of the sites,
the Web Scraper uses user-agent rotation, proxy management, and CAPTCHA solving algorithms to
extract data efficiently. Once the product information is scraped, the Fetch Products Module fetches
products accordingly to the specified user query, using search algorithms like fuzzy matching, full
text search, or ranking algorithms using machine learning. The Fetch Products Module will scrape
both locally stored data and remotely available data using the various e-commerce APIs to provide
complete results to the user. Caching and pagination are also used to improve performance on bigger
20
data sets.
21
4.3.3 FETCH REVIEWS MODULE
After the product has been identified, the Fetch Reviews Module collects all the reviews available
from multiple sources such as e-commerce websites, review sites, and social media forums. Reviews
are fetched using both web scraping and API-based methods to ensure only authentic reviews and
property of any feedback are taken into consideration. To enhance the validity of the data quality, this
module removes any duplicates, spam. or promotional content while the meta-data is extracted (i.e.
user rating, timestamp, and/or verified purchase tags). It also cleans up the text data for additional
sentiment analysis using NLP methods such as tokenization removing stop words and/or
lemmatization. Altogether, a solid system is being built for product sentiment analysis using these
modules, supporting easy data collection, storage and processing to yield informative results.
Implemented in Django, the Server Module is a central module that manages exchange of data,
processing requests, as well as interactions amongst elements of the system. Django is a high-level web
framework written in Python and creates a reliable, scalable and secure backend stack for
product-oriented data. The server manages storing user input, managing product data, communicating
with external APIs, and interacting seamlessly with the web scraping and review-fetching modules.
To summarize, the Django Server Module is organized based on the MVC paradigm, and in this
case the models act as the representation of the database schema, the views are components of the
application that we use to handle HTTP requests, and controllers (Django views and serializers) are
concerned with the business logic and conversion of data. The database comes in the form of
PostgreSQL, which is a relational database that allows for efficient storage of data and retrieval. For
developers, the Django ORM makes interacting with the database easier by allowing them to write
database queries in Python rather than SQL. Models will hold the structured data of products, including
their product name, product category, product specifications, and metadata about reviews.
When a user inputs a product name from the frontend, the request is passed to Django's views as
API endpoints that are created using DRF. Product-related APIs accept requests with names before
validating input and returning found records from the database or routing information to Fetch
Products Module. The server will initiate real-time scraping through third-party APIs accessed from
shopping platforms like Amazon, Flipkart and Walmart when the database produces no results. The
22
server module will implement Celery as an asynchronous task queue together with integration to
support background scheduling of web scraping jobs and periodic product information updates.
The server module enables data processing through secure operations by using the JWT system
(JSON Web Tokens) for authentication and authorization tasks. The authentication process happens
before sending sensitive requests to check for user identity. The server implements rate limiting
capabilities to stop malicious use of server resources simultaneously with Redis product caching to
decrease database search delays while enhancing speed. The built-in security features of Django will
protect against multiple vulnerabilities including SQL injection attacks alongside XSS and CSRF in
order to maximize system security protection.
The server module allows easy communication between the Web Scraping Module and Fetch
Reviews Module. The server starts an asynchronous data collection process through Fetch Reviews
Module after the user selects a product. The server takes processed data from extraction and returns it
to its storage facility in the database for future sentiment evaluation. The server makes use of
pagination combined with batch processing to handle large review data amounts efficiently which
allows real-time consumer insight analysis and retrieval support.
The Server Module in Django operates as the central component of a sentiment analysis system by
managing data processing efficiently and offering secure API access while implementing databases
and linking to additional project modules. The system's complete foundation depends on both high-
level data processing support as well as third-party API support and asynchronous processing capacity.
Text reviews about a product undergo Natural Language Processing (NLP) Module sentiment
analysis for product sentiment detection. The AI-based approaches found within the module assist in
achieving exact sentiment identification results. The GPT Model Integration applies GPT models to
conduct review assessment before generating sentiment output. Customers can rely on these models
because they demonstrate exceptional context parsing abilities together with accurate detection of
subtle sentiment patterns including sarcasm and hidden meanings. The module includes Hugging Face
Model Integration to retrieve pre-trained transformer-based models BERT, RoBERTa and DistilBERT
among others. Through sentiment analysis data training these transformer models operate at high
levels of accuracy for classifying reviews into positive and negative or neutral categories. The last
23
section employs NLTK Processing that leverages NLTK to conduct text preprocessing alongside
fundamental sentiment evaluation by tokenizing sentences and doing stop word removal and word
normalization while using pre-defined dictionaries for sentiment scoring. The strength and adaptability
from combining these three methods creates an effective sentiment analysis system that operates well
on various formats of reviews across different languages.
Here, we build a high-quality recommendation system with Django as the backend framework for
communicating with Google Shopping API. The system allows users to input a product name
through the frontend interface, and the frontend interface will send the request to the Django
backend through an API endpoint. The backend receives the request, formats it in the required way,
and sends it to the Google Shopping API to gather recommendation data for products that meet the
user input. Google Shopping will send a list of products that closely match the original user input,
including key product information such as the product name, price, product description, image URL,
website links to buy the product, and any other possible relevant recommendations. The Django
backend then receives this data from Google Shopping and formats it accordingly and sends it back
to the frontend in a human-readable format (e.g., JSON). The frontend then can process these
recommendations into the user interface and displays these suggestions, creating an interactive
shopping experience. This approach benefits from the request-handling capabilities of Django and
the extensive product database of Google shopping to provide dynamic accurate shopping
recommendations to users to be able to make purchases more informed when it comes to buying
decisions.
24
4.3.7 OUTPUT MODULE
The information produced by the NLP module circumvents the need for customers to spend hours
reading product reviews. Through sentiment classification, the NLP module serves information on the
positive and negative attributes of the product being reviewed, which is crucial in deciding about a
product or service. The pros and cons of a product are compiled from similar positive and negative
phrases based on customer commentary. The pros and cons of the product are displayed in a table
format for easier access. In addition to the structured review information, dashboards using D3.js are
used to allow customers to quickly see the distribution of positive, negative and neutral sentiments
among all the reviewed products. Based on the trends in product sentiment and comparisons of
features, our system additionally recommends other products that meet the same product specifications
and product positive reviews based on comparative reviews, to assist consumers in selecting the best
product to meet their needs. With a combination of tables of structured or tabular information, data
visualization analytics, and thoughtful recommendations based on customer product sentiment,
customers will not only understand the sentiment behind reviews on products, but will also be given
many alternative suggestions for more favorable purchase choices.
25
CHAPTER 5
IMPLEMENTATION
26
5.2 PROS AND CONS TABLE OF LOGITECH MX MASTER 3S
The picture shows a well-structured pros and cons table for the Logitech MX Master 3S mouse.
The column for pros mentions advantages like ergonomic form factor, customizable buttons,
MagSpeed scroll wheel, extended battery life, and quiet clicks.
27
5.3 USER RATINGS AND ALTERNATIVES FOR LOGITECH MX MASTER 3S
The screenshot features a pie chart titled "User Ratings" with a legend that states green for pros,
red for cons, and yellow for other. The chart is largely green, which means high positive user
reviews. Underneath it, a "Recommended Alternatives" area recommends two alternatives
28
CHAPTER 6
The system suggested here is an end-to-end sentiment analysis pipeline for the automated
assessment of product reviews. In contrast to conventional systems, it facilitates real-time analysis
without the need for manual reading and classification of customer feedback. The entire process—from
accepting a product name input, scraping Amazon reviews with BeautifulSoup (bs4), and analyzing the
content using GPT-based sentiment models—has demonstrated high accuracy and resilience in both
detecting subtle feedback and rendering it in a user-friendly format.
● Aspect-based sentiment analysis to emphasize features such as price, quality, delivery, etc.
The output of this pipeline is presented in a Django-based interface where consumers can easily
browse through pie charts, line graphs, and highlighted summaries. This enhances consumer
decision-making by offering an organized overview of product sentiments. The integration of GPT API
also supports context-based language processing, sarcasm, colloquial language, or multilingual reviews
with ease. The system as a whole has high responsiveness, correct classification, scalability, and the
capacity to process multilingual reviews, hence ideal for today's e-commerce websites.
The entire process starts with a basic user input—usually the name of a product. This initiates a
Django backend procedure that employs BeautifulSoup (bs4) to extract current user reviews from
Amazon in real-time. The gathered raw data is preprocessed and organized into pieces before being
transferred to the GPT-based sentiment analysis module. The final outcome is then presented graphically
29
in the user interface, such as pie charts, sentiment overviews, and individualized suggestions. Each
element in this pipeline talks to other elements effectively to enable efficient execution of jobs and low
latency in output production.
Sentiment analysis is built on a highly developed prompting technique when communicating with the
GPT API. Rather than simply requesting sentiment scores, prompts are devised to obtain pros, cons,
recommendations, and sentiment types from every set of reviews. As an example, the model is prompted
to discern typical themes, provide summaries, and offer suggestions. Prompting is dynamic and varies
according to review length and organization, maintaining the outputs contextually relevant and pertinent.
In contrast to conventional polarity classification, the suggested system uses aspect-based sentiment
analysis. It identifies and analyzes individual aspects of the product—such as build quality, delivery
service, price, packaging, or usability—and categorizes sentiments across each of these aspects. This
provides more comprehensive information on what areas customers are satisfied or not satisfied with,
enabling consumers as well as manufacturers to take precise action.
The system as proposed shows a considerable improvement in speed and accuracy over manual
sentiment tagging or simple keyword-based models. It is able to handle more than 100 reviews in
seconds via the GPT API, with an estimated sentiment classification accuracy of more than 90% based
on manual cross-validation. The web scraping module is efficient in fetching reviews, and the
Django-based UI provides quick results even with larger datasets. Response time from product input to
complete sentiment visualization is under 15 seconds on average.
30
6.6 VISUALIZATION OUTPUT SAMPLES
The Django interface presents dynamically the processed results through intuitive visual
representations. Pie charts reflect sentiment distributions, line graphs present sentiment over time, and
tables enumerate the main pros and cons of each product. Users are also presented with a brief summary
and an AI-derived recommendation based on overall sentiment. Such visualizations dramatically
enhance user interaction and understanding.
The system is also scalable and can be expanded to include products from various platforms or in
various languages. The multi-language ability of GPT makes the processing of Hindi, Spanish, and other
language reviews possible without the need for individual models. The system's modular design also
makes upgrades simple—such as the addition of scraping sources, or the integration of newer LLMs
when released.
● Data Preprocessing:
○ The raw text is cleaned to eliminate noise such as HTML tags, special characters, and
non-English words.
○ The cleaned text is tokenized and categorized for analysis.
31
○ Judge the overall sentiment.
○ Provide recommendations to prospective buyers.
○ Classify each review as positive/negative/neutral in terms of sentiment.
○ This prompt-based analysis facilitates dynamic and flexible interpretations of tone and
context.
Traditional sentiment analysis tools are strongly dependent on basic keyword matching and
rule-based classification, which hinders their accuracy with complex sentence structures, sarcasm, or
multilingual input. These tools also do not support personalization and tend to display data in a raw,
non-interactive format.
● Multilingual and semantic comprehension, by virtue of the huge training set of GPT.
The interface is user-friendly and designed with both technical and non-technical users in mind. The
synthesis of accuracy, interpretability, and extensibility renders the system better than current sentiment
tools in academic as well as industrial applications.
32
CHAPTER 7
7.1 CONCLUSION
The LLM-Based Product Review Evaluation is an automatic program that extracts, summarizes,
and analyses customer feedback with the use of Large Language Models. Such feedback in bulk
available online makes the Product Review Evaluation a very useful tool in decision-making for
purchase decisions made by the customer. The whole application is developed in Django, with
user-friendly interpretability of the sentiment evaluation. Future works aim to introduce multilingual
support and user-specific sentiment classification, also further integration of e-commerce platforms into
the tool. This work offers an insight into how deepening the application of LLMs is going to
revolutionize consumer analysis insights and ultimately improve reviewing e-commerce performance.
The future development of the LLM-Based Product Review Evaluation system requires advanced
multilingual support through models like mBERT or XLM-R to process reviews from various
languages. Additionally the system needs ABSA to analyze sentiments regarding distinct product
features. User-specific sentiment evaluation that incorporates personal preferences and patterns
represents a potential enhancement for personalized product suggestions. Post-release editions of the
system should include artificial intelligence capabilities for fake review detection through Long
Short-Term Memory Networks that received training on fake review databases. The system maintains
the possibility of extension through real-time review tracking from social media and e-commerce
websites which will be achieved through interactive visual dashboards for better sentiment
interpretation. Authors predict three advancements for the system including Speech-to-text review
analysis along with explainable AI for transparent sentiment choices and embedding features with
chatbots or virtual assistants for interactive real-time customer engagement. The tool benefits from
plugin development along with API creation for seamless operations with major e-commerce platforms
thus expanding its usability across diverse audiences.
33
CHAPTER 8
SOURCE CODE
def SentimentAnalysis(request):
productName = request.GET.get("product" ,'')
if not productName:
return JsonResponse({"data":"Product name not given"})
ScrapeReviewObject = ScrapeAmzonReview()
try:
product_url = ScrapeReviewObject.search_amazon_product(productName)
# print("product_url = " ,product_url)
product_review = ScrapeReviewObject.scrape_amazon_reviews(product_url)
print(product_review)
if len(product_review) != 0:
gptSummary = GetSummary()
jsonOutput = gptSummary.get_summary(product_name=productName ,
review_text=' '.join(product_review))
print("JSON OUTPUT : " , jsonOutput)
if(jsonOutput!=None):
return JsonResponse(json.loads(jsonOutput))
print("incorrect json response : ",jsonOutput)
return JsonResponse({"data":f"error getting summary"})
The above code illustrates that the main function of SentimentAnalysis is executed when a
user sends a product name request,the function then instantiates the scrape review class and
GPT summary class. Response is sent back to the user based on the result two class output.
34
8.1.2 REVIEW SUMMARY
class GetSummary:
def get_summary(self , review_text , product_name):
api_key = "AIzaSyB2zWD1…............"
client = genai.Client(api_key=api_key)
prompt = f”””
Analyze the following product review and return a structured JSON with 'summary', 'pros',
'cons', and 'recommendations' for similar products.
For both 'pros' and 'cons', also include their percentage representation (e.g., 60% pros, 40%
cons).
Review for: {product_name} Review:{review_text}”””
The above code represents the GetSummary class, this class is responsible to get a short
description of product,pros and cons. We define the necessary prompt and set of rules pre
defined to get proper results from the gpt API. It represents the content to be returned by gpt
api for the product review such as pros and cons , summary and recommendations.
response = client.models.generate_content(
model="gemini-2.0-flash",
contents=prompt
)
# (Optional) If the response is not formatted as JSON, you may need to parse it:
# import json
35
return json.dumps(structured_output, indent=4)
except json.JSONDecodeError:
print("Failed to extract valid JSON. Please check the model's response.")
return None
The above piece of code demonstrates the python class Getsummary has a method
get_summary that engages with a language model to produce a formatted JSON summary of
a product review. It addresses possible formatting problems in the model's output by trying
to parse the JSON safely and contains fallback logic to pull valid JSON from malformed
outputs.
import requests
from bs4 import BeautifulSoup
import urllib.parse
class ScrapeAmzonReview:
# Function to search for product on Amazon and get the first product URL
def search_amazon_product(self ,product_name):
search_query = urllib.parse.quote_plus(product_name) # Convert product name to a
URL-friendly string
url = f"https://www.amazon.in/s?
k={search_query}" headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
}
response = requests.get(url, headers=headers)
By using the product name as a search string, this Python class ScrapeAmazonReview is
able to send a GET request to the Amazon India website to search for a particular product. It
employs the requests and BeautifulSoup libraries for web scraping, taking care to craft
headers that make the browser appear genuine in order to evade detection.
36
# Send a GET request to the product URL with the
headers response = requests.get(url, headers=headers)
if response.status_code != 200:
print(f"Failed to retrieve the page. Status code: {response.status_code}")
return []
reviews = []
# Find all review containers
review_elements = soup.find_all('div', class_='reviewText')
for review in review_elements:
# Extract the review text from the span tag inside the nested div
comment = review.find('span')
if comment:
# print("ELEMENTS : " , comment.get_text(strip=True))
review_data = {
'comment': comment.get_text(strip=True)
}
reviews.append(comment.get_text(strip=True))
return reviews
The above code pulls customer review text data from an Amazon product’s webpage. With
the help of BeautifulSoup, it finds all the review blocks and captures the text of particular
HTML tags, sanitizes it, and prepares a collection of reviews to be processed or analyzed
later.
37
38
A. OUTPUT
39
Figure 8.2: User Rating And Recommendations
40