Deep Learning Approaches for Context-Aware Sentiment Analysis in Social Media Text
Keywords:
Context-aware sentiment analysis; transformers; social media NLP; conversation modeling; TweetEval; GoEmotionsAbstract
Context-aware sentiment analysis aims to infer polarity in social media while accounting for signals that are frequently absent when a post is modeled in isolation [2][5], such as reply history, topic drift, emoji pragmatics, and user-specific language. Strong transformer models such as BERT [2], RoBERTa [3], and DeBERTa [4] still struggle with sarcasm and conversational ellipsis [19]. We first synthesize findings from seminal and recent work, highlighting why strong text-only transformers still fail under sarcasm, stance reversal, and conversational ellipsis. We then introduce CAST (Context-Aware Social Transformer), a hierarchical architecture that pairs a domain-appropriate transformer encoder with a context fusion layer that attends over a bounded set of conversational and topical context items, and a lightweight metadata module for user and topic embeddings. CAST is trained end-to-end with AdamW and evaluated using macro-F1 and accuracy on two public benchmarks: TweetEval sentiment (Twitter; 3-way polarity) and a sentiment-collapsed variant of GoEmotions (Reddit) derived by grouping fine-grained emotions into positive/neutral/negative. Using simulated but representative experiments reflecting typical benchmark conditions, CAST improves macro-F1 by +1.7 points on TweetEval and +1.0 point on GoEmotions over strong transformer baselines. Ablation suggests that conversational context contributes most on Reddit, whereas topical cues (hashtags/subreddits) are especially beneficial on Twitter. Error analysis indicates remaining challenges in irony, implicit negation, and domain-specific slang. We further propose a calibration check (expected calibration error) and an out-of-topic stress-test; both suggest that context reduces overconfidence on ambiguous posts. Although results are simulated, we provide concrete preprocessing, hyperparameters, and evaluation recipes reproducible with public data.
Downloads
References
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, Ł., &Polosukhin, I. (2017). Attention is all you need. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS).
Devlin, J., Chang, M. W., Lee, K., & Toutanova, K. (2019). BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the NAACL-HLT.
Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., & Stoyanov, V. (2019). RoBERTa: A robustly optimized BERT pretraining approach. arXiv preprint arXiv:1907.11692.
He, P., Liu, X., Gao, J., & Chen, W. (2020). DeBERTa: Decoding-enhanced BERT with disentangled attention. arXiv preprint arXiv:2006.03654.
Nguyen, D. Q., Vu, T., & Nguyen, A. T. (2020). BERTweet: A pre-trained language model for English tweets. In Proceedings of the EMNLP System Demonstrations.
Barbieri, F., Camacho-Collados, J., Espinosa Anke, L., & Neves, L. (2020). TweetEval: Unified benchmark and comparative evaluation for tweet classification. In Findings of the EMNLP.
Rosenthal, S., Farra, N., & Nakov, P. (2017). SemEval-2017 Task 4: Sentiment analysis in Twitter. In Proceedings of the International Workshop on Semantic Evaluation (SemEval).
Nakov, P., Rosenthal, S., Kozareva, Z., Stoyanov, V., Ritter, A., & Wilson, T. (2013). SemEval-2013 Task 2: Sentiment analysis in Twitter. In Proceedings of the International Workshop on Semantic Evaluation (SemEval).
Demszky, D., Movshovitz-Attias, D., Ko, J., Cowen, A., Nemade, G., & Ravi, S. (2020). GoEmotions: A dataset of fine-grained emotions. In Proceedings of the Association for Computational Linguistics (ACL).
Loshchilov, I., & Hutter, F. (2019). Decoupled weight decay regularization. In Proceedings of the International Conference on Learning Representations (ICLR).
Kim, Y. (2014). Convolutional neural networks for sentence classification. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP).
Hochreiter, S., &Schmidhuber, J. (1997). Long short-term memory. Neural Computation, 9(8), 1735–1780.
Go, A., Bhayani, R., & Huang, L. (2009). Twitter sentiment classification using distant supervision. Stanford University CS224N Project Report.
Hutto, C. J., & Gilbert, E. (2014). VADER: A parsimonious rule-based model for sentiment analysis of social media text. In Proceedings of the International AAAI Conference on Web and Social Media (ICWSM).
Veličković, P., Cucurull, G., Casanova, A., Romero, A., Liò, P., & Bengio, Y. (2018). Graph attention networks. In Proceedings of the International Conference on Learning Representations (ICLR).
Clark, K., Luong, M. T., Le, Q. V., & Manning, C. D. (2020). ELECTRA: Pre-training text encoders as discriminators rather than generators. In Proceedings of the International Conference on Learning Representations (ICLR).
Yang, Z., Dai, Z., Yang, Y., Carbonell, J., Salakhutdinov, R., & Le, Q. V. (2019). XLNet: Generalized autoregressive pretraining for language understanding. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS).
Singh, L. G., Mitra, A., & Singh, S. R. (2020). Sentiment analysis of tweets using heterogeneous multi-layer network representation and embedding. In Proceedings of the EMNLP.
Ghosh, A., Veale, T., & Muresan, S. (2018). Sarcasm analysis using conversation context. arXiv preprint arXiv:1808.07531.
Downloads
Published
How to Cite
Issue
Section
License

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
All papers should be submitted electronically. All submitted manuscripts must be original work that is not under submission at another journal or under consideration for publication in another form, such as a monograph or chapter of a book. Authors of submitted papers are obligated not to submit their paper for publication elsewhere until an editorial decision is rendered on their submission. Further, authors of accepted papers are prohibited from publishing the results in other publications that appear before the paper is published in the Journal unless they receive approval for doing so from the Editor-In-Chief.
IJISAE open access articles are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. This license lets the audience to give appropriate credit, provide a link to the license, and indicate if changes were made and if they remix, transform, or build upon the material, they must distribute contributions under the same license as the original.


