Skip to main content

ADVANCED APPROACHES IN SENTIMENT ANALYSIS: FROM FEATURE SELECTION TO EMOTION DETECTION

Page 1


International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 02 | Feb 2026 www.irjet.net p-ISSN: 2395-0072

ADVANCED APPROACHES IN SENTIMENT ANALYSIS: FROM FEATURE SELECTION TO EMOTION DETECTION

1Assistant Professor, Department of IT, TKR College of Engineering and Technology, Telangana, India

2,3,4,5B.Tech Students, Department of IT, TKR College of Engineering and Technology, Telangana, India

Abstract - Sentiment analysis andemotiondetectionplaya vital role in modern Natural Language Processing (NLP) by enabling organizations to understanduseropinions,feedback, and emotional responses from textual data. Most traditional sentiment analysis approaches depend on labelled datasets and supervised machine learning models, which reduces flexibility and requires frequent retraining when applied to new domains. To overcome these limitations, this project proposes a web-based Sentiment and Emotion Classification System using the Gemini Large Language Model (LLM) for zero-shot text analysis.

The system accepts unlabelled CSV datasets and performs automated preprocessingsuchastextcleaning,normalization, and noise removal. Each text instanceis analysedusingGemini to predict sentiment polarity (Positive, Negative,Neutral) and emotion categories (joy, sadness, anger, fear,surprise,disgust, neutral) without any prior training. The platform also supports real-time single-text classification through an interactive web interface.

To improve interpretability and insight, the system generates multiplevisualizationsincludingsentimentdistributioncharts, emotion frequency plots, confidence density graphs, word clouds, scatter plots, and aspect-based sentiment analysis. Additionally, a pseudo-SHAP based explanation mechanism is integrated for single-text analysis to highlight word-level importance and improve transparency. Developed using Django and modern visualization libraries, the proposed system provides a scalable, domain-independent, and userfriendly solution for sentiment and emotion analysis in realworld applications.

KEYWORDS- Sentiment Analysis, Emotion Detection, Gemini LLM, Zero-Shot Classification, Django, NLP, Visualization, Explainable AI,PseudoSHAP

1. INTRODUCTION

Electric Sentiment analysis is one of the most important research areas in Natural Language Processing (NLP), focused on identifying human opinions, attitudes, and emotionalresponsesexpressedintextualform.Itiswidely applied in customer feedback analysis, product review mining,socialmediamonitoring,andbusinessintelligence

systems. Early studies proved that machine learning methodscaneffectivelyclassifysentimentsfromtextusing supervisedapproaches[1].Later,opinionminingbecamea majorresearchdomainandwasrecognizedasanessential technique for extracting valuable insights from large volumesofunstructureddata[2].

1.1 Need for Sentiment and Emotion Analysis

In modern digital platforms, users continuously generate text data in the form of reviews, comments, tweets, and feedback. Analysing such large-scale text manually is impractical. Sentiment analysis helps in understanding overall public opinion, while emotion detection provides deeperinsight byidentifyingemotional statessuchasjoy, anger, sadness, fear, and surprise. Traditional systems mainly focus on polarity classification and often fail to capture fine-grained emotions, reducing the depth of analysis[2].

1.2 Limitations of Traditional Approaches

Mostconventionalsentimentanalysissystemsrelyonrulebased techniques or supervised machine learning models suchasNaiveBayes,SVM,andLogisticRegression[1],[2]. Theseapproachesrequirelargelabelleddatasets,extensive featureengineering,andfrequentretrainingwhenappliedto new domains. Even modern transformer-based deep learning models such as BERT improve contextual understanding [3], but still require domain-specific finetuning and labelled training data, which increases computationalandmaintenancecost.

1.3 Emergence of Large Language Models

Recent advancements in Large Language Models (LLMs) have significantly improved NLP capabilities by enabling zero-shot and few-shot learning. Models such as GPT demonstrated that language models can perform classification tasks without explicit training on labelled datasets [4]. Similarly, Google’s Gemini model provides highlycapableLLM-basedreasoningandtextunderstanding, makingitsuitableforsentimentandemotionanalysisina domain-independentmanner[5].Thisshiftenablessystems to analyse new datasets without retraining and improves adaptabilitytodifferenttextstylesanddomains.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 02 | Feb 2026 www.irjet.net p-ISSN: 2395-0072

1.4 Importance of Explainability and Visualization

Alongwithpredictionaccuracy,interpretabilityiscriticalfor sentimentandemotionclassificationsystems.ExplainableAI (XAI) methods such as SHAP provide a reliable way to interpret model predictions by highlighting the most influential input features [6].This is essential for building user trust and transparency in AI systems. Additionally, visualizationplaysamajorroleinunderstandinglarge-scale sentiment trends. Tools such as Pandas and Matplotlib support effective visualization and statistical analysis of dataset-levelresults[9],[10].Modernwebframeworkssuch as Django help in building scalable, interactive, and userfriendlysentimentanalysisplatforms[11].

2. PROPOSED SYSTEM

Theproposedsystemisanintelligentweb-basedSentiment and Emotion Classification Platform designed to analyses textual data and generates meaningful insights in an automated and scalable manner. Unlike traditional sentimentanalysismethodsthatdependonlabelleddatasets andsupervisedtraining,theproposedapproachleverages theGeminiLargeLanguageModel(LLM)toperformzeroshot sentiment and emotion prediction. This makes the system domain-independent and suitable for analysing datasets from multiple sources such as customer reviews, productfeedback,socialmediaposts,andsurveyresponses withoutrequiringretrainingormanualannotation.

The system begins with a dataset preprocessing stage in whichtheuseruploadsanunlabelledCSVfilecontainingtext records.Thesystemautomaticallyidentifiestherelevanttext columnandperformspreprocessingoperationssuchastext normalization, lowercasing, removal of URLs, email addresses,specialcharacters,andunnecessarysymbols.This cleaningprocessensuresthatnoisyandunstructuredrealworld text is converted into a standardized format, improving the reliability of sentiment and emotion prediction.

After preprocessing, each cleaned text entry is processed through the Gemini LLM, which returns both sentiment polarityandemotioncategoryforthegiventext.Sentiment isclassifiedintoPositive,Negative,orNeutral,whileemotion isidentifiedasoneofthefine-grainedcategoriessuchasjoy, sadness,anger,fear,surprise,disgust,orneutral.Alongwith thepredictedlabels,thesystemalsogeneratesconfidence values to represent the strength of each prediction. Since Gemini operates in a zero-shot manner, the system can generalize across different writing styles and domains without requiring traditional feature engineering or supervisedlearningpipelines.

To provide deeper understanding of the dataset, the proposed system includes a visualization and analytical engine that produces multiple graphical outputs. These visualizationsincludesentimentdistributioncharts,emotion

frequency graphs, confidence density plots, scatter plots comparing sentiment and emotion confidence, and word clouds for positive and negative texts. The system also supports aspect-based sentiment analysis by extracting common aspects such as camera, battery, display, performance, and price, and identifying the sentiment associatedwitheachaspect.Thisallowsuserstounderstand which features or topics are discussed positively or negativelyinthedataset.

In addition to dataset-level analysis, the proposed system supports real-time single-text classification through an interactivewebinterface.Userscanenteranytextinputand instantlyreceivesentimentandemotionpredictionsalong withconfidencescores.Toenhancetransparencyandtrust, thesystemintegratesapseudo-SHAPinspiredexplanation mechanism for single-text predictions. This explanation methodhighlightsthemostinfluentialwordscontributingto the predicted sentiment by measuring the change in prediction when individual words are removed from the input. The results are presented in the form of a wordimportance visualization, providing an interpretable and explainableAIlayer.

Overall, the proposed system delivers an end-to-end sentiment and emotion analysis solution by combining automated preprocessing, Gemini-based zero-shot classification, rich visualization, aspect-level insights, and explainableAIsupport.Theplatformisimplementedusing theDjangoframework,makingitscalable,user-friendly,and suitable for real-world opinion mining and sentiment monitoringapplications.

2.1 System Architecture

The architecture of the proposed Sentiment and Emotion Analysis System is designed as a web-based pipeline that connectstheuserinterface,processingmodules,AImodel, andstoragecomponentsinanintegratedworkflow.Theuser interacts with the system through a Django-based web application,wheretheycanuploada CSVdatasetor enter single text input for real-time analysis. Once the input is submitted,itisforwardedtotheprocessingmodule,which performs text preprocessing operations such as cleaning, normalization,andnoiseremovaltostandardizetheinput data.

After preprocessing, the cleaned text is passed to the Sentiment and Emotion Analysis module, which communicates with the Gemini AI Model (Gemini API) to performzero-shotclassification.TheGeminimodelreturns sentiment polarity and emotion category along with confidencevalues.Thepredictedresultsarethenstoredin thedatabaseorstoragelayerforfurtheranalysisandrecord management. Finally, the processed outputs are returned backtothewebapplication,whereresultsaredisplayedto theuserintheformofpredictionsandvisualanalytics.This architecture ensures scalability, modularity, and domain-

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 02 | Feb 2026 www.irjet.net p-ISSN: 2395-0072

independentsentimentandemotionclassificationthrough theintegrationofLLM-basedintelligence.

2.2 Module Description

Theproposedsystemisdividedintothreemajorfunctional modules:DatasetPreprocessing,VisualizationandDataset Analysis, and Real-Time Single Text Classification. In the preprocessing module, the system accepts CSV datasets containing raw text and automatically performs cleaning operationssuchasremovingURLs,emailaddresses,special characters,andunnecessarysymbols.Theprocessedtextis normalized into a standardized format to improve the reliabilityoffurtheranalysis.

Inthevisualizationanddatasetanalysismodule,thesystem classifies each text instance into sentiment polarity and emotion category using the Gemini LLM. The predicted results are then aggregated and analysed statistically. Multiple visual outputs such as sentiment distribution charts,emotionfrequencygraphs,confidencedensityplots, scatter plots, and word clouds are generated to provide deeper insights into the dataset. Additionally, the system performs aspect-based sentiment analysis by extracting common aspects such as battery, camera, display, performance,andprice,andidentifyingsentimentforeach aspect.

Thereal-timesingletextclassificationmoduleallowsusers to enter a single sentence or paragraph through the web interface. The system instantly predicts sentiment and emotion along with confidence scores. To improve interpretability, a pseudo-SHAP based explanation mechanism highlights the most influential words

contributing to the predicted sentiment, enabling explainableAIsupport.

2.3 Workflow of proposed system

AtTheworkflowoftheproposedsystembeginswhenthe useruploadsaCSVdatasetorentersatextinputthroughthe Djangowebapplication.Thesystemfirstpreprocessesthe input by performing text cleaning and normalization, ensuring that noisy real-world data is transformed into machine-readableformat.Afterpreprocessing,eachcleaned text entry is forwarded to the Gemini LLM for zero-shot classification.Themodelgeneratessentimentpolarityand emotioncategorypredictionsalongwithconfidencescores. For dataset-level analysis, the predictions are aggregated andstored,andthesystemgeneratesmultiplevisualizations such as sentiment distribution charts, emotion frequency plots, confidence density graphs, scatter plots, and word clouds.Aspect-basedsentimentanalysisisalsoperformedto identify sentiment trends for specific aspects discussed in thedataset.Forsingle-textanalysis,thesystemdisplaysrealtimesentimentandemotionresultsandgeneratesapseudoSHAPword-importanceexplanationplot.Finally,alloutputs aredisplayedthroughthewebinterface,enablingusersto obtain both predictions and interpretable insights in an efficientanduser-friendlymanner.

3. IMPLEMENTATION DETAILS

TheproposedSentimentandEmotionClassificationSystem isimplementedasaweb-basedapplicationusingtheDjango framework. The complete system integrates text preprocessing, Gemini LLM-based zero-shot classification, visualization generation, and explainable AI support. The implementation focuses on modular design so that each stage of processing can be executed independently while maintainingsmoothintegrationacrosstheplatform.

3.1 Web Application Development Using Django

The web application is developed using Django, which providesastructuredandscalableframeworkforhandling user requests, file uploads, session management, and dynamic result rendering. The system provides separate interfaces for dataset preprocessing, visualization-based dataset analysis, and real-time single text classification. Django views are used to manage the entire pipeline, including reading CSV files, storing processed results, generating charts, and rendering outputs through HTML templates. The user interface enables easy interaction for bothtechnicalandnon-technicalusersbyprovidingsimple formsforuploadingdatasetsandenteringtextforreal-time analysis.

Fig -3:SystemArchitecture

International Research Journal of Engineering and Technology (IRJET)

Volume: 13 Issue: 02 | Feb 2026 www.irjet.net

3.2 Gemini LLM Integration for Zero-Shot Classification

The core classification functionality is implemented using theGeminiAPIthroughtheGoogleGenAIclient.Forevery cleanedtextinput,astructuredpromptisgeneratedandsent to the Gemini model to obtain sentiment polarity and emotioncategorypredictions.Thesystemenforcesoutput formattingbyrequestingresponsesstrictlyinJSONformat, ensuring reliable parsing of predictions. The model generatessentimentlabelsasPositive,Negative,orNeutral, and emotion labels as joy, sadness, anger, fear, surprise, disgust,orneutral.Confidencescoresarealsoextractedand stored for both sentiment and emotion predictions. To improve robustness, a fallback rule-based mechanism is implemented to handle cases where API access is unavailableorresponsesfail,ensuringthesystemcontinues tofunctionevenunderlimitedconnectivity.

3.3 Visualization Generation and Explainable AI Implementation

Toprovideanalyticalinsights,thesystemgeneratesmultiple visualizations using Pandas, Matplotlib, Seaborn, and WordCloudlibraries.Afterprocessingadataset,sentiment andemotionpredictionsareaggregatedtocreatesentiment distributionchartsandemotionfrequencyplots.Confidence densitygraphsandscatterplotsaregeneratedtorepresent predictionconfidencebehavior.Positiveandnegativeword clouds are created to highlight dominant keywords associatedwitheachsentimentclass.Additionally,aspectbased sentiment analysis is implemented by extracting commonaspectsfromtextandmappingthemtosentiment categories. For single-text classification, a pseudo-SHAP explanationmechanismisimplementedbyevaluatingword importance through word-removal impact analysis. The mostinfluentialwordsareplottedasaword-importancebar chart, improving transparency and interpretability of predictions.AllgeneratedchartsandannotatedCSVoutputs arestoredinthemediadirectoryanddynamicallydisplayed intheresultspagethroughtheDjangointerface.

4. RESULTS AND PERFORMANCE ANALYSIS

Theproposedsystemwastestedusingsampletextdatasets containing user reviews and feedback collected in CSV format.Afteruploadingthedataset,thesystemsuccessfully performed preprocessing, removed noise such as special characters and unwanted symbols, and generated cleaned textsuitableforclassification.Eachcleanedrecordwasthen analyzedusingtheGeminiLLM,whichproducedsentiment polarity and emotion category predictions along with confidencevalues.Thedataset-levelresultswerevisualized through multiple charts to provide an intuitive understandingofsentimentandemotionpatterns.

Figure 4.1 shows the overall sentiment distribution and emotion distribution obtained from the uploaded dataset. Thesentimentdistributionchartprovidesaclearsummary ofthepercentageofPositive,Negative,andNeutralopinions present in the dataset. Similarly, the emotion distribution graph highlights the frequency of emotions such as joy, sadness,andneutral,enablingdeeperunderstandingbeyond polarity classification. These results demonstrate that the proposed system can effectively perform large-scale sentimentandemotionanalysiswithoutrequiringlabelled training

Inadditiontodatasetanalysis,thesystemalsosupportsrealtimeclassificationforsingletextinput.Figure4.2showsthe output of the real-time classification module, where the systempredictsbothsentimentandemotionforanentered textalongwithconfidencescores.Toimprovetransparency, the system generates a pseudo-SHAP word importance explanationplotthathighlightsthemostinfluentialwords contributing to the final prediction. This feature enhances interpretabilityandhelpsusersunderstandwhythemodel producedaspecificsentimentoremotionlabel.Overall,the resultsconfirmthattheproposedsystemdeliversaccurate, explainable, and visually interpretable sentiment and emotion analysis for both dataset-level and single-text scenarios.

Fig 4.1: Sentiment and Emotion Distribution Visualization
Figure 4.2: Real-Time Single Text Sentiment and Emotion Prediction with Pseudo-SHAP Explanation

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 02 | Feb 2026 www.irjet.net p-ISSN: 2395-0072

5. CONCLUSIONS

Thisprojectpresentedaweb-basedSentimentandEmotion ClassificationSystemthatprovidesanend-to-endsolution foranalyzingtextualdatausingtheGeminiLargeLanguage Model. Unlike traditional sentiment analysis methods that requirelabeleddatasetsandmodel training,theproposed system performs zero-shot sentiment and emotion prediction,makingitscalableanddomain-independent.The system successfully supports CSV dataset preprocessing, automated sentiment and emotion classification, and rich visualizationoutputssuchassentimentdistributioncharts, emotion frequency plots, confidence density graphs, word clouds,andaspect-basedsentimentanalysis.Inaddition,the real-timesingletextclassificationmodulewithpseudo-SHAP based word importance explanation improves interpretability and enhances user trust in model predictions. Overall, the system demonstrates that LLMpowered sentiment and emotion analysis can effectively replaceconventionalsupervisedapproachesandprovidea flexible, explainable, and user-friendly platform for realworldopinionminingapplications.

6. FUTURE WORK

Infuture,theproposedsystemcanbeextendedtosupport multilingual sentimentand emotionanalysissothatusers cananalyzetextinmultiplelanguagessuchasHindi,Telugu, Tamil, and other regional languages. The emotion classificationmodulecanalsobeenhancedbyaddingmore fine-grained emotional categories and supporting mixedemotion detection for complex sentences. To improve performanceonlargedatasets,thesystemcanbeoptimized using batch processing, caching, and asynchronous task queues such as Celery. Future versions can integrate advancedexplainabilitytechniquessuchastrueSHAP,LIME, or attention-based explanations for more accurate interpretation.Additionally,theplatformcanbeexpanded with live social media data extraction and real-time streaming dashboards, enabling continuous sentiment monitoringforbrands,products,andpublicopinions.

ACKNOWLEDGEMENT

Therearemanyindividualswhohavecontributeddirectlyor indirectlytothesuccessfulcompletionofourproject,andwe takethisopportunitytoexpressoursinceregratitudetoall of them. We are extremely thankful and indebted to our project guide, Mrs. D. Kavitha, Assistant Professor, for her valuable guidance, continuous encouragement, and unwavering support throughout the development of this project. Her insightful suggestions and technical expertise playedavitalroleinshapingtheoutcomeofourwork.

We extend our heartfelt thanks to Dr. N. Satyanarayana, Head of the Department, for his constant motivation, support, and encouragement during the course of the project.Wearealsogratefultoallthefacultymembersand

staffofthedepartmentfortheircooperationandassistance wheneverrequired.

Finally,wewouldliketoexpressoursincereappreciationto our parents and friends for their constant support, motivation, and encouragement, which helped us successfullycompletethisproject.

REFERENCES

[1] B. Pang, L. Lee, and S. Vaithyanathan, “Thumbs up? Sentimentclassificationusingmachinelearningtechniques,” in Proceedings of the ACL Conference on EmpiricalMethods in Natural Language Processing (EMNLP),2002.

[2]B.Liu, Sentiment Analysis and Opinion Mining.Morgan& ClaypoolPublishers,2012.

[3]J.Devlin,M.W.Chang,K.Lee,andK.Toutanova,“BERT: Pre-trainingofdeepbidirectionaltransformersforlanguage understanding,”in Proceedings of NAACL-HLT,2019.

[4] T. B. Brown et al., “Language models are few-shot learners,” in Advances in Neural Information Processing Systems (NeurIPS),2020.

[5] Google Research, “Gemini: A family of highly capable multimodalmodels,” Google AI Technical Report,2024.

[6] S. M. Lundberg and S. I. Lee, “A unified approach to interpreting model predictions,” in Advances in Neural Information Processing Systems (NeurIPS),2017.

[7] S. Bird, E. Klein, and E. Loper, Natural Language Processing with Python.O’ReillyMedia,2009.

[8] F. Pedregosa et al., “Scikit-learn: Machine learning in Python,” Journal of Machine Learning Research,vol.12,pp. 2825–2830,2011.

[9] J. D. Hunter, “Matplotlib: A 2D graphics environment,” Computing in Science & Engineering,vol.9,no.3,pp.90–95, 2007.

[10]W.McKinney,“Datastructuresforstatisticalcomputing in Python,” in Proceedings of the 9th Python in Science Conference,2010.

[11]DjangoSoftwareFoundation,“DjangoDocumentation,” 2024.[Online].Available:https://docs.djangoproject.com/

[12]F.PedregosaandG.Varoquaux,“ExplainableArtificial Intelligence(XAI):Concepts,applications,andchallenges,” IEEE Intelligent Systems,2020.

Turn static files into dynamic content formats.

Create a flipbook
ADVANCED APPROACHES IN SENTIMENT ANALYSIS: FROM FEATURE SELECTION TO EMOTION DETECTION by IRJET Journal - Issuu