Research Article

Machine Learning and Lexical Rule-Based Cost-Efficient Emotion Annotation of Hinglish Utterances

DOI:

10.3791/68437

August 19th, 2025

In This Article

Summary

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

This study combines the rule-based strategy with machine learning and expert assistance to annotate the Hinglish and English text. The data is tested on 19,000 tweets with 81% accuracy, and it is much cheaper than doing it manually. It could be useful for tracking emotions during a crisis.

Abstract

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Emotion annotation in code-mixed languages like Hinglish (Hindi-English) presents unique challenges due to linguistic complexity and resource constraints. This study introduces a hybrid active learning framework that combines lexical rules, machine learning, and iterative expert feedback to achieve cost-efficient, high-accuracy emotion annotation. Grounded in psychological theories of emotion, including Discrete Emotions Theory and Cognitive Appraisal Theory, the framework employs bilingual emotion dictionaries (e.g., mapping gussa and rage to anger), subword tokenization for compound terms (e.g., splitting Devanagari script text: "भयानक" meaning "terrible" in Hindi language. into Equation of Hindi words भव्य + अंक, highlighting language structure analysis.), and active learning to prioritize ambiguous samples. Evaluated on a 19,000 war and conflict-related Hinglish tweets dataset, the framework achieved 81% accuracy (F-score: 0.76) while reducing operational costs by 40% compared to manual annotation. Lexical rules resolved 89% of code-switching ambiguities, and iterative refinements enabled incremental accuracy gains from 72% to 81%. The system's efficiency stems from limiting human effort to 73% of the dataset, with automated preprocessing of emojis, hashtags, and slang. This study is based on the hypothesis that integrating lexical rule-based methods with active learning and machine learning can enhance the accuracy of emotion annotation in Hinglish text, while simultaneously reducing the manual labeling and overall annotation effort.

Introduction

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

When two or more languages are mixed together in a single line or speech, this is called a code-mixed language. It is common in casual dialog like Hinglish. There are multiple ways human emotions can be understood, and to computationally model a series of emotional statements is to annotate them by the people who uttered those sentences. It can be understood in terms of biological, physiological, psychological levels, and so on. According to scientists such as Roger Penrose, many phenomena in our world are non-computational, and scientists such as Wolfram consider that everything (every phenomenon) can be modeled computationally1. Penrose believes that consciousness involves processes (perhaps related to quantum mechanics within the brain) that go beyond what any step-by-step algorithmic procedure can achieve. He often cites Gödel's incompleteness theorems to support the idea that human mathematical insight, for instance, transcends formal systems2. If consciousness is non-computational, then emotions, as a key aspect of conscious experience, might also have non-computational elements. Stephen Wolfram, known for Mathematica and his work on cellular automata, proposes the "Principle of Computational Equivalence." This suggests that even very complex systems, including potentially the universe itself and phenomena within it (like emotions), can ultimately be described and modeled by computational rules, even if those rules are very simple, generating complex behavior. But practically, this is not possible, and we need someone who is referred to as either an expert or simply an annotator who can do emotion analysis3.

In this research, we propagate the idea of building computational models. But that model will be quasi-computational. Our research in this context aims to be computational in form but might not capture all aspects perfectly, perhaps leaving room for complexities that are difficult or impossible to compute fully. Emotions are difficult to model computationally because they depend on subjective experiences, cultural context, and nuanced expressions that cannot be fully captured through fixed algorithms.

Therefore, for modeling human emotions using variable-based computational approaches, it is necessary to annotate human emotional utterances. This annotation should be performed by an expert or an annotator skilled in emotion analysis¹. Understanding the complexities of human emotions is not an easy task, particularly when dealing with mixed languages. Furthermore, problems related to scale mean that relying solely on manual annotation by humans is not a viable option. Recent research indicates a consistent need for a human-in-the-loop approach when building systems for such complex tasks. Consequently, a semi-automatic approach, which involves automating the more straightforward parts while reserving tasks requiring human nuance for annotators, appears most appropriate for developing natural language systems in this domain.

A human annotator will, of course, be doing work manually, and in the age of computation, this is not what is expected from contemporary scientists. If the annotator (manual, semi-automatic, or fully automatic) is able to intelligently guess the type of emotion embodied in the utterances, utterances that consist of multiple types of emotions expressed as symbols, with colloquialism or code-mixed and using multiple modalities, then the task is hard and easy at the same time. The complexity of emotion annotation in Hinglish utterances depends on the nature of the expression. When emotions are conveyed clearly using familiar words or emojis, annotation is relatively straightforward. However, the task becomes challenging when utterances involve multiple emotions, code-mixing, or ambiguous symbolic expressions. Therefore, annotation can be both easy and difficult, depending on how directly the emotion is expressed.

Contemporary approaches in the identification of emotions and sentiments deal with these challenges, including the subjective nature of emotions, the ambiguity in human expressions, the complexity of code-mixed languages like Hinglish, and the time-consuming and inconsistent nature of manual annotation. associated with constructing computational models and managing tedious annotation tasks. Recent research indicates that researchers are employing a diverse range of methods toward this goal, including machine learning, deep learning, and various hybrid approaches. Recent research shows that to overcome these issues, researchers are employing a variety of techniques, such as machine learning, deep learning, and hybrid models.

Recent research shows that researchers are employing all kinds of approaches, including machine learning, deep learning3, and hybrid approaches. The term sentiment analysis refers to a procedure used when the polarity of the emotions is believed to be a marker to understand the raw emotion of humans3,4. The development of such technology has helped to recognize mood, sentiments, speech, facial emotions, and nonverbal cues, and has already made inroads into applications that allow real-time translation2. A multimodal approach could be used to translate Hinglish into English and may be helpful in the future to make Indian cinema more accessible to remote societies5,6. For example, in India, English is often the second language. Research in this context shows that this has improved the quality of English teaching by analyzing Indian speech (mix-code language) for the expressiveness, or degree of feeling and emotion, of each word.

Within this research context, the use of mixed-code language in conjunction with translation has been shown to enhance the quality of English teaching. This is accomplished through the analysis of Indian speech (mixed-code language) to determine the expressiveness, or emotional valence, of each word. Through the application of deep learning to train computers in speech interpretation, this research has already improved the accuracy of computerized speech analysis and facilitated a greater understanding of communication4,5. According to the census results from 2001, Hinglish, a language that is a blend of Hindi and English, is currently used by an estimated 120 million people in India6.

From the contemporary landscape of learning algorithms, it is clear that active learning has emerged as a powerful tool for significantly reducing human effort in annotating large datasets, particularly in the domain of emotion identification and recognition. This iterative approach, which selectively annotates impactful annotations (with appropriate metrics), not only enhances annotation accuracy but also improves efficiency5. Previous studies have demonstrated its effectiveness in achieving substantial reductions in manual annotation workload while maintaining or even improving performance with smaller training datasets and proposing a cluster analysis-based method for informative instance selection7,8. In the specific context of Hinglish emotion recognition, researchers have made valuable contributions through deep learning models and a multi-label annotated dataset9,10,11. Previous studies12,13 have introduced active learning and semi-supervised methods to minimize the dependence on human-labeled data, further enhancing efficiency and reducing annotation costs. Furthermore, active learning has been demonstrated in many projects to boost classification performance, particularly in multi-label emotion classification14.

The efficacy of active learning in improving classifier performance has been recognized across various machine-learning applications. Studies15,16highlighted its crucial role in enhancing performance by focusing on educational applications. Similarly, an early study introduced a novel algorithm for active learning with support vector machines, significantly reducing the need for labeled instances17. Another work also explored its application in tasks involving structured instances, such as text classification18. Active learning's impact on emotion recognition tasks extends beyond efficiency gains, particularly in minimizing reliance on human-labeled data. One study introduced a multi-task framework for emotion classification and regression, surpassing the performance of single-task methods10.

Furthermore, researchers19made significant strides in speech and text emotion recognition using active learning, while demonstrating20 its effectiveness in personalized music emotion classification. However, the process of categorizing and labelling emotions presents a significant challenge, as highlighted21,22, particularly in sentiment analysis contexts. Notes that label usage can significantly influence emotion categorization, particularly for later-learned categories23. To address these challenges, various algorithms, including keyword-based and learning-based methods, have been developed, achieving notable accuracy rates24. Research on emotions based on written utterances and texts has been explored in numerous models, and approaches have implemented a dimensional model using normative databases for effective emotion detection25. In another study26, a cognitive emotion model enhanced a sequential method used for social emotion cause identification. The author provided a computational linguistic interpretation of the OCC emotion model, while a similar study27proposed a system utilizing ontologies for representing word dependency relations and emotions. The authors of one study28discussed the signals that correlate with emotional word processing, highlighting the brain's adaptation in expressing emotions in written language. Annotation of multiple arrays of raw emotions, including that of the multi-model data, is challenging. Nevertheless, investigating emotions related to war and conflict provides a scientific and systematic window into the human psyche under extreme circumstances, allowing us to better understand how individuals and communities cope with trauma, loss, and uncertainty5. Another study found that the annotation technique effectively enhanced genre classification, with the title feature playing a crucial role in the process29. One study created a 44K vision-touch dataset with expert and GPT-4V to train a tactile encoder and a TVL model for text generation30. Another study explored opinion and trend mining on political tweets, focusing on the active learning process to automatically annotate French-language tweets about politicians41. Another study introduced CloudFlows, a cloud-based scientific workflow platform designed for dynamic adaptive central analysis in data streams. It enables active learning to improve sentiment classification, allowing the algorithm to adapt to changes in real-time data42.

There is clear-cut tension between the complexity of human emotion and the desire for automated emotion analysis. An inherent tension exists between the complexity of human emotion and the objective of automated emotion analysis. Most of the contemporary work acknowledges the limitations of manual annotation and emphasizes the need for sophisticated computational methods to tackle the challenges of understanding emotions in diverse forms of communication. This ideal scenario is largely impractical, i.e., getting annotations from the people who wrote or spoke the sentences43. The ideal scenario for obtaining data, specifically getting annotations directly from the individuals who wrote or spoke the sentences, is largely impractical. This impracticality stems from the impossibility of gathering and processing such personalized annotations on a large scale. Therefore, current efforts must rely on expert annotators or automated emotion detection algorithms to analyze and label emotions expressed in text. In this research work, we have attempted to overcome some aspects of these domain challenges. The key contributions in this problem area are presented hereafter44.

Therefore, we need to rely on experts or annotators and emotion detection algorithms to analyze and label the emotions expressed in text. It's impossible to gather and process such personalized annotations on a large scale. Hence, in this research work, we have attempted to overcome some aspects of this domain knowledge. The following are the key contributions in this problem area.

The framework works together with rule-based methods like emotion tagging, code-mix detection, and emoji interpretation with machine learning techniques such as Random Forest and word embeddings, improving annotation accuracy while reducing manual effort. The Iterative Learning of the Classifier employs active learning as well as transfer learning to prioritize ambiguous feature samples, reducing the need for hard labor. This approach reduced operational costs by 40% compared to hard manual labeling.

To handle the nuances of Hinglish at a granular level, a custom context-sensitive tokenization method was developed. This approach processes code-mixed text by accounting for language switching, punctuation, emojis, and subword segmentation, enabling more accurate emotion annotation in mixed Hindi-English text. At a granular level, we developed custom context-sensitive tokenization for Hinglish text. The framework addresses the complexities of code-mixed text by incorporating bilingual emotion dictionaries, subword tokenization, and custom context-sensitive tokenization. Lexical rules resolved 89% of code-switching ambiguities.

Our work is grounded in established psychological theories of emotion, such as Discrete Emotions Theory and Cognitive Appraisal Theory. The research demonstrates the scalability of the approach for crisis response and social media monitoring, providing a blueprint for low-resource, multilingual NLP applications.

Table explains the available studies for the same problem domain. From the literature survey and the tabulated summary, it can be inferred that most of the studies cannot escape doing some initial work on annotation using manual methods. Few researchers are following semi-automatic approaches41. However, the real difference in performance comes from the use of an effective learning model that can automate the process of annotation. The emotional content of the tweets must match theories that explain the pathways of humans' emotions and the organization of sentiments. The next section defines the problem based on limitations of existing approaches and empirical results of the papers.

StudyDatasetEmotionMethodsDomainLabeling ProcessGapsFuture Scope
[31]9,000,000 Tweetstension, depression, anger, vigour, fatigue,Confusion Profile of Mood StatesEnglishNo labelingThe study overlooks subtle emotional differences like surprise, joy, or fear, suggesting that emotion labelling can enhance the interpretability and granularity of sentiment trends, particularly in relation to socioeconomic events.It could investigate how to better capture and examine a range of emotional expressions in social media data by utilising automated categorisation methods and well-established emotion taxonomies.
[32]7000 Tweetsanger, disgust, fear, joy, love, sadness,Support Vector MachineEnglishManualThe generalisability of the dataset is limited due to its topic-specificity and lack of representativeness of overall Twitter usage.  Due to subjective interpretation and minimal context, which is shown in modest inter-annotator agreement, it is challenging to annotate emotions in brief, casual tweets.Future work will focus on developing improved emotion detection models by incorporating distinctions between topic-specific and emotion-specific linguistic styles, enabling more accurate classification in diverse tweet contexts.
[33]21,000 Tweetanger, disgust, fear, joy, sadness, surpriseSupport Vector Machine------Using HashtagExisting emotion-labeled corpora are limited in size and domain, lacking large, diverse datasets for microblogs. Tweets are short, noisy, and context-limited, making accurate emotion detection and annotation difficult.In future work study may includes expanding the emotion lexicon with synonyms and additional hashtags to improve coverage and detection accuracy.
[34]16485 Tweetsanger, disgust, fear, joy, sadness, surpriseSupport Vector RegressionChineseManualTraditional emotion classification methods often overlook the underlying cause of emotions, limiting feature quality.
Accurately extracting emotion causes from short, informal microblog posts requires robust rule-based systems and domain knowledge.
 
Further exploration of emotion cause analysis can enhance emotion detection models and open new directions in textual emotion understanding.
[35]10,040 TweetFear, hope, joy anger, surprise,  sad, disgustLDA, inter-rater agreementHinglishManualThere is a lack of publicly available, structured datasets for Hinglish, especially those capturing pragmatic and emotional nuances in crisis related content. Hinglish is a non-standard, code-mixed language, and regional variations complicate accurate sentiment analysis and annotation.
 

To expand multimodal datasets, integrate deep pragmatic analysis with machine learning models, and address scalability for real-time emotion tracking in conflict discourse.
[36]134,000 tweetsactive, inactive  happy, unhappySupport Vector Machine and K-Nearest NeighborsHinglishUsing HashtagsManual emotion labeling of tweets is labor-intensive and inconsistent, limiting large-scale emotion classification efforts
Crowdsourced annotations lack reliability, especially in identifying emotion arousal levels, highlighting subjectivity in emotion interpretation.
 
Focus on refining hashtag-based labeling and expanding emotion detection models for improved accuracy and generalizability across diverse emotional contexts.
[37]3,000 students, psychologists and non-psychologistsfrom 37 countriesjoy,fear, anger, sadness, disgust, shame, and guilt.-------ManualLimited exploration of how cultural factors influence the regulation and expression of specific emotions across diverse societies. Balancing evidence for universal emotional patterns with culturally specific variations in emotion elicitation and interpretation remains complex.
 
Further studies should investigate the interaction between biological universality and cultural context in shaping emotional experience and communication
[38]12000Happiness, Sadness and Angerinter-rater agreementHindi+EnglishManualCurrent research lacks a comprehensive, annotated dataset and standardized models for Hinglish emotion detection. The irregular grammar and code-mixed nature of social media texts make accurate emotion classification difficult.
 

Future work will  focus on expanding emotion categories and developing larger, multilingual code-mixed datasets.
[39]2866happiness, sadness, anger, surprise and sadnessSupport Vector MachineHinglish (Hindi+English)ManualLack of emotion-annotated code-mixed datasets.  Emotion expression in code-mixed text varies across languages and scripts, making annotation and classification complex.
 

Future work could expand the corpus to include more emotional diversity, integrate part-of-speech tagging, and explore multi-language code-mixed content.
[40]13738---Machine Translation Google TranslatorHinglishManualExisting machine translation systems lack accuracy on code-mixed social media data due to the absence of large, domain-specific parallel corpora. High spelling variation, informal structure, and ambiguity in language identification complicate translation of Romanized Hindi-English text.
 
The corpus can support development of code-mixed translation systems and be extended to other low-resource languages and NLP tasks like named entity recognition
[41]11527positive,very positive and negative,very negativekNN-based classification,BOW representationFrench politiciansManualLimited availability of high-quality annotated datasets for political opinion mining in non-English languages. Balancing annotation noise reduction with information retention and handling uneven label distribution in large-scale tweet datasets are key difficulties.
 

Future work may refine active learning methods to better preserve critical content while minimizing annotation noise in multilingual political discourse.
[42]764,416---Kmeans Clustering, SVMEnglishSemi supervisedReal-time labeling and model updating in sentiment analysis is constrained by data stream variability, labeling cost, and system scalability.Future work will explore multi-class sentiment classification, integrate additional labeling strategies, and expand control over initial model generation

Table 1: Available studies with corresponding labeling methods. The table provides a complete comparative overview of the existing studies, addressing the emotion annotation and establishing the methodological landscape and conceptualizing the contribution of the present work within existing literature.

Problem statement
The most frequently studied emotions in annotation are heavily influenced by foundational psychological models like Ekman's and Plutchik's, primarily focusing on core categories like anger, fear, happiness, sadness, surprise, and so on44. Hence, in this research work, we intend to work on well-established connotations of emotions. The challenge is to develop a dynamic computational framework, F, capable of accurately annotating Hinglish text instances (tᵢ ) from a corpus T focused on wars and conflicts with emotion labels (eᵢ) from a predefined set E = {e1, e2, ..., e8}. This framework must synthesize principles from the Constructionist Theory of Emotion, Affective Events Theory (AET), Discrete Emotions Theory, and Cognitive Appraisal Theory to model the multifaceted emotional landscape of conflict-related discourse. Each text instance tᵢ in T is linguistically complex, blending Hindi (in Roman script), English, emojis, and symbols, necessitating a multi-layered approach to capture nuanced emotional expressions.

The computational model of emotions related to war (as a case study) may involve a multi-faceted approach, beginning with lexical rules that address Hinglish-based nuances. Tokenization, denoted as T, encompasses Roman scripts (Hindi written in Roman script), along with emojis and punctuation, forming the basis of language processing. emotion dictionaries, represented as D, map words across languages to specific emotions, such as anger, joy, and others, where each emotion_i has associated words_j in language_k. Subword decomposition, S, breaks down compound terms into their constituent subwords, enabling a deeper understanding of complex expressions. Subsequently, machine learning techniques, M, utilize embeddings, E, such as Word2Vec/fastText, to transform tokens into vector representations, vector_v, facilitating numerical analysis. Ensemble classifiers, C, like Random Forest, then predict emotion labels, emotion_label_p, from these vector sets. To iteratively improve the annotation learning model, an active learning mechanism, AL, is employed. Expert feedback, F, refines ambiguous cases, ambiguous_sample_q, by assigning refined_label_r, providing crucial corrections. Sample prioritization, P, focuses on low-confidence samples, low_confidence_sample_s, assigning them annotation_priority_t, thus optimizing the annotation process.

By integrating these components and theories, this framework aims to dynamically process Hinglish text, bridge linguistic and cultural nuances, and adaptively refine emotion annotations, offering a scalable solution for analyzing affective dimensions in conflict discourse.

Access restricted. Please log in or start a trial to view this content.

Protocol

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

This section also explains how the multimodal framework for 8 emotion annotation has been constructed. The section begins with a discussion of the properties of the dataset, followed by the subsequent procedures. For a better understanding of the research procedure, refer to Figure 1.

Machine learning flowchart for tweet emotion analysis using preprocessing, dynamic rules, active learning.
Figure 1: Systematic framework of emotion annotation. The figure explains the effective emotion, annotation of hinglish text that combines machine learning, active learning, and dynamic lexicon rules through expert input, misclassified examples are progressively improved to increase the accuracy and lower the cost of annotation. Please click here to view a larger version of this figure.

Dataset preparation
Data collection begins by identifying a comprehensive list of keywords and hashtags related to war conflict and associated emotions. Resources such as academic literature, news articles, and social media trends were used to compile relevant and existing lists.

As per Figure 1, after the collection of tweets and pre-processing of the data is done, human experts are involved in manual labelling and making lexical rules that need to be incorporated to improve the annotation process. Using these keywords (conflict, war, crisis, gussa, etc.) an initial data set of 10,040 tweets was collected and served as the foundation for manual labelling where each tweet was annotated with eight predefined emotions (anger, fear, happiness, sadness, frustration, compassion, mixed, others relevant to the war and conflict domain. The manual labelling process was conducted by a team of experts proficient in both Hindi and English, ensuring that the nuances of English are accurately captured.

An example processing is described below.

Tokenization and Preprocessing:
Input Tweet: "Mujhe Bhayanak lag raha hai Static equilibrium diagram; ΣFx=0; Free-body diagram setup for force analysis."
Tokenized Output: ["Mujhe", "Bhayanak", "lag", "raha", "hai", "Static equilibrium diagram; ΣFx=0; Free-body diagram setup for force analysis."]
Roman Script Handling: Hindi words ("Mujhe", "Bhayanak") are retained in Roman script.
Emoji/Symbol Detection: "" is isolated as a symbolic token.

Emotion Dictionary Mapping (D):
Map tokens to emotions in E using bilingual (Hindi/English) emotion lexicons: "Bhayanak" (Hindi for "horrible") → Fear; "lag raha hai" (contextual phrase implying ongoing emotion) → Fear; "Static equilibrium diagram; ΣFx=0; Free-body diagram setup for force analysis." → Anger

Subword Decomposition (S):
Decompose complex terms for deeper analysis: "Bhayanak" → ["Bhay" (fear), "anak" (suffix)] to clarify its semantic root in fear.

Embedding Generation (E):
Generate token embeddings using Word2Vec/fastText: Embeddings for ["Mujhe", "Bhayanak", "lag", "raha", "hai", "Static equilibrium diagram; ΣFx=0; Free-body diagram setup for force analysis."] → vectors v1, v2, v3, v4, v5, v6.
Aggregation Rule: Average token embeddings to create a global semantic vector:
V_avg = (v1 + v2 + v3 + v4 + v5 + v6) / 6

Rule-Based Feature Extraction:
Extract auxiliary features for concatenation. Emotion Tag Counts: Fear: 2 instances ("Bhayanak", "lag raha hai"); Anger: 1 instance ("Static equilibrium diagram; ΣFx=0; Free-body diagram setup for force analysis.").
Code-Switch Flag: Binary flag = 1 (mixed Hindi and English tokens: "Mujhe" [Hindi], "lag", "raha", "hai" [Hindi-derived]).

Feature Fusion:
Combine aggregated embeddings and rule-based features into a unified input vector: Global Semantic Vector=V_avg(averaged embeddings),Emotion Counts=[Fear: 2, Anger: 1, Others: 0], Code-Switch Flag=1
Concatenation Rule Final Input Vector = V_avg Static equilibrium; ΣF=0; Diagram; Torque balancing lever experiment; Physics education; Force vectors. [Fear: 2, Anger: 1, Others: 0] Static equilibrium; ΣF=0; Diagram; Torque balancing lever experiment; Physics education; Force vectors. [1]
The machine learning algorithm processes this final vector, and the iterative process of annotation improvement begins. In the next section, we discuss the performance of the Active learning method adopted for this purpose.

After this, the dataset was then expanded to 19,000 tweets. This data set was curated using a combination of automated and semi-automated techniques, leveraging the insight gained from the initial manual annotation. The expanded data set was further refined from an iterative learning process, it involved selectively identifying and prioritizing ambiguous data/tweets for expert annotation and feedback from domain experts to improve accuracy, consistency, and efficiency of annotation. Throughout the data collection process, special attention was given to maintaining the balance between the different emotions, ensuring that the data set was representative of the diverse sentiments expressed about war and conflict. The resulting dataset is a valuable resource for analyzing Hinglish text. For better understanding, Figure 2 can be referred to.

Data labeling process flowchart: seed words, manual labeling, active learning, dataset expansion.
Figure 2: Procedure of dataset collection. The figure depicts the dataset development from seed word identification to manual labelling, followed by active learning, to the final annotated dataset. Please click here to view a larger version of this figure.

The final preparation of the dataset is done after completing the iterative refinement process with the help of active learning. Active learning was used in a hybrid framework that included lexical rules, machine learning, and iterative expert input to annotate the emotions of Hinglish utterances. The steps were as follows:

The process starts with a manually labeled dataset. Using a Random Forest classifier, which was employed to identify ambiguous tweets that the machine learning model was uncertain about. Send these ambiguous samples for categorization to human experts. The model was repeatedly updated using the recently annotated data, which gradually improved accuracy and reduced misclassifications. Finalize the dataset and review the annotations to ensure accuracy. Prepare the dataset for analysis, ensuring that it is properly documented and formatted for future use to implement in downstream cases. However, it is important to investigate the patterns of emotions embedded in the utterances so that future steps become clearer in terms of implementation. Hence, in the next step, cluster analysis will be performed to find dominant emotions embedded in the dataset. This also helps in identifying the emotions that we are researching. 

Selection of emotion clusters
Table 2 shows the emotion groups and their Hinglish equivalents, along with the reason for selecting the respective emotions. From each group of emotions, a dominant emotion has been selected for further processing. These dominant emotions are selected from cluster analysis.

Emotion GroupHinglish EquivalentJustification of Selection
Fear (includes anxiety and panic)Dar, khauf, Asahaj, Bekabu, Angadai, Chinta, tension, Fikr, Ashanka, Udaasi, Bechaini, GhabrahatFear is a common emotion in war and conflict, as individuals face threats to their safety and well-being. This fear can manifest in various ways, such as anxiety, panic attacks, and hypervigilance.
Anger (includes irritation, hostility, frustration, and hurt)Gussa, raag, Prakop, Raudra, Chidhaan, Shatruta, Krodh, Gussa dilana, apata, Atyachar, Khushfehmi, hairani, Bhayanak, Chakker KathinaaiAnger is another prevalent emotion in war and conflict, often arising from feelings of injustice, betrayal, or loss. This anger can fuel aggression and violence, contributing to the destructive nature of these conflicts.
Sadness (includes grief, despair, and hopelessness)Udaasi, gham, Shok, Bhavuk, Dukhi, Udas, Vismay, Nirasha, Shok, Dukhi, Vairagya, Aashank, Vishada, Bhavuk, Dukhi, Udas, Vinamrata, Bhavuk, Hridaytoda, Beumaar, nirasha, Vinaash, Bair, Nirasha, Asambhav, HaarSadness is a natural response to loss and grief, which are unfortunately common experiences in war and conflict. Soldiers may experience sadness over the loss of comrades, civilians may grieve for loved ones killed or displaced, and entire communities may mourn the loss of their homes and way of life. Feelings of despair and hopelessness can also arise due to the prolonged nature of the conflict and the seemingly endless cycle of violence.
Shame and GuiltSharm, lajjabari, Sharm, Laaj, Zillat, Afsos, Gunah, Afsos, Pashchatap, Laaj, Bechaini, Aatmasamarpan, Sharmindagi, Ashru, Pashchatap, Antaratma, Kasoor, gunaah, Khud ko doshi maana, Ninda, DoshaShame and guilt are complex emotions that can arise from feelings of personal or collective wrongdoing, inadequacy, or humiliation. In war and conflict, individuals may experience shame or guilt over their actions, their inability to prevent harm to others, or their survival while others have perished.
DisgustGhin, nafrat, Asahayak, Pratikool, Ghrina, Vairagya, Dvesha, Nakaratmak, Vibhavsu, Vairagya, Vairagya, NirashaDisgust is a feeling of revulsion or aversion towards something perceived as distasteful or offensive. In war and conflict, individuals may experience disgust in response to acts of cruelty, violence, and barbarity.
Empathy and CompassionSahaaanubhuti, hamderdari, Samajhdari, Daan Sahabhooti, Sensitivity, Supportiveness, Consideration, Kindness, Caring, Warmth, Tenderness, Daya, raham, Sahaaanubhuti, Sahyog, Dayalu, Samajh, Pyar, Daya, Narami, ParopkariEmpathy and compassion are vital for understanding and sharing the feelings of others. In war and conflict, empathy can be a powerful tool for connecting with others who have suffered similar experiences, fostering compassion, and promoting reconciliation. Compassion can motivate individuals to help those in need and contribute to healing and rebuilding efforts.
Hope and GratitudeUmeed, aasha, Chah, Ichha, Sapna, Unnati, Ashvasan, Khushi, Utsaah, Ashirwad, Samvedansheelata, Vishwas, Bharosa, Shukraguzaar, eshaananand, Shukrana, Aabhaar, Namrata, Samaanya, Naman, Aasherewad, Badhai, Dhanyavaad, Abhivadn, Manobhav, BhaktiHope is a feeling of optimism and expectation that something good will happen despite the challenges and difficulties faced. Gratitude is a feeling of thankfulness and appreciation for the good things in one's life. In war and conflict, hope can be a source of strength and motivation, enabling individuals to persevere and work towards a better future. Gratitude can help individuals focus on the positive aspects of their lives, foster resilience, and cultivate a sense of peace amidst the turmoil.
ResilienceJheelaanek, himmat, Sahasi, Sahas, Dhairya, Majbooti, Samvedansheel, Samarthya, Majbuti, LachariResilience is the ability to adapt and cope with difficult or challenging situations. In war and conflict, resilience is essential for individuals and communities to survive and persevere in the face of adversity.

Table 2: Justification for selection of emotion. The table maps emotion groups to their Hinglish equivalents and explains their relevance in contexts of war and conflict.

However, it must be noted that the selection of these emotions is not only based on cluster analysis but also grounded in the theories of emotions, including the Cognitive Appraisal Theory (CAT), the Discrete Emotions Theory (DET), and the Process-Oriented Theory (POT) of Emotion43.

Corpus details
The dataset consists of domain-specific (Wars, conflicts, and crises) and additional tweet datasets that contain a mix of Hindi and English tweets. Figure 3 is a snapshot of the tweet datasets available publicly being processed for this research work. The primary dataset is publicly available at https://data.mendeley.com/datasets/y63frd6pmf/7.

Experiment setup for multimodal emotion labeling using active learning; linguistic data files displayed.
Figure 3: Corpus details. The availability of the dataset is explained here. Please click here to view a larger version of this figure.

Annotation of emotion labels
An initial corpus of 10,040 Hinglish tweets related to war and conflict was manually annotated with eight emotion labels by bilingual experts. To address the linguistic complexity of code-mixed text, a lexical rule-based framework was developed, incorporating several components. The framework includes Emotion-Specific Dictionaries that map Hindi/English terms to emotions, such as fear_words = {Fear, Dread, Bhayanak, Sanskrit word "dahrashata" in Devanagari script, symbolizes fear or terror., Terror, Static equilibrium diagram; ΣFx=0; force vectors with resolved components; balance analysis.} and anger_words = {gussa, rage, Unknown symbol in Devanagari script, may represent a specific linguistic or cultural element., irritation, Hindi script word 'क्रोध' meaning anger, linguistic study.}. Cross-lingual equivalence rules linked the terms (e.g., if (Ae == Ah): anger = gussa | Sanskrit text example showing the word "Khaija" in Devanagari script.). Lexical rules such as emotion dictionaries, tokenization for mixed languages, and subword decomposition are used. In order to annotate emotions, these rules preprocess text and extract features, which are then combined with machine learning embeddings45.

For Tokenization, the framework utilized custom rules for language switching, punctuation, emojis, and subword tokenization. Hindi (Devanagari) text was tokenized at the character level, while English (Roman) used whitespace. Example: Mujhe frustration hai → [Mujhe, frustration, hai]. Special Characters like Hashtags (#) and mentions (@) were isolated as individual tokens (e.g., #WarCrimes → [#, WarCrimes]), while punctuation Marks like commas (,) and exclamation points (!) were split into separate tokens (e.g., Text in Hindi script says "भयानक" meaning dreadful or terrifying. → Devanagari text "भयानक" meaning "dangerous" in English translation., !]).

Emojis were also treated as standalone tokens and mapped to emotions (e.g., Static equilibrium diagram; ΣFx=0; Free-body diagram setup for force analysis. → anger, Chromatography diagram, illustrating protein purification using a chromatography system.→ sadness). Subword tokenization done with Devanagari script in which compound words were split using regex patterns for Sandhi rules (e.g., Word segmentation process, equation, text analysis diagram, Hindi word tokenization.] [kingdom + world]) and Roman Scripts prefixes/suffixes were segmented (e.g., unbelievable → [un, believable]). For domain-specific expansion, tokens were replaced with emotion labels if matched in dictionaries. For example: Bhayanak → fear, Dahad" → fear, gussa → anger. Tweet Mujhe Bhayanak lag raha hai → Tokens [Mujhe, fear, lag, raha, hai].

After vectorization, the processed tokens (words, subwords, emojis) were converted to 300-dimensional embeddings using Word2Vec/fastText. The numerical representations in column vectors of tokens, a matrix of vectors corresponding to tokens. Each row corresponds to an embedding vector associated with a token in the text, representing the token's order. Columns in a row signify dimensions in the embedding space. The vectors contain real numbers computed using Word2Vec and FastText. Tokens with zero vectors, depicted by rows with all zero values, may denote spaces or special characters lacking meaningful information in this representation. Embeddings aim to capture contextual word relationships for improved annotation. Non-zero vectors indicate meaningful representations of words or symbols. Values in these vectors encode various semantic and syntactic features. Zero vectors typically represent padding, space, or unrecognized tokens. Variability in values reflects the richness of features captured by the embedding model. Different vector dimensions capture diverse aspects of a word's meaning, context, and usage. Figure 4shows how vectors are represented, and from Figure 5, the implications of using the vectorization process can be understood.

Static equilibrium: text-tokens table with vector analysis; data preprocessing for NLP research.
Figure 4: Custom tokenization. The figure shows how vectors are represented in the embedding space and depicts how each token is transferred into a numerical format Please click here to view a larger version of this figure.

Vectorization process diagram: token types, embeddings purpose for contextual relationship capture.
Figure 5: Token vectorization process and its implications. The figure illustrates the implication of these processes, components, and highlights how these embeddings capture are semantics of emotions for accurate emotional classification. Please click here to view a larger version of this figure.

As per the research flow, the process starts with parsing the input text, expanding tokens using the rule-based dictionaries, and then breaking down these tokens into subwords. This approach provides a comprehension of the text’s emotional content and cultural context, and pseudo logic for the research is given below.

Initialize emotion dictionaries (e.g., fear_words = {"Fear", "Dread", "Bhayanak", ...}): Set Ae = Ah
SubwordRules(token, script): If Devanagari → split using regex (compound/Sandhi), If Roman → split prefixes/suffixes using regex, Return subwords
DomainSpecificExpansion(token): If token in emotional/linguistic dictionaries → return emotion
Else → return token
ProcessTweet(text): Define regex for Devanagari, Roman, others; Extract tokens using regex; Apply DomainSpecificExpansion and SubwordRules to tokens; Return processed subwords
Vectorise tokens into numerical embeddings
Apply Active Learning with human feedback

Access restricted. Please log in or start a trial to view this content.

Results

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The finding of this research suggests that integrating the lexical rules with machine learning and active learning techniques offers a viable pathway for enhancing the efficiency and accuracy of emotion annotation in code-mixed hinglish text. Through iterative refinement and expert suggestion, the proposed framework was able to achieve notable reductions in manual effort while sustaining high performance across evolution matrices. The outcomes indicate potential for broader applicability ...

Access restricted. Please log in or start a trial to view this content.

Discussion

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The dataset for this study was curated using a combination of manual annotation and active learning. Initially, 10,040 Hinglish tweets related to war and conflict were manually labeled with eight predefined emotions. The dataset was then expanded to 19,000 tweets using a semi-automated approach. Active learning enabled selective expert intervention, reducing manual effort by 40% while maintaining a high annotation accuracy of 81% with an F-score of 0.76. Lexical rules and emotion-specific dictionaries played a crucial ro...

Access restricted. Please log in or start a trial to view this content.

Disclosures

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The authors declare no conflict of interest.

Acknowledgements

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

This research received no external funding.

Access restricted. Please log in or start a trial to view this content.

Materials

List of materials used in this article
NameCompanyCatalog NumberComments
fastTextFacebook AIN/AWord representation and classification
Google ColabGoogleN/ACloud-based Jupyter Notebook environment
Google Colab GPU/TPUGoogleN/ACloud-based hardware acceleration
Intel Core i5/i7 or AMD Ryzen 5/7Intel / AMDN/AProcessor for local execution (if required)
MatplotlibOpen-sourceN/AData visualization library
NLTKOpen-sourceN/ANatural Language Toolkit for text processing
NumPyOpen-sourceN/ANumerical computing library
NVIDIA GTX 1650 or Higher (Optional)NVIDIAN/AGPU for deep learning tasks
PandasOpen-sourceN/AData manipulation library
Python Python Software FoundationN/AProgramming language for ML and NLP
PyTorchMeta AIN/ADeep Learning framework
RAM (8GB Minimum, 16GB Recommended)VariousN/AMemory requirement for ML tasks
Scikit-learnOpen-sourceN/AMachine Learning library
SeabornOpen-sourceN/AStatistical data visualization
SpaCyExplosion AIN/AIndustrial-strength NLP library
SSD Storage (256GB Minimum, 512GB Recommended)VariousN/AStorage for dataset processing
TensorFlowGoogleN/ADeep Learning framework

References

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,
  1. Herce, R. Non-locality of the phenomenon of consciousness according to Roger Penrose. Dialogo. 3 (2), 127-134 (2016).
  2. Wolfram, S. The future of computation. Math J. 10 (2), 329-362 (2006).
  3. Kusal, S., et al. A systematic review of applications of natural language processing and future challenges with special emphasis in text-based emotion detection. Artif Intell Rev. 56 (12), 15129-15215 (2023).
  4. Recent advancements and challenges in multimodal sentiment analysis: a survey. Dong, Z. X., Liu, H. 2023 Int Conf Machine Learning Cybernetics (ICMLC), , IEEE. 464-469 (2023).
  5. Gandhi, A., et al. Multimodal sentiment analysis: a systematic review of history, datasets, multimodal fusion methods, applications, challenges and future directions. Inf Fusion. 91, 424-444 (2023).
  6. Chand, V. The rise and rise of Hinglish in India. Conversation. , https://theconversation.com/the-rise-and-rise-of-hinglish-in-india-53476 (2016).
  7. Hernández-de-Menéndez, M., et al. Active learning in engineering education: a review of fundamentals, best practices and experiences. Int J Interact Des Manuf. 13, 909-922 (2019).
  8. Liu, X., et al. Developing multi-labelled corpus of Twitter short texts: a semi-automatic method. Systems. 11 (8), 390(2023).
  9. Alahmary, R., Al-Dossari, H. A semiautomatic annotation approach for sentiment analysis. J Inf Sci. 49 (2), 398-410 (2023).
  10. Garg, N., Sharma, K. Annotated corpus creation for sentiment analysis in code-mixed Hindi-English (Hinglish) social network data. Indian J Sci Technol. 13 (40), 4216-4224 (2020).
  11. Jamatia, A., et al. Deep learning based sentiment analysis in a code-mixed English-Hindi and English-Bengali social media corpus. Int J Artif Intell Tools. 29 (5), 2050014(2020).
  12. Nainabasti, B. Role of students' participation on learning physics in active learning classes. ProQuest ETD Collection for FIU. , AAI10743750(2016).
  13. Goudjil, M., et al. A novel active learning method using SVM for text classification. Int J Autom Comput. 15, 290-298 (2018).
  14. Huang, S. J., Jin, R., Zhou, Z. H. Active learning by querying informative and representative examples. Adv Neural Inf Process Syst. 23, 1-9 (2010).
  15. Zhang, Z., Strubell, E., Hovy, E. A survey of active learning for natural language processing. arXiv. , (2022).
  16. Baghel, R. A survey on code-mixed sentiment analysis based on Hinglish dataset. Int Conf Comput Commun Cyber-Secur. 664, (2022).
  17. Tong, S., Koller, D. Support vector machine active learning with applications to text classification. J Mach Learn Res. 2 (Nov), 45-66 (2001).
  18. Subramanian, M., et al. A survey on hate speech detection and sentiment analysis using machine learning and deep learning models. Alex Eng J. 80, 110-121 (2023).
  19. Liu, Z., et al. An emotion-based personalized music recommendation framework for emotion improvement. Inf Process Manag. 60 (3), 103256(2023).
  20. Ren, F., Liu, Z., Kang, X. An efficient framework for constructing speech emotion corpus based on integrated active learning strategies. IEEE Trans Affect Comput. 13 (4), 1929-1940 (2022).
  21. Azzi, S. A., Zribi, C. B. O. Comparing deep learning models for multi-label classification of Arabic abusive texts in social media. Proc Int Conf Software Tech, , 374-381 (2022).
  22. Min, X. Y., et al. Multi-label active learning through serial-parallel neural networks. Knowl Based Syst. 251, 109226(2022).
  23. Gosselin, L., Sabourin, L. Language athletes: dual-language code-switchers exhibit inhibitory control advantages. Front Psychol. 14, 1150159(2023).
  24. Acheampong, F. A., Wenyu, C., Nunoo-Mensah, H. Text-based emotion detection: advances, challenges, and opportunities. Eng Rep. 2 (7), e12189(2020).
  25. Tracy, J. L., Randles, D. Four models of basic emotions: a review of Ekman and Cordaro, Izard, Levenson, and Panksepp and Watt. Emotion Rev. 3 (4), 397-405 (2011).
  26. Xiao, X., et al. A cognitive emotion model enhanced sequential method for social emotion cause identification. Inf Process Manag. 60 (3), 103305(2023).
  27. Park, E. H., Storey, V. C. Emotion ontology studies: a framework for expressing feelings digitally and its application to sentiment analysis. ACM Comput Surv. 55 (9), 1-38 (2023).
  28. Batra, H., Nelson, L. DCADS: data-driven computer aided diagnostic system using machine learning techniques for polycystic ovary syndrome. Int J Performability Eng. 19 (3), 193(2023).
  29. Sakib, N., et al. Towards automated recipe genre classification using semi-supervised learning. PLoS One. 20 (1), e0317697(2025).
  30. Fu, L., et al. A touch, vision, and language dataset for multimodal alignment. arXiv. , (2024).
  31. Modeling public mood and emotion: Twitter sentiment and socio-economic phenomena. Bollen, J., Mao, H., Pepe, A. Proc Int AAAI Conf Web Soc Media, 5 (1), https://ojs.aaai.org/index.php/ICWSM/article/view/14171 (2011).
  32. EmpaTweet: annotating and detecting emotions on Twitter. Roberts, K., et al. Proc Eighth Int Conf Language Resource Eval, 12 (12), 3806-3813 (2012).
  33. Mohammad, S. #Emotional tweets. First Joint Conf on Lexical Comput Semantics. , 246-255 (2012).
  34. Li, W., Xu, H. Text-based emotion classification using emotion cause extraction. Expert Syst Appl. 41 (4), 1742-1749 (2014).
  35. Verma, P., Kaur, A., Khurana, M., Damaševičius, R. Multimodal Hinglish tweet dataset for deep pragmatic analysis. Data. 9 (2), 38(2024).
  36. Hasan, M., Agu, E., Rundensteiner, E. Using hashtags as labels for supervised learning of emotions in Twitter messages. ACM SIGKDD Workshop Health Info. 34 (74), 1-8 (2014).
  37. Scherer, K. R., Wallbott, H. G. Evidence for universality and cultural variation of differential emotion response patterning. J Pers Soc Psychol. 66 (2), 310(1994).
  38. Sasidhar, T. T., Premjith, B., Soman, K. P. Emotion detection in Hinglish (Hindi+ English) code-mixed social media text. Procedia Comput Sci. 171, 1346-1352 (2020).
  39. Corpus creation and emotion prediction for Hindi-English code-mixed social media text. Vijay, D., et al. Proc. 2018 Conf. North Am Chapter Assoc Comput Linguistics: Student Research Workshop, , 128-135 (2018).
  40. Srivastava, V., Singh, M. Phinc: a parallel Hinglish social media code-mixed corpus for machine translation. arXiv. , (2004).
  41. Cossu, J. V., Molina-Villegas, A., Tello-Signoret, M. Active learning in annotating micro-blogs dealing with e-reputation. J Interdiscip Methodol Issues Sci. 3, (2017).
  42. Kranjc, J., et al. Active learning for sentiment analysis on data streams: methodology and workflow implementation in the ClowdFlows platform. Inf Process Manag. 51 (2), 187-203 (2015).
  43. Smith, C. A., Kirby, L. D. Consequences require antecedents: toward a process model of emotion elicitation. Feeling and Thinking: The Role of Affect in Social Cognition. , 83-106 (2000).
  44. Jan, T. G., Khurana, S. S., Kumar, M. Semi-supervised labeling: a proposed methodology for labeling the Twitter datasets. Multimed Tools Appl. 81 (6), 7669-7683 (2022).
  45. Cahyana, N. H., et al. Semi-supervised text annotation for hate speech detection using k-nearest neighbors and term frequency-inverse document frequency. Int J Adv Comput Sci Appl. 13 (10), 147-151 (2022).
  46. Saifullah, S., et al. Automated text annotation using a semi-supervised approach with meta vectorizer and machine learning algorithms for hate speech detection. Appl Sci. 14 (3), 1078(2024).
  47. Advani, L., Lu, C., Maharjan, S. C1 at SemEval-2020 Task 9: SentiMix: sentiment analysis for code-mixed social media text using feature engineering. arXiv. , (2008).
  48. Alarcão, S. M., et al. Annotate smarter, not harder: using active learning to reduce emotional annotation effort. IEEE Trans Affect Comput. 15 (3), 1213-1227 (2023).

Access restricted. Please log in or start a trial to view this content.

Reprints and Permissions

Request permission to reuse the text or figures of this JoVE article

Request Permission

Tags

Emotion AnnotationHinglish UtterancesCode Mixed LanguageLexical Rule BasedMachine LearningActive LearningBilingual Emotion DictionarySubword TokenizationCognitive Appraisal TheoryDiscrete Emotions Theory
Video Coming Soon

Related Articles