journal article·2024-02-27Open access

Research and Development of a Modern Deep Learning Model for Emotional Analysis Management of Text Data

Iryna Bashynska, Mykhailo Sarafanov, Olga Manikaeva

Applied Sciences· Volume 14· Issue 5

Abstract

There are many ways people express their reactions in the media. Text data is one of them, for example, comments, reviews, blog posts, messages, etc. Analysis of emotions expressed there is in high demand nowadays for various purposes. This research provides a method of performing sentiment analysis of text information using machine learning. The authors trained a classifier based on the BERT encoder, which recognizes emotions in text messages in English written in chat style. To handle raw chat-style messages, authors developed an enhanced text standardization layer. The list of emotions identified includes admiration, amusement, anger, annoyance, approval, caring, confusion, curiosity, desire, disappointment, disapproval, disgust, embarrassment, excitement, fear, gratitude, grief, joy, love, nervousness, optimism, pride, realization, relief, remorse, sadness, and surprise. The model solves the problem of multiclass multilabel text classification, which means that more than one class can be predicted from one piece of text. The authors trained the model on the GoEmotions dataset, which consists of 54,263 text comments from Reddit. The model reached a macro-averaged F1-Score of 0.50704 in emotions prediction and 0.7349 in sentiments prediction on the testing dataset. The presented model increased the quality of emotions prediction by 10.2% and sentiments prediction by 6.5% in comparison to the baseline approach.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Sentiment Analysis and Opinion Mining · Text and Document Classification Technologies · Advanced Text Analysis Techniques

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

Department of Enterprise Management, AGH University of Krakow, 30-059 Krakow, Poland

Department of Information Systems, Odessa Polytechnic National University, 65044 Odesa, Ukraine

Funding

AGH University

References (29)

Show source-provided references
1. TensorFlow API Documentation (2023, November 15). TextVectorization: A Preprocessing Layer Which Maps Text Features to Integer Sequences. Available online: https://www.tensorflow.org/api_docs/python/tf/keras/layers/TextVectorization.
2. Wang, A., Singh, A., Michael, J., Hill, F., Levy, O., and Bowman, S.R. (2019, January 6–9). GLUE: A multi-task benchmark and analysis platform for natural language understanding. Proceedings of the 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA.
3. Cross-lingual language model pretraining
4. Patra, B., Singhal, S., Huang, S., Chi, Z., Dong, L., Wei, F., Chaudhary, V., and Song, X. (2022). Beyond English-centric bitexts for better multilingual language representation learning. arXiv.10.18653/v1/2023.acl-long.856 ↗
5. XLNet: Generalized autoregressive pretraining for language understanding
6. Devlin, J., Chang, M., Lee, K., and Toutanova, K. (2019, January 2–7). BERT: Pre-training of deep bidirectional transformers for language understanding. Proceedings of the NAACL HLT 2019—2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies—Proceedings of the Conference, Minneapolis, MN, USA.
7. Demszky, D., Movshovitz-Attias, D., Ko, J., Cowen, A., Nemade, G., and Ravi, S. (2020, January 5–10). GoEmotions: A dataset of fine-grained emotions. Proceedings of the Annual Meeting of the Association for Computational Linguistics, Online.10.18653/v1/2020.acl-main.372 ↗
8. Reddit (2023, November 15). Dive into Anything. Available online: https://www.reddit.com/.
9. Pandas (2023, November 15). Python Data Analysis Library. Available online: https://pandas.pydata.org/.
10. Numpy (2023, November 15). The Fundamental Package for Scientific Computing with Python. Available online: https://numpy.org/.
11. Matplotlib (2023, December 02). Visualization with Python. Available online: https://matplotlib.org/.
12. Unidecode (2022, November 12). ASCII Transliterations of Unicode Text. Available online: https://pypi.org/project/Unidecode/.
13. TensorFlow (2022, November 12). An end-to-End Machine Learning Platform. Available online: https://www.tensorflow.org/.
14. TensorFlow (2022, November 12). Classify Text with BERT. Available online: https://www.tensorflow.org/text/tutorials/classify_text_with_bert.
15. Scikit-learn (2023, November 15). Machine Learning in Python. Available online: https://scikit-learn.org/.
16. Cortiz, D. (2021). Exploring Transformers in Emotion Recognition: A comparison of BERT, DistillBERT, RoBERTa, XLNet and ELECTRA. arXiv.10.1145/3562007.3562051 ↗
17. Shen, W., Chen, J., Quan, X., and Xie, Z. (2020). DialogXL: All-in-One XLNet for Multi-Party Conversation Emotion Recognition. arXiv.10.1609/aaai.v35i15.17625 ↗
18. Classifier chains for multi-label classification10.1007/s10994-011-5256-5 ↗
19. Sharaf, S., and Anoop, V.S. (2023). An Analysis on Large Language Models in Healthcare: A Case Study of BioBERT. arXiv.
20. Saravia, E., Liu, H.-C.T., Huang, Y.H., Wu, J., and Chen, Y.S. (November, January 31). CARER: Contextualized Affect Representations for Emotion Recognition. Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium.10.18653/v1/D18-1404 ↗
21. Tucker, A. (2024, February 20). Contractions. San José State University Writing Center. Available online: https://www.sjsu.edu/writingcenter/docs/handouts/Contractions.pdf.
22. Kaggle (2023, November 10). Getting Started with Text Preprocessing. Available online: https://www.kaggle.com/code/sudalairajkumar/getting-started-with-text-preprocessing.
23. TensorFlow (2023, November 15). BinaryCrossentropy. TensorFlow API Documentation. Available online: https://www.tensorflow.org/api_docs/python/tf/keras/losses/BinaryCrossentropy.
24. TensorFlow Hub (2022, November 15). BERT (Bidirectional Encoder Representations from Transformers). Available online: https://tfhub.dev/tensorflow/bert_en_uncased_L-12_H-768_A-12/3.
25. Loshchilov, I., and Hutter, F. (2019, January 6–9). Decoupled Weight Decay Regularization. Proceedings of the 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA.
26. Morris, J. (2022, November 20). Does Model Size Matter? A Comparison of BERT and DistilBERT. Weights & Biases. Available online: https://wandb.ai/jack-morris/david-vs-goliath/reports/Does-Model-Size-Matter-A-Comparison-of-BERT-and-DistilBERT--VmlldzoxMDUxNzU.
27. Lan, Z., Chen, M., Goodman, S., Gimpel, K., Sharma, P., and Soricut, R. (2019). ALBERT: A Lite BERT for Self-supervised Learning of Language Representations. arXiv.
28. Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., and Stoyanov, V. (2019). RoBERTa: A Robustly Optimized BERT Pretraining Approach. arXiv.
29. Sanh, V., Debut, L., Chaumond, J., and Wolf, T. (2019). DistilBERT, a distilled version of BERT: Smaller, faster, cheaper and lighter. arXiv.