A CNN-transformer framework for emotion recognition in code-mixed English–Hindi data
摘要
Social media is an open platform for users to express their views and thoughts through emotions about a particular topic in natural language, leading to the generation of a vast amount of emotional data on micro-blogging sites. This data needs to be processed to extract meaningful insights and analyze emotions from text, enhancing various Natural Language Processing (NLP) applications. While humans can easily infer emotions due to their commonsense knowledge, machines lack this perception and must be trained to understand and detect emotions, making it a highly researched task in NLP. The challenge intensifies in Indian contexts where users often switch between two or more languages (code-mixing) to express opinions. The lack of annotated datasets for such multilingual data makes this a promising and underexplored area of research. To address this, we propose a hybrid deep learning framework using a CNN-Transformer model trained on Hindi–English code-mixed tweets, categorized into Happy, Sad, Anger, and Neutral emotions. Unlike previous approaches that rely solely on monolingual models or pre-trained transformers, our method combines local feature extraction via CNNs with global contextual modeling through Transformers specifically designed for code-mixed structures. We also utilize pre-trained word embedding fine-tuned on the dataset to improve semantic representation. Our proposed model achieves superior performance, with an F1-score of 0.82 and outperforming both CNN-only and Transformer-only baselines, and demonstrates robust emotion classification in code-mixed social media text.