Skip to main content
Log in

A Contrastive Learning Framework with Tree-LSTMs for Aspect-Based Sentiment Analysis

  • Published:
Neural Processing Letters Aims and scope Submit manuscript

Abstract

Different from sentence-level sentiment analysis, the aspect-based sentiment analysis (ABSA) is a fine-grained task that aims to identify the sentiment polarity towards specific aspect terms in a sentence. However, the lack of fine-grained labeled data and the fact that a sentence may contain multiple aspects or complex implicit sentiment relations make ABSA still face challenges. Specifically, effectively exploiting syntactic dependencies to construct contextual information in a sentence to capture implicit sentiment polarities and constructing the data augmentation paradigm to obtain fine-grained aspect-specific information are the key concerns of this paper. To mitigate the above issues, we propose a Contrastive Learning Framework with Tree-Structured LSTM (CLF-TrLSTM), which applies a concatenated form of Tree-LSTMs and self-attention with window mechanism to utilize dependency tree to capture syntactic and contextual information of the sentence. Meanwhile, to alleviate the data scarcity problem, we use mask generation operation and contrastive learning to generate in-domain high-quality positive and negative samples, then encourage anchor sentences and positive samples to be more similar than negative example pairs, which can achieve alignment of different granularities. Finally, experimental results on three public datasets demonstrate that our proposed framework achieves the state-of-the-art performance and comprehensive analysis verifies the effectiveness of each component.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7

Similar content being viewed by others

Data Availability

Restaurant and Laptop datasets [3]: https://paperswithcode.com/dataset/semeval-2014-task-4-sub-task-2 Twitter dataset [18]: http://goo.gl/5Enpu7 Bert-base-uncased: https://github.com/huggingface/transformers

References

  1. Liu B (2012) Sentiment analysis and opinion mining. Synthesis Lect Human Lang Technol 5(1):1–167

    Article  MathSciNet  Google Scholar 

  2. Russo I, Caselli T, Strapparava C (2015) Semeval-2015 task 9: clipeval implicit polarity of events. In: Proceedings of the 9th international workshop on semantic evaluation (SemEval 2015), pp. 443–450

  3. Pontiki M, Papageorgiou H, Galanis D, Androutsopoulos I, Pavlopoulos J, Manandhar S (2014) Semeval-2014 task 4: aspect based sentiment analysis. SemEval 2014:27

    Google Scholar 

  4. Gu S, Zhang L, Hou Y, Song Y (2018) A position-aware bidirectional attention network for aspect-level sentiment analysis. In: Proceedings of the 27th international conference on computational linguistics, pp. 774–784

  5. Huang B, Ou Y, Carley KM (2018) Aspect level sentiment classification with attention-over-attention neural networks. In: International conference on social computing, behavioral-cultural modeling and prediction and behavior representation in modeling and simulation, pp. 197–206. Springer

  6. Wang K, Shen W, Yang Y, Quan X, Wang R (2020) Relational graph attention network for aspect-based sentiment analysis. In: Proceedings of the 58th annual meeting of the association for computational linguistics, pp. 3229–3238

  7. Pang S, Xue Y, Yan Z, Huang W, Feng J (2021) Dynamic and multi-channel graph convolutional networks for aspect-based sentiment analysis. In: Findings of the association for computational linguistics: ACL-IJCNLP 2021, pp. 2627–2636

  8. Li R, Chen H, Feng F, Ma Z, Wang X, Hovy E (2021) Dual graph convolutional networks for aspect-based sentiment analysis. In: Proceedings of the 59th annual meeting of the association for computational linguistics and the 11th international joint conference on natural language processing (Volume 1: Long Papers), pp. 6319–6329

  9. Liang S, Wei W, Mao X-L, Wang F, He Z (2022) Bisyn-gat+: Bi-syntax aware graph attention network for aspect-based sentiment analysis. In: Findings of the association for computational linguistics: ACL 2022, pp. 1835–1848

  10. Zhang K, Zhang K, Zhang M, Zhao H, Liu Q, Wu W, Chen E (2022) Incorporating dynamic semantics into pre-trained language model for aspect-based sentiment analysis. In: Findings of the association for computational linguistics: ACL 2022, pp. 3599–3610

  11. Zhao A, Yu Y (2021) Knowledge-enabled bert for aspect-based sentiment analysis. Knowl-Based Sys 227:107220

    Article  Google Scholar 

  12. He R, Lee WS, Ng HT, Dahlmeier D (2018) Exploiting document knowledge for aspect-level sentiment classification. In: Proceedings of the 56th annual meeting of the association for computational linguistics (Volume 2: Short Papers), pp. 579–585

  13. Zhang Y, Zhang M, Wu S, Zhao J (2022) Towards unifying the label space for aspect-and sentence-based sentiment analysis. In: Findings of the association for computational linguistics: ACL 2022, pp. 20–30

  14. Jiang Q, Chen L, Xu R, Ao X, Yang M (2019) A challenge dataset and effective models for aspect-based sentiment analysis. In: Proceedings of the 2019 conference on empirical methods in natural language processing and the 9th international joint conference on natural language processing (EMNLP-IJCNLP), pp. 6280–6285

  15. Li G, Wang H, Ding Y, Zhou K, Yan X (2022) Data augmentation for aspect-based sentiment analysis. Int J Mach Learn Cybern. https://doi.org/10.1007/s13042-022-01535-5

    Article  Google Scholar 

  16. Tai KS, Socher R, Manning CD (2015) Improved semantic representations from tree-structured long short-term memory networks. arXiv preprint arXiv:1503.00075

  17. Raffel C, Shazeer N, Roberts A, Lee K, Narang S, Matena M, Zhou Y, Li W, Liu PJ (2020) Exploring the limits of transfer learning with a unified text-to-text transformer. J Mach Learn Res 21:1–67

    MathSciNet  Google Scholar 

  18. Dong L, Wei F, Tan C, Tang D, Zhou M, Xu K (2014) Adaptive recursive neural network for target-dependent twitter sentiment classification. In: Proceedings of the 52nd annual meeting of the association for computational linguistics (volume 2: Short Papers), pp. 49–54

  19. Zhang L, Wang S, Liu B (2018) Deep learning for sentiment analysis: a survey. Wiley Interdisc Rev: Data Min Knowl Discov 8(4):1253

    Google Scholar 

  20. Wei W, Liu J, Mao X, Guo G, Zhu F, Zhou P, Hu Y (2019) Emotion-aware chat machine: Automatic emotional response generation for human-like emotional interaction. In: Proceedings of the 28th ACM international conference on information and knowledge management, pp. 1401–1410

  21. Lan T, Mao X-L, Wei W, Gao X, Huang H (2020) Pone: a novel automatic evaluation metric for open-domain generative dialogue systems. ACM Trans Inf Sys (TOIS) 39(1):1–37

    Google Scholar 

  22. Qiu M, Huang X, Chen C, Ji F, Qu C, Wei W, Huang J, Zhang Y (2021) Reinforced history backtracking for conversational question answering. In: Thirty-Fifth AAAI conference on artificial intelligence, AAAI, pp. 13718–13726

  23. Musto C, de Gemmis M, Semeraro G, Lops P (2017) A multi-criteria recommender system exploiting aspect-based sentiment analysis of users’ reviews. In: Proceedings of the eleventh ACM conference on recommender systems, pp. 321–325

  24. Liu P, Zhang L, Gulla JA (2021) Multilingual review-aware deep recommender system via aspect-based sentiment analysis. ACM Trans Inf Sys (TOIS) 39(2):1–33

    Article  Google Scholar 

  25. Birjali M, Kasri M, Beni-Hssane A (2021) A comprehensive survey on sentiment analysis: approaches, challenges and trends. Knowl-Based Sys 226:107134

    Article  Google Scholar 

  26. Wankhade M, Rao ACS, Kulkarni C (2022) A survey on sentiment analysis methods, applications, and challenges. Artif Intell Rev 55(7):5731–5780

    Article  Google Scholar 

  27. Wang Y, Huang M, Zhu X, Zhao L (2016) Attention-based lstm for aspect-level sentiment classification. In: Proceedings of the 2016 conference on empirical methods in natural language processing, pp. 606–615

  28. Chen P, Sun Z, Bing L, Yang W (2017) Recurrent attention network on memory for aspect sentiment analysis. In: Proceedings of the 2017 Conference on empirical methods in natural language processing, pp. 452–461

  29. Zhang C, Li Q, Song D (2019) Aspect-based sentiment classification with aspect-specific graph convolutional networks. In: Proceedings of the 2019 conference on empirical methods in natural language processing and the 9th international joint conference on natural language processing (EMNLP-IJCNLP), pp. 4568–4578

  30. Sun K, Zhang R, Mensah S, Mao Y, Liu X (2019) Aspect-level sentiment analysis via convolution over dependency tree. In: Proceedings of the 2019 conference on empirical methods in natural language processing and the 9th international joint conference on natural language processing (EMNLP-IJCNLP), pp. 5679–5688

  31. Vaswani A, Shazeer N, Parmar N, Uszkoreit J, Jones L, Gomez AN, Kaiser Ł, Polosukhin I (2017) Attention is all you need. Adv Neur Inf Process Sys, 30

  32. Bai X, Liu P, Zhang Y (2020) Investigating typed syntactic dependencies for targeted sentiment classification using graph attention neural network. IEEE/ACM Trans Audio, Speech, Lang Process 29:503–514

    Article  Google Scholar 

  33. Yu J, Gong C, Xia R (2021) Cross-domain review generation for aspect-based sentiment analysis. In: Findings of the association for computational linguistics: ACL-IJCNLP 2021, pp. 4767–4777

  34. Chen Z, Qian T (2019) Transfer capsule network for aspect level sentiment classification. In: Proceedings of the 57th Annual meeting of the association for computational linguistics, pp. 547–556

  35. Liang Y, Meng F, Zhang J, Xu J, Chen Y, Zhou J (2020) An iterative knowledge transfer network with routing for aspect-based sentiment analysis. arXiv preprint arXiv:2004.01935

  36. Yu G, Ao X, Luo L, Yang M, Sun X, Li J, He Q (2021) Making flexible use of subtasks: A multiplex interaction network for unified aspect-based sentiment analysis. In: Findings of the association for computational linguistics: ACL-IJCNLP 2021, pp. 2695–2705

  37. Wang B, Ding L, Zhong Q, Li X, Tao D (2022) A contrastive cross-channel data augmentation framework for aspect-based sentiment analysis. arXiv preprint arXiv:2204.07832

  38. Devlin J, Chang M-W, Lee K, Toutanova K (2018) Bert: pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805

  39. Song Y, Wang J, Jiang T, Liu Z, Rao Y (2019) Attentional encoder network for targeted sentiment classification. arXiv preprint arXiv:1902.09314

  40. He K, Zhang X, Ren S, Sun J (2016) Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778

  41. Kingma DP, Ba J (2014) Adam: a method for stochastic optimization. arXiv preprint arXiv:1412.6980

  42. Fan F, Feng Y, Zhao D (2018) Multi-grained attention network for aspect-level sentiment classification. In: Proceedings of the 2018 conference on empirical methods in natural language processing, pp. 3433–3442

  43. Zhang M, Qian T (2020) Convolution over hierarchical syntactic and lexical graphs for aspect level sentiment analysis. In: Proceedings of the 2020 conference on empirical methods in natural language processing (EMNLP), pp. 3540–3549

  44. Tang H, Ji D, Li C, Zhou Q (2020) Dependency graph enhanced dual-transformer structure for aspect-based sentiment classification. In: Proceedings of the 58th annual meeting of the association for computational linguistics, pp. 6578–6588

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Qichen Zhang.

Ethics declarations

Conflict of interest

No conflict of interest exits in the submission of this manuscript, and manuscript is approved by all authors for publication. I would like to declare on behalf of my co-authors that the work described was original research that has not been published previously, and not under consideration for publication elsewhere, in whole or in part. All the authors listed have approved the manuscript that is enclosed.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Zhang, Q., Wang, S. & Li, J. A Contrastive Learning Framework with Tree-LSTMs for Aspect-Based Sentiment Analysis. Neural Process Lett 55, 8869–8886 (2023). https://doi.org/10.1007/s11063-023-11181-9

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11063-023-11181-9

Keywords

Navigation