End-to-End Emotion Semantic Parsing (2024)

Abstract: Emotion detection is the task of automatically associating one or more emotions with a text. The emotions are experienced, targeted, and caused by different semantic constituents. Therefore, it is necessary to incorporate these semantic constituents into the process of emotion detection. In this study, we propose a new task called emotion semantic parsing which aims to parse the emotion and semantic constituents into an abstract semantic tree structure. In particular, we design an end-to-end generation model to capture the relations between emotion and all the semantic constituents, and to generate them jointly. Furthermore, we employ a task decomposition strategy to capture the semantic relation among these constituents in a more cognitive and structural way. Experimental results demonstrate the importance of the proposed task, and indicate the proposed model gives superior performance compared to other models.

text: Findings of the Association for Computational Linguistics ACL 2024, pages 37–47 August 11-16, 2024 ©2024 Association for Computational Linguistics
End-to-End Emotion Semantic Parsing
Xiaotong Jiang, Zhongqing Wang∗, and Guodong Zhou 1Natural Language Processing Lab, Soochow University, Suzhou, China
xtjiang21@stu.suda.edu.cn,{wangzq,gdzhou}@suda.edu.cn
Abstract
Emotion detection is the task of automatically associating one or more emotions with a text. The emotions are experienced, targeted, and caused by different semantic constituents. Therefore, it is necessary to incorporate these semantic constituents into the process of emotion detection. In this study, we propose a new task called emotion semantic parsing which aims to parse the emotion and semantic constituents into an abstract semantic tree structure. In particular, we design an end-to-end generation model to capture the relations between emotion and all the semantic constituents, and to generate them jointly. Furthermore, we employ a task decomposition strategy to capture the semantic relation among these constituents in a more cognitive and structural way. Experimental results demonstrate the importance of the proposed task, and indicate the proposed model gives superior performance compared to other models.

heading: 1 Introduction
text: The goal of emotion detection is to automatically detect or categorize the emotional states of human according to some inputs. Nowadays, emotion detection can be found in a broad range of applications, including but not limited to emotional support (Tu et al., 2022; Pavarini et al., 2023), human-computer interaction (Chowdary et al., 2021; Alrowais et al., 2023) and healthcare surveillance (Dhuheir et al., 2021; Fang et al., 2023). Henceforth, emotion detection has attracted increasing attention from both research community and industry in recent years (Hu et al., 2021; Zanwar et al., 2023).
In literature, most studies focus on detecting emotion from the given text. For example, featurebased works (Balahur et al., 2011) and deep learning approaches, including RNNs (Majumder et al.,
∗ Corresponding author
He clenched his fists as he watched the bully taunt his little brother.
clenched his fists (Trigger)
(Feelings) (Entities)
Anger (Emotion) Negative (Sentiment)
he (Holder) the bully taunt his little brother
(Target)
emotion semantic parsing
Abstract Semantic Tree
Figure 1: Example of abstract semantic tree.
2019), Transformers (Yu et al., 2018), and pretrained language models (Zheng et al., 2022; Zanwar et al., 2023) are used in emotion detection. Nevertheless, over the past few years, numerous studies (Xia and Ding, 2019; Kim and Klinger, 2018; Campagnano et al., 2022) have indicated that the emotions may be experienced, targeted, and/or caused by different semantic constituents, and can be linked to form abstract semantic structures.
However, most existing works only take “cause” into consideration, neglecting the intricate relationships between emotion constituents, such as the strong relationship between trigger and emotion, as well as the similarity of sentiment and emotion labels. This limitation makes acquiring a nuanced understanding of the interplay between emotion and semantic constituents challenging, thereby hindering the model’s capability to thoroughly comprehend emotional expression. By addressing these complexities, we believe it can serve as a foundational component for improving results in downstream real-world tasks by providing a more comprehensive understanding of emotional dynamics and their influence.
To tackle the above problem, we propose a new
37
task called emotion semantic parsing which aims to parse the emotion and semantic constituents into an abstract semantic tree structure. In this work, we consider five emotion-related semantic constituents into this task, including emotion, sentiment, trigger, holder, and target. As shown in Figure 1, emotion and sentiment refer to the specific emotion and sentiment labels of the sentence; trigger refers to a trigger word or expression that describes an emotion; and the constituents of holder and target correspond to the person or entities towards whom or from whom the emotion is directed, respectively.
Moreover, we use the form of the abstract semantic tree structure to model the relationship between these constituents, we use the Trigger node to represent the whole abstract semantic tree, and we use the virtual Feelings and Entities nodes to compass other constituent nodes. The tree structure can be considered as a semantic representation in order to better represent the structure of the emotionrelated constituents. As shown in Figure 1, the tree structure models a sentence using a rooted directed acyclic graph, highlighting its main elements (e.g. emotion, triggers) and semantic relations. It can thus potentially reveal a more comprehensive and complete semantic structure for extracting these constituents. Furthermore, since the emotion and semantic constituents are correlated in the form of the abstract semantic tree structure, we design an end-to-end generative model to predict them jointly. Specifically, our proposed model begins by decomposing the original task into several sub-tasks, as shown in Figure 2. Subsequently, the proposed model utilizes template-based prompt learning to extract each semantic constituent and semantic constituents pair separately for each sub-tasks. Finally, the proposed model leverages the acquired knowledge from sub-tasks to generate all semantic constituents in the main task.
We conducted extensive experiments on the unified benchmark. Experimental results demonstrate the importance of the proposed task, and indicate the proposed model gives superior performance compared to other models. Further analysis shows the effect of the proposed abstract semantic tree structure and decomposition strategies.

heading: 2 Related Works
text: In the domain of emotion analysis, previous studies have mainly focused on text-based emotion detection. Early feature-based work often relied on
traditional machine learning algorithms and manually crafted word-level emotion lexicons (Balahur et al., 2011). As deep neural networks progressed, emotion detection methods began utilizing various networks, such as RNNs (Majumder et al., 2019) and Transformers (Vaswani et al., 2017; Yu et al., 2018), to learn the emotion-related representation for detection. Recently, pre-trained language models (Devlin et al., 2019; Raffel et al., 2020) have dominated this area with its flexibility and rich internal knowledge (Alvarez-Gonzalez et al., 2021; Zheng et al., 2022).
The emotions are not expressed individually, and can be experienced, targeted, and caused by different semantic constituents (Xia and Ding, 2019; Xiao et al., 2023; Campagnano et al., 2022). Most recent studies focus on emotion cause extraction task (Xia and Ding, 2019; Wang et al., 2023; Gu et al., 2023), with the goal of extracting the potential pairs of emotions and corresponding causes in the document and conversation scenario. Many end-to-end approaches have been proposed. These works can be broadly categorized into two main groups: some focus on multi-task learning (Ding et al., 2020a,b; Chen et al., 2022), while others transform the original task into a unified sequence labeling problem (Yuan et al., 2020; Chen et al., 2020). Recently, Xiao et al. (2023) developed a rule-based system to extract emotion causes on social media from constituency parsing trees. Wang et al. (2023) proposed emotion cause triplet extraction to extract emotion-cause-category triplets for fine-grained emotion cause analysis.
Different from prior studies, we introduce a novel task, termed emotion semantic parsing. This task seeks to comprehensively examine the impact of various semantic constituents on emotional expressions. To achieve this, we develop an endto-end generative model specifically designed to capture the intricate relationships between emotion and a wide range of semantic constituents.

heading: 3 Preliminaries
text: As shown in Figure 2, we introduce a novel task termed emotion semantic parsing. This task focuses on the generation of an abstract semantic tree structure that encapsulates both emotion and semantic constituents. To achieve this, we develop an end-to-end generative model specifically tailored for the generation of the abstract semantic tree structure. Our proposed model adopts a
decomposition-based strategy, breaking down the complex task into several more manageable subtasks. Specifically, our proposed model begins by decomposing the original task into several subtasks. Finally, the proposed model leverages the acquired knowledge from sub-tasks to generate all semantic constituents in the main task.
In this section, we introduce two important issues of this task: abstract semantic tree construction and the abstract semantic tree parsing model. The decomposition-based strategy for abstract semantic tree parsing will be discussed in the next section.

heading: 3.1 Abstract Semantic Tree Construction
text: Inspired by the widespread impact of tree structures in parsing tasks (Li et al., 2023; Groschwitz et al., 2023), we represent the relationships among multiple constituents in a tree structure. This approach allows us to capture the complex dynamics inherent in emotional expression. We first introduce the constituents in the abstract semantic tree, then we describe the construction process of the tree.
Definitions of Semantic Constituents There are five types of semantic constituents, each serving as a node in the abstract semantic tree. Their definitions are provided below:
• Emotion is the specific emotion label represented from the original text. In this study, we use Plutchik (2001)’s taxonomy of emotion.
• Sentiment is the specific sentiment label represented from the original text, including “positive”, “negative”, and “neutral”.
• Trigger refers to a trigger word or expression that describes an emotion, even if it is implicit.
• Holder refers to a person or entity that feels or experiences the emotion identified by the trigger.
• Target refers to a person or entity towards whom/which the emotion identified by the trigger is directed.
Process of Tree Construction As shown in Figure 1, the abstract semantic tree represents a sentence through a rooted directed acyclic graph utilizing the aforementioned semantic constituents. The construction process is outlined below:
• We take the “Trigger” node as the root node, since it is the most important constituent in the emotion parsing.
• The virtual nodes “Feelings” and “Entities” are linked to Trigger node.
• The “Sentiment” and “Emotion” are linked to “Feelings” as terminal nodes, while the “Holder” and “Target” are linked to “Entities” node.
As Figure 1 shows, the trigger “clenched his fists” implies the author’s emotion. The holder and target are “he” and “the bully taunt his little brother”, respectively. By leveraging these emotion-related semantic constituents, the model can accurately predict the “anger” emotion and “negative” polarity of the sentence.

heading: 3.2 Basic Semantic Tree Parsing
text: After we construct the abstract semantic tree, we then employ a generative model to parse the emotion and all the semantic constituents into a linearized tree structure. As shown in Figure 2, given an input text, the output can be represented as a linearized semantic tree.
We adopt the pre-trained language model T5 (Chung et al., 2022) as our transformer-based encoder-decoder architecture. Therefore, by formulating parsing tasks as a text generation problem, we can tackle them in a unified sequence-tosequence framework without a task-specific model design.
The main challenge of emotion semantic parsing is the complex structure inherently in the emotional expression. Specifically, the complex structure will bring out two challenges: First, the large number of semantic constituents raises the complexity to the parsing task. Consequently, the precise extraction of every constituent becomes challenging yet indispensable. Second, effectively modeling these internal relationships also presents a significant challenge in the task.

heading: 4 Decomposition-based Semantic Tree Parsing Model
text: In this study, we propose a decomposed-based generative model to tackle the above challenges. The motivation is to alleviate the complexity of the original task by decomposing it into several sub-tasks. As shown in Figure 2, our proposed model can be
SMU Classification: Restricted
separated into two stages: decomposition and recomposition. Our model firstly breaks down the original abstract semantic parsing task into several sub-tasks, and then designs individual instructionbased templates for each task. All sub-tasks are fine-tuned by a generative backbone at the same time. Based on the model parameters from the last re-composition stage, our model further finetunes its parameters again with the original task, which involves jointly parsing all semantic constituents.

heading: 4.1 Task Decomposition Strategy
text: To implement a generalized framework that is applicable to all tasks, we design templates for each individual task. The input template for each task comprises the task-specific instruction, and the original text to be parsed. The output template for each task is the sub-tree containing the constituents to be parsed. The following templates use the example in Figure 2 as the Original Text.
Mono Parsing includes trigger, emotion, sentiment, holder, and target parsing, individually. As shown in Figure 3(a), these sub-tasks aim to capture each specific constituent:
//taking emotion parsing task as an example
INPUT Detect the emotion label in the emotional expression: + Original Text
Output [Emotion (Anger)]
Trigger-related Pair Parsing includes triggeremotion, trigger-sentiment, trigger-holder, triggertarget, trigger-feelings, and trigger-entities. As shown in Figure 3(b), these sub-tasks aim to capture the relationship between the trigger and each specific constituent:
//taking trigger-holder parsing task as an example
INPUT Extract both the trigger and holder in the emotional expression: + Original Text
Output [Trigger (clench his fists), [Entities, [Holder (he)]]]
Entities Pair Parsing aims to capture the relationship between holder and target, and can gain insights into the interpersonal dynamics and relational aspects that influence emotional experiences. The example is shown in Figure 3(c), with the template of prompt provided below:
INPUT Extract both holder and target in the emotional expression: + Original Text
Output [Entities, [Holder (he), Target (the bully taunt his little brother) ]]
Feelings Pair Parsing aims to capture the relationship between sentiment and emotion. The example is shown in Figure 3(d), with the template of prompt provided below:
INPUT Extract both the emotion and sentiment labels in the emotional expression: + Original Text
Output [Feelings, [Emotion (Anger), Sentiment (Negative) ]]

heading: 4.2 Task Re-composition Strategy
text: After gaining knowledge from sub-tasks, the model has learned the pattern of the template and the relationships from different emotion-related semantic constituents. Thus it can boost the final end-to-end emotion semantic parsing task, which is to predict the emotion label and outputs all emotion-related semantic constituents in the form of an abstract semantic tree. The example is shown in Figure 2, and the template of prompt is the below:
INPUT Extract emotion trigger, holder, target, and emotion and sentiment labels in the emotional expression: + Original Text
Output [Trigger (clenched his fists), [Feelings, [Emotion (Anger), Sentiment (Negative)]], [Entities, [Holder (he), Target (the bully taunt his little brother) ]]]

heading: 4.3 Objective Functions and Training
text: In this subsection, we show the objective functions and training process of the proposed model.
The goal is to maximize the output linearized tree XT probability given the sentence X . Therefore, we optimize the negative log-likelihood loss function:
L = − 1|τ | ∑
(X,XT )∈τ log p(XT |X; θ) (1)
where θ is the model parameters, and (X,XT ) is a (sentence, tree) pair in training set τ , then
log p(XT |X; θ) = n∑
i=1
log p(xiT |x1T , x2T , ...xi−1T , X; θ) (2)
where p(xiT |x1T , x2T , ...xi−1T , X; θ) is calculated by the decoder.

heading: 5 Experimentation
text: In this section, we introduce the datasets used for evaluation and the baseline methods employed for comparison. We then report the experimental results conducted from different perspectives, and analyze the effectiveness of the proposed model with different factors.

heading: 5.1 Settings
text: We evaluate the effectiveness of our proposed method on a benchmark proposed in Campagnano et al. (2022), which combines several datasets. We specifically choose three datasets (Mohammad et al., 2015; Kim and Klinger, 2018; Bostan et al., 2020) from this benchmark because they are the only ones that encompass annotations for all constituents. We enhance the quality of the original dataset by deleting duplicate or irrelevant examples (e.g., those with all trigger, holder, and target are “null”), while ensuring the trigger is not “null”. The distribution of dataset is shown in Table 1. We choose 90% of the data as the training set, and the remaining 10% of the data as the testing set. Additionally, 10% of the training data is randomly set aside for validation during the training process.
Our proposed method utilizes the generative backbone Flan-T5 (Chung et al., 2022) from HuggingFace’s hub. All experiments are conducted on a single NVIDIA Tesla V100 GPU with 32GB memory. The model is trained for 10 epochs in each of the two stages, using the AdamW (Loshchilov and Hutter) optimizer, with a maximum sequence length of 256, a batch size of 16, and a learning rate of 3e-4. And the average results over 5 runs with different random seeds are reported. We adopt F1score as the metric for all experiments, the micro F1 is employed to evaluate the overall performance.

heading: 5.2 Main Results
text: To better evaluate the effectiveness of our proposed model, we compare its performance against several strong baseline models, which are detailed below,
• BERT-CRF (Campagnano et al., 2022) employs bidirectional LSTM layers over BERT representation, then uses CRF to generate token-level labels to determine the span boundary of each semantic constituent.
• BERT-MRC (Devlin et al., 2019) is used to predict the start and end indexes of all required semantic constituents.
• TaskFusion (Zanwar et al., 2023) is a multitask framework with a pre-trained language model for emotion-related tasks. We adopt it for the proposed emotion semantic parsing task.
• USSA (Zhai et al., 2023) is a joint learning framework, which transfers aspect-based sentiment analysis into a 2D table-filling scheme. We adopt it for the proposed emotion semantic parsing task.
• T5 (Chung et al., 2022) is a pre-trained language model which naturally suits the sequence-to-sequence task. It also can be considered as a joint learning framework, which generates all the semantic constituents jointly.
• ChatGPT (Ouyang et al., 2022) uses dialogbased instructional data in the supervised and RL-based meta-training stages. We use ChatGPT API1 to generate all required semantic constituents.
• LLaMA (Touvron et al., 2023) is a series of large language models trained on trillions of tokens. We use Alpaca-LoRA2 to finetune LLaMA-7B to generate required semantic constituents.
As demonstrated in Table 2, several key observations can be made: 1) Aligning with the current trend favoring generative frameworks, models that adopt a generative paradigm (i.e., T5, LLaMA, and our proposed model) generally outpace models based on a classification paradigm (i.e., BERT-CRF, BERT-MRC, Task Fusion, USSA) in terms of performance. 2) A standout observation is the substantial performance disparity between ChatGPT and all other methodologies. This discrepancy might be attributed to our limited usage of ChatGPT’s API, without fine-tuning its internal parameters using insights from our training dataset.
In contrast, our proposed model consistently outperforms prior studies (p < 0.05) in all settings. This underscores the effectiveness of our model, employing task decomposition strategies and the abstract semantic tree structure.
SMU Classification: Restricted

heading: 5.3 Influence of Semantic Constituents
text: We then analyze the influence of the semantic constituents and the correlations among them. As shown in Table 3, e denotes the emotion label, s is the sentiment polarity, t, h and a are trigger, holder, and target, separately. In addition, the rows in the table mean different combinations of emotionrelated semantic constituents. For example, (e, s) means that we used the proposed model to generate the emotion label and the sentiment polarity jointly.
From the table, it is evident that there is a clear correlation between emotion and sentiment polarity, as the combined performance of (e, s) surpasses that of generating emotion e alone. This underscores the importance of considering sentiment polarity when analyzing and interpreting emotions. Additionally, our findings reveal that the majority of semantic constituents contribute significantly to
1https://api.openai.com/v1/chat/completions 2https://github.com/tloen/alpaca-lora
emotion detection, especially trigger t. For example, the combined performance of (e, t) surpasses that of generating emotion e alone by a large margin. This underscores the importance of these semantic elements in understanding and contextualizing emotions within a given text.
Furthermore, our results highlight a correlation between the holder h and target a with the trigger t, as they often refer to the person or entity experiencing or feeling the emotion triggered by a specific event or situation. This emphasizes the interconnected nature of these semantic constituents and their collective role in shaping emotional expressions.
Notably, we observe that incorporating all semantic constituents leads to the highest performance, highlighting the effectiveness of our proposed model with semantic tree parsing. This underscores the utility and relevance of these semantic constituents in enhancing emotion detection accuracy.

heading: 5.4 Effect of Tree Structures
text: To assess the impact of the abstract semantic tree structure, we evaluated our model’s performance using four distinct tree structures in Figure 4.
In our initial assessment, we removed the entire tree structure, treating the semantic constituents as a linear sequence (a). This modification resulted in a substantial decrease in performance, from 46.7% to 40.7%, emphasizing the importance of the tree structure in capturing the intricate relationships among semantic constituents.
Subsequently, we constructed two simplified tree structures, with either Trigger (b) or Emotion (c) serving as the root node. Interestingly, both of these structures yielded comparable performance results, suggesting that both of them are pivotal components in the emotion parsing task, and their roles are equally significant. Furthermore, we introduced two virtual nodes, labeled as Feelings and
SMU Classification: Restricted
Entities into the tree structure (d). The inclusion of these nodes led to a noticeable improvement in performance, highlighting the efficacy of our proposed tree structures and reinforcing the importance of considering semantic constituents within a structured framework for accurate emotion parsing.

heading: 5.5 Impact of Decomposition Strategies
text: We further investigated the influence of various decomposition strategies, and the results are presented in Table 4, where Mono denotes Mono Parsing, TriggerPair denotes Trigger-related Pair Parsing, EntitiesPair denotes Entities Pair Parsing, and FeelingsPair denotes Feelings Pair Parsing. All of these can be found in Section 4.1.
Our analysis reveals that among all the strategies, mono parsing exerts the most substantial impact on model performance, aligning with our initial expectations. Mono parsing can be regarded as the foundational and indivisible task that serves as the basis for other higher-level tasks. Moreover, our findings indicate that all the decomposition strategies employed have a positive influence on the task, emphasizing the importance of breaking down the original task into smaller sub-tasks and the efficacy of reintegrating these sub-tasks to address the main task.

heading: 5.6 Case Study
text: To highlight our model’s significance, we’ve chosen several challenging and illustrative examples shown in Figure 5.
These challenging sentences share the same feature: they express more than one emotion expres-
sion, each associated with its own trigger, holder, and target. However, in each case, there is only one overall emotion. The presence of secondary emotions makes it difficult to fully grasp the overall emotional tone of the sentence.
In the first two examples, the mis-detection of emotion expressions by T5 underscores the intricate and nuanced nature of the task, as well as the significance of each element in constructing a precise semantic representation. However, even when the correct emotion expression is identified, modeling the complex relationship between emotion and other semantic components remains challenging. As illustrated in the final example, although T5 correctly identifies the expression and its trigger, its inability to accurately detect the holder and target leads to an incorrect prediction of emotion. This highlights the interconnected nature of these elements and underscores their collective importance in achieving accurate emotion detection.
In contrast, our proposed model, by leveraging task decomposition, demonstrates enhanced efficacy in navigating complexities present in difficult scenarios such as negotiation, emotion shifts, and multiple possible emotion expressions. This not only facilitates accurate detection of individual constituents but also enables a more nuanced understanding of their interrelationships, leading to improved overall performance.

heading: 6 Conclusion
text: In this study, we introduce a novel task called emotion semantic parsing, which focuses on analyzing emotions and semantic elements to construct an ab-
stract semantic tree structure. To achieve this, we develop an end-to-end generation model capable of capturing intricate relationships between emotions and various semantic constituents, generating them collaboratively. Furthermore, our proposed model employs template-based prompt learning, allowing for the separate extraction of each semantic constituent and pairs of semantic constituents for individual sub-tasks. Experimental results not only underscore the significance of the introduced task but also showcase the superior performance of our proposed model.
Limitations
Our work focuses on employing a unified framework for emotion semantic parsing. However, one of the limitations is the computational complexity of the proposed model, whose training speed is slower than the classification-based models. Secondly, more tasks could be further explored, including nested emotion parsing, cross-domain and cross-lingual emotion semantic parsing. Finally, a large language model (LLM) can achieve superior performance in nearly all downstream tasks including our task, attributed to their ability to introduce rich knowledge learned during the pretraining stage for our proposed task. For opensource large language models like LLaMA (Touvron et al., 2023), limitations include high computational costs, high-quality data costs, as well as the need to address LLM-related issues such as safety, hallucinations, and ethical concerns, which remain to be resolved in future work.

heading: Acknowledgements
text: We would like to thank Shufan Fu for her invaluable advice and assistance with the experiments during this work. We also gratefully thank the anonymous reviewers for their insightful and valuable comments. This work is supported by the National Natural Science Foundation of China (No. 62076175, No.61976146), and Jiangsu Innovation Doctor Plan.

heading: Future Work
text: , 2023), limitations include high computational costs, high-quality data costs, as well as the need to address LLM-related issues such as safety, hallucinations, and ethical concerns, which remain to be resolved in future work