SentiFuse: Hierarchical Sentiment-Aware Pre-Training with Aspect-Level Contrastive Learning for Multi-Domain Sentiment Analysis
Keywords:
Sentiment analysis; Aspect-based sentiment analysis; Transformer models; Contrastive learning; Pre-trained language models; Transfer learning; Opinion mining; Domain adaptationAbstract
Sentiment analysis is a core task in natural language processing with wide-ranging applications in opinion mining, market intelligence, and social media analytics. Despite impressive progress on single-domain benchmarks, state-of-the-art transformer models still exhibit substantial performance degradation when applied across domains with divergent linguistic styles and aspect vocabularies a phenomenon we term cross-domain sentiment brittleness. In this paper, we propose SentiFuse, a hierarchical sentiment-aware pre-training framework that incorporates aspect-level contrastive learning to build representations that generalize robustly across domains. SentiFuse introduces three components: (i) a Sentiment-Masked Language Model (SMLM) pre-training objective that selectively masks sentiment-bearing tokens to encourage the model to learn polarity-grounded contextual representations; (ii) an Aspect-Level Contrastive (ALC) loss that pulls together representations of the same aspect expressed with different sentiment carriers, while pushing apart conflicting sentiments on the same aspect; and (iii) a Hierarchical Sentiment Aggregation (HSA) decoder that integrates token-, phrase-, and sentence-level sentiment signals during fine-tuning. We evaluate SentiFuse on four widely-used real-world benchmark datasets: SST-2 (Stanford Sentiment Treebank), IMDb Large Movie Reviews, SemEval-2014 Task 4 (Laptop and Restaurant), and Amazon Product Reviews (Electronics). SentiFuse achieves accuracy of 97.3% on SST-2, 97.8% on IMDb, macro-F1 of 88.6% on SemEval-2014 Laptop, and 91.2% on SemEval-2014 Restaurant, surpassing DeBERTa-large by margins of 0.8%, 0.4%, 3.1%, and 2.4% respectively. Ablation studies confirm that all three components contribute meaningfully, with the ALC loss yielding the largest gain (+1.9% on SemEval Laptop). Our analysis demonstrates that SentiFuse transfers sentiment knowledge more reliably across product categories and review genres than domain-agnostic pre-training alone.
References
[1] B. Pang and L. Lee, “Opinion mining and sentiment analysis,” Found. Trends Inf. Retr., vol. 2, nos. 1–2, pp. 1–135, 2008.
[2] A. Yadav and D. K. Vishwakarma, “Sentiment analysis using deep learning architectures: A review,” Artif. Intell. Rev., vol. 53, no. 6, pp. 4335–4385, 2020.
[3] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, “BERT: Pre-training of deep bidirectional transformers for language understanding,” in Proc. NAACL-HLT, pp. 4171–4186, 2019.
[4] Y. Liu et al., “RoBERTa: A robustly optimized BERT pretraining approach,” arXiv:1907.11692, 2019.
[5] Z. Yang, Z. Dai, Y. Yang, J. Carbonell, R. R. Salakhutdinov, and Q. V. Le, “XLNet: Generalized autoregressive pretraining for language understanding,” in Proc. NeurIPS, pp. 5753–5763, 2019.
[6] P. He, X. Liu, J. Gao, and W. Chen, “DeBERTa: Decoding-enhanced BERT with disentangled attention,” in Proc. ICLR, 2021.
[7] J. Blitzer, M. Dredze, and F. Pereira, “Biographies, bollywood, boom-boxes and blenders: Domain adaptation for sentiment classification,” in Proc. ACL, pp. 440–447, 2007.
[8] M. Hu and B. Liu, “Mining and summarizing customer reviews,” in Proc. KDD, pp. 168–177, 2004.
[9] W. Jin, R. Jin, B. Yin, and T. Finin, “Jointly modeling aspect and sentiment with dynamic heterogeneous graph convolutional network,” in Proc. EMNLP, pp. 5916–5925, 2021.
[10] X. Xu, Y. Liu, C. Shu, and P. S. Yu, “BERT post-training for review reading comprehension and aspect-based sentiment analysis,” in Proc. NAACL, pp. 2324–2335, 2019.
[11] B. Liang et al., “Relational graph attention network for aspect-level sentiment classification,” in Proc. ACL, pp. 3229–3240, 2021.
[12] L. Luo, T.-H. Ao, F. Song, J. Li, X. Yang, D. Yu, and Q. Pan, “GRACE: Generating concise and informative contrastive sample to train a better ABSA model,” in Proc. ACL-Findings, pp. 3498–3508, 2022.
[13] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton, “A simple framework for contrastive learning of visual representations,” in Proc. ICML, pp. 1597–1607, 2020.
[14] K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick, “Momentum contrast for unsupervised visual representation learning,” in Proc. CVPR, pp. 9729–9738, 2020.
[15] T. Gao, X. Yao, and D. Chen, “SimCSE: Simple contrastive learning of sentence embeddings,” in Proc. EMNLP, pp. 6894–6910, 2021.
[16] Y. Shen, Y. Liu, Z. Lin, G. Fu, D. Lv, and D. Song, “SentCSE: A sentiment-aware contrastive sentence embedding framework with sentiment-guided textual similarity,” in Proc. COLING, pp. 3059–3071, 2022.
[17] Y. Wu, J. Li, L. Wang, and F. Wei, “Contrastive masked language model pre-training for dense passage retrieval,” in Proc. EACL, pp. 1575–1586, 2023.
[18] J. Blitzer, R. McDonald, and F. Pereira, “Domain adaptation with structural correspondence learning,” in Proc. EMNLP, pp. 120–128, 2006.
[19] S. Ben-David, J. Blitzer, K. Crammer, A. Kulesza, F. Pereira, and J. W. Vaughan, “A theory of learning from different domains,” Mach. Learn., vol. 79, nos. 1–2, pp. 151–175, 2010.
[20] Y. Ganin et al., “Domain-adversarial training of neural networks,” J. Mach. Learn. Res., vol. 17, no. 1, pp. 2096–2030, 2016.
[21] R. Collobert and J. Weston, “A unified architecture for natural language processing,” in Proc. ICML, pp. 160–167, 2008.
[22] S. Baccianella, A. Esuli, and F. Sebastiani, “SentiWordNet 3.0: An enhanced lexical resource for sentiment analysis and opinion mining,” in Proc. LREC, pp. 2200–2204, 2010.
[23] C. J. Hutto and E. Gilbert, “VADER: A parsimonious rule-based model for sentiment analysis of social media text,” in Proc. ICWSM, 2014.
[24] R. Socher et al., “Recursive deep models for semantic compositionality over a sentiment treebank,” in Proc. EMNLP, pp. 1631–1642, 2013.
[25] A. Wang, A. Singh, J. Michael, F. Hill, O. Levy, and S. Bowman, “GLUE: A multi-task benchmark and analysis platform for natural language understanding,” in Proc. EMNLP (BlackboxNLP), pp. 353–355, 2018.
[26] A. L. Maas, R. E. Daly, P. T. Pham, D. Huang, A. Y. Ng, and C. Potts, “Learning word vectors for sentiment analysis,” in Proc. ACL, pp. 142–150, 2011.
[27] M. Pontiki et al., “SemEval-2014 task 4: Aspect based sentiment analysis,” in Proc. SemEval, pp. 27–35, 2014.
[28] J. McAuley, C. Targett, Q. Shi, and A. van den Hengel, “Image-based recommendations on styles and substitutes,” in Proc. SIGIR, pp. 43–52, 2015.
[29] C. Sun, L. Huang, and X. Qiu, “Utilizing BERT for aspect-based sentiment analysis via constructing auxiliary sentence,” in Proc. NAACL, pp. 380–385, 2019.
[30] Z. Lan, M. Chen, S. Goodman, K. Gimpel, P. Sharma, and R. Soricut, “ALBERT: A lite BERT for self-supervised learning of language representations,” in Proc. ICLR, 2020.
[31] I. Loshchilov and F. Hutter, “Decoupled weight decay regularization,” in Proc. ICLR, 2019.
[32] T. Wolf et al., “HuggingFace’s Transformers: State-of-the-art natural language processing,” in Proc. EMNLP: System Demonstrations, pp. 38–45, 2020.
[33] E. Baly, J. Golpour, H. Hajiali, and M. Nooralahzadeh, “Sentiment analysis in the era of large language models: A reality check,” arXiv:2305.15005, 2023.
[34] R. Hartmann, M. Heitmann, M. Siebert, and C. Schamp, “More than a feeling: Accuracy and application of sentiment analysis,” Int. J. Res. Mark., vol. 40, no. 1, pp. 75–087, 2023.
[35] P. He, J. Gao, and W. Chen, “DeBERTaV3: Improving DeBERTa using ELECTRA-style pre-training with gradient-disentangled embedding sharing,” in Proc. ICLR, 2023.