Decoding Emotions: Unveiling Sentiments and Sarcasm Through Text Analysis
摘要
Sentiment analysis is a natural language processing technique that is used to determine the emotional tone or attitude communicated in a piece of text, often classifying it as positive, negative, or neutral. Whereas, sarcasm detection is employed to identify and determine whether a statement or piece of text is intended to convey a meaning conflicting to its literal interpretation, often with a mocking or ironic tone. In this study, two methods are proposed for sentiment analysis and one for Sarcasm Detection. One dataset i.e. Amazon Food Reviews is used for analyzing the sentiment and another dataset i.e. Sarcastic News Headlines is used for analyzing sarcasm. To overcome the shortcomings of some previously implemented methods, RoBERTa (Robustly Optimized BERT Approach) and VADER (Valence Aware Dictionary for Sentiment Reasoning) are proposed. In the study, RoBERTa performed better than VADER. RoBERTa has proven better due to its Transfer Learning approach, deep contextual understanding, domain adaptation, and extensive pretraining. Naive Bayes is proposed as it is sometimes considered better than other methods for sarcasm detection due to its simplicity, efficiency, and effectiveness in capturing certain linguistic patterns associated with sarcasm. Sentiments analysis model based on RoBERTa attained an accuracy of 88.95% and VADER attained an accuracy of 83.13%. Whereas, sarcasm detection model based on Naive Bayes attained an accuracy of 90.05%.