ECoK: Emotional Commonsense Knowledge Graph for Mining Emotional Gold (2024)

Abstract: The demand for understanding and expressing emotions in the field of natural language processing is growing rapidly. Knowledge graphs, as an important form of knowledge representation, have been widely utilized in various emotion-related tasks. However, existing knowledge graphs mainly focus on the representation and reasoning of general factual knowledge, while there are still significant deficiencies in the understanding and reasoning of emotional knowledge. In this work, we construct a comprehensive and accurate emotional commonsense knowledge graph, ECoK. We integrate cutting-edge theories from multiple disciplines such as psychology, cognitive science, and linguistics, and combine techniques such as large language models and natural language processing. By mining a large amount of text, dialogue, and sentiment analysis data, we construct rich emotional knowledge and establish the knowledge generation model COMET-ECoK. Experimental results show that ECoK contains high-quality emotional reasoning triples, and the performance of our knowledge generation model surpasses GPT-4-Turbo, which can help downstream tasks better understand and reason about emotions. Our data and code is available from https://github.com/ZornWang/ECoK.

heading: 1 Introduction
text: In the field of artificial intelligence, despite the remarkable progress we have made, a core challenge remains: how to endow machines with commonsense reasoning abilities akin to those of humans (Lake et al., 2017). When humans observe an event, they can effortlessly leverage their background knowledge, experience, and intuition to predict and reason about the unobserved causes and effects related to that event. This capability comes naturally
* Equal contribution. † Corresponding author.
to humans but poses a significant challenge for current AI systems. Currently, the majority of AI systems are trained on datasets and objectives tailored for specific tasks (Marcus, 2018). As these models are solely focused on completing their designated tasks, they often lack an understanding and application of the simple and interpretable commonsense knowledge that is widespread in the human world (Davis and Marcus, 2015).
To address this limitation, commonsense knowledge graphs have been proposed as a solution. Commonsense knowledge graph is a graph structure that encompasses a wide range of general knowledge, providing AI systems with rich background information and contextual relationships. By integrating commonsense knowledge graphs into the training of AI systems, we can endow models with enhanced commonsense reasoning capabilities. Examples of previously proposed commonsense knowledge graphs include ConceptNet (Speer et al., 2017) and ATOMIC (Sap et al., 2019),
8055
which contain representations and inferences of numerous factual knowledge, thereby serving as valuable information sources for AI systems.
However, these knowledge graphs often emphasize the representation of factual knowledge while neglecting the description of emotions. Emotion is a multifaceted and complex psychological phenomenon that involves cognition, physiology, behavior, and the environment. The absence of knowledge in this domain leads to limited capabilities in understanding and reasoning about affective aspects. For example, as shown in Figure 1, a YouTuber may need to shoot a video. If the individual lacks the necessary equipment, they may feel disappointed and seek solutions such as purchasing equipment. If the video editing is completed, they may sound delighted and feel grateful due to praise received.
Therefore, there is a need for the development of emotional knowledge graphs that can capture and represent the multifaceted nature of emotions. Emotional commonsense knowledge graphs not only pay attention to factual knowledge but also emphasize the description and expression of emotions. Compared to general commonsense knowledge graphs, emotional commonsense knowledge graphs place more emphasis on portraying emotional states, emotional triggers, and emotional reactions. This more nuanced representation of emotional knowledge will greatly facilitate artificial intelligence’s understanding of emotional complexity, thereby enhancing its performance in areas such as human-computer interaction, natural language processing, and intelligent recommendation.
In this work, we propose a dedicated Emotional Commonsense Knowledge graph, ECoK. Based on research on the theory of emotional components and psychological analysis of emotions, we construct an emotional knowledge framework that focuses on seven related aspects of emotions centered around specific events: group, causes, bodily symptoms, feelings, expression, action tendencies, and advice. We extract and generate emotional knowledge from large language models, and use professionals to check the data to build a large-scale emotional commonsense knowledge graph. Our final knowledge graph contains over 140K high-quality emotional reasoning knowledge. Additionally, we train ECoK using the COMET framework (Bosselut et al., 2019) and evaluate the performance of the generated commonsense knowledge and ECoK in downstream tasks.
In summary, our main contributions are as follows:
• We propose a novel commonsense knowledge graph, ECoK, which comprises over 140K high-quality tuples and encompasses various aspects of emotional inference knowledge.
• We establish knowledge generation model COMET-ECoK for more extensive knowledge generation. Our model outperforms all baseline models, including the current largest pretrained language model, GPT-4-Trubo.
• We conduct extensive experiments to validate the knowledge expression capabilities of ECoK. In the tasks of Emotion Recognition in Conversation (ERC) and Casual Emotion Entailment (CEE), the comprehensive performance of our knowledge graph also surpasses that of other commonsense knowledge graphs.

heading: 2 Related Work
text: Commonsense Knowledge Graphs Commonsense knowledge graphs can be referenced by machine learning models to handle a variety of challenging tasks, playing an important role in the field of natural language processing. Among them, the ConceptNet (Speer et al., 2017) knowledge graph consists of 36 relations and mainly contains 3.4M taxonomic and lexical knowledge and physical commonsense knowledge. The ATOMIC (Sap et al., 2019) knowledge graph consists of 9 relations and 880K tuples, containing a large amount of social commonsense. The ATOMIC2020 (Hwang et al., 2021) extends to 23 relations based on ATOMIC, containing 1.33M tuples of daily reasoning knowledge. However, among these widely used knowledge graphs, there is no explicit focus on emotions. To extend the research on emotional commonsense knowledge graphs, we propose ECoK, which can be better applied to natural language processingrelated tasks.
Psychological Study of Emotion Emotion has been a fundamental area of inquiry within psychology, serving as a key factor in understanding human behavior, cognition, and social interactions (Izard, 1977). In the realm of emotional research, numerous theories and frameworks have emerged, each offering a unique perspective on the emotional landscape. For instance, the basic emotion theory posits that emotions are categorical, discrete, and
universal, with a set of basic emotions such as happiness, sadness, anger, fear, surprise, and disgust serving as the foundation for more complex emotional experiences (Izard, 2007). On the other hand, the dimensional approach views emotions as varying along continuous dimensions, such as valence and arousal, allowing for a more nuanced representation of emotional states (Mehu and Scherer, 2015). The study of emotion in psychology has also examined the role of cognitive processes in emotional experiences. Cognitive appraisal theories, for example, emphasize the importance of individuals’ interpretations and evaluations of events in determining their emotional responses (Frijda, 1993). These theories suggest that emotions arise from the cognitive evaluation of the personal significance and implications of events, highlighting the interplay between cognition and emotion. By incorporating these psychological perspectives, we can create more comprehensive and nuanced representations of emotional knowledge, enabling AI systems to better understand, reason about, and respond to the emotional dynamics of human experience.
Data Collection from LLMs The evolution of pre-trained generative models has paved the way for the widespread adoption of expansive Large Language Model (LLMs) (Brown et al., 2020; Chowdhery et al., 2023; Touvron et al., 2023; Achiam et al., 2023) across numerous downstream tasks. Increasingly, researchers are leveraging these large-scale models for the purpose of dataset construction. For instance, Ruida et al. (2023) have demonstrated the effectiveness of employing larger models for the annotations of datasets aimed at smaller models, achieving superior outcomes compared to those annotated manually. Furthermore, West et al. (2022) have developed the ATOMIC10x corpus, which boasts heightened accuracy and variety in comparison to the humancurated ATOMIC2020 (Hwang et al., 2021) dataset by extrapolating causal commonsense knowledge from GPT-3. Similarly, Gao et al. (2023) improved the consistency and engagement of narrative systems by prompting InstructGPT-3 (Ouyang et al., 2022) to extract personality commonsense knowledge.

heading: 3 ECoK Framework
text: Emotion is a multi-dimensional and multi-level psychological phenomenon, involving cognition,
physiology, behavior, and environment. Firstly, the cognitive aspect of emotion includes our evaluation of things, attitude, and thinking style. Different cognitive evaluations lead to different emotional reactions (Izard, 1993). For example, positive evaluation of the same event may lead to pleasant emotions, while negative evaluation may lead to sadness or anger. Secondly, the physiological aspect of emotion involves the body’s physiological response to emotions, such as accelerated heartbeat, elevated blood pressure, and sweating (Levenson, 2003). These physiological responses are closely related to emotional states, but they are also influenced by individual differences and health status. Additionally, the behavioral aspect of emotion manifests in facial expressions, body movements, and verbal expressions (Dael et al., 2012). Different emotions have different behavioral manifestations, and these behavioral expressions can also affect the emotional reactions of others. Finally, emotions are also influenced by environmental factors such as social and cultural background, interpersonal relationships, and specific situations (Thoits, 1989). Different cultures and social environments have different ways of expressing and understanding emotions, which requires us to have corresponding knowledge and abilities in different communication environments.
In this field, how to define emotion has always been a thorny problem. The number of scientific definitions proposed has reached the point of almost incalculable. Nowadays, what is generally accepted is the "component theories of emotion". In the framework of component process model, emotion is defined as a set of interrelated events (Scherer, 2001), the components of an emotional event consist of the respective states of multiple subsystems and coordinated changes over time. Generally, we do not have emotions for people or events that we do not care about. Therefore, the key point of the definition of emotional components is that the events and consequences that cause them must be relevant to the main concerns of the organism. Therefore, five components of emotion are derived: Cognitive component (appraisal), Neurophysiological component (bodily symptoms), Motivational component (action tendencies), Motor expression component (facial and vocal expression), and Subjective feeling component (emotional experience) (Scherer, 2005).
Based on the theoretical research on emotions mentioned above, we have ultimately identified
seven relations for ECoK: group, causes, bodily symptoms, feelings, expression, action tendencies, and advice. We will provide a detailed description of these relations below:
Group The classification of crowds that are most likely associated with the generation of certain emotions is outlined. For example, individuals likely to experience irritability due to staying up late include the demographic of middle-aged and young adults, students, as well as working professionals.
Causes Describe the potential factors that led to the occurrence of the emotional descriptions event. For example, the reason for feeling irritable due to staying up late may stem from factors such as project deadlines and procrastination.
Bodily symptoms Describe the physiological aspect of the emotional experience. For example, when experiencing irritability, physiological responses such as elevated blood pressure, increased heart rate, and digestive issues may manifest.
Feelings Describe the subjective experience of emotional state once it has occurred. For example, following a night of staying up late, individuals often experience feelings of remorse.
Expression Describe the responses and behavioral intentions accompanied by emotional states, such as facial expressions and vocal tone. For example, when individuals experience anxiety due to staying up late, manifestations such as verbal tension, irritability, and a furrowed brow commonly arise.
Action tendencies Describe the motivations that arise from emotions. For example, when individuals experience anxiety, actions such as engaging in destructive behavior, shouting loudly may be observed.
Advice The recommendations on how to appropriately respond to emotions are outlined. Note that the advice are generated based on the group of the target audience. For example, in the case of students experiencing anxiety, formulation of a well-structured study plan and seeking of support from peers or elders would be beneficial in alleviating anxiety.

heading: 4 ECoK Construction
text: In order to construct our emotional knowledge graph, we devise an end-to-end framework where
events describing emotions are regarded as head entities in the graph, frame relations constitute edge type relations, with emotional attributes serving as tails in the triples (head, relation, tail). In Figure 2, we present an overview of our framework to construct ECoK. The head entity of ECoK is derived from two components: a) extraction from existing commonsense KGs, b) acquisition from open source social media dataset1. Following this, we collected tail entities that related to emotion attributes from pretrained LMs. Subsequently, a final knowledge graph was formed through manual verification.

heading: 4.1 Event Selection
text: Emotions need to be associated with specific events in some way, whether external or internal (Scherer, 2005). The head entities in ECoK consist of events containing emotional descriptions. In contrast to merely using emotions as head entities, this approach establishes connections with real-life events. In everyday situations, individuals often do not explicitly articulate their emotions. For instead, they express their emotions through complete sentences or actions. This results in emotions being frequently concealed within the descriptions of a sentence. Based on this observation, we employ events containing emotional descriptions as head entities to provide emotional context. We choose to utilize events from ATOMIC2020 (Hwang et al., 2021) that offer emotional descriptions as a part of our data source. This collection includes a significant number of coarse-grained events. Additionally, to ensure a more diverse representation of people’s daily expressions, we acquire an open-source dataset1 from Twitter via Kaggle as another data source. First, we extract emotion-oriented descriptions from ATOMIC2020 and social media datasets. Then, to reduce redundancy, we perform clustering on the merged entities. Finally, we manually review the selected head entities and extract 4.9K descriptions as the head entities of ECoK.
Social media datasets We obtain this dataset from Kaggle and process with prompting Llama2-70B (Touvron et al., 2023). This dataset1 is collected from Twitter (now referred to as X) for sentiment analysis, containing 1,600,000 user expressions of emotions on the platform. In this work we do not use all of them, but some of them by random
1https://www.kaggle.com/datasets/kazanova/ sentiment140
sampling. We also need to take further steps due to the different dataset construction purposes. Initially, we employ a large language models (LLMs) to determine whether a given sentence included an emotional event, and in this step, we filter out harmful data, resulting in candidate raw sentences such as "@Zyber17 i wish i didnt miss the guy anymore". Subsequently, we instruct the LLMs to extract emotional events from these sentences, and the data underwent desensitization to transform it into a format consistent with the head entities in ATOMIC2020, "PersonX wishes not to miss someone".
Commonsense knowledge graph ATOMIC2020 (Hwang et al., 2021) is a commonsense knowledge graph containing 1.33M daily inferential knowledge tuples. We extract emotion-involving event entities through the xReact and isBefore relations in ATOMIC2020. The xReact relation captures how people react emotionally to events, while the isBefore relation helps in understanding the temporal sequencing of events. By exploring these relations, we can identify and extract event entities that involve emotions. Entities with the same meaning may exist in multiple ways, such as "PersonX achieves PersonX’s aims" and "PersonX achieves PersonX’s goals". Clustering can effectively reduce this redundancy. We use BERT (Devlin et al., 2019) to calculate the vector representation of entities and adopt a hierarchical clustering algorithm to cluster the entities. Each cluster has multiple entities, and we need to extract the content expressed by these descriptions. We calculate the centroid of each cluster and select the entity closest to the centroid as the representative of the cluster.

heading: 4.2 Attribute Acquisition
text: Recent studies indicate that large language models trained on extensive corpora can serve as sources for data collection. Previously, Gao et al., 2023 have successfully utilized InstructGPT-3 (Ouyang et al., 2022) to construct a persona commonsense knowledge graph. Inspired by these endeavors, we design suitable prompt2 to guide Llama-2-70B (Touvron et al., 2023) in the construction of the ECoK. Next, we outline the detailed process of constructing ECoK through the design of prompts and human examine. Detailed templates and examples for prompts are provided in Appendix C.
Acquiring components of emotion Based on the preceding description, we devise six relationships to deconstruct emotions: group, causes, bodily symptoms, feelings, and expression. For these six relationships, we employ a consistent approach when prompting Llama-2-70B. As shown in Figure 3, each prompt is comprised three components: Instruction, Examples, and Input Text. The Instruction provides a detailed description of the relationships with additional requirements to constrain the output format and content. In the Examples section, we present instances in JSON format. Given that the specific meanings of the relationships are already outlined in the Instruction, the examples primarily serve to control the model’s output format for ease of information extraction. Lastly, we provide processed events containing emotional descriptions as input.
2We follow the prompt format given by Hugging Face at https://huggingface.co/blog/llama2 to use Llama 2
Acquiring advice For advice, the purpose of designing this relations is to enable individuals to receive appropriate guidance for managing emotions and events through ECoK when they become aware of their emotions. In addition, as LLMs tend to provide generic and uninteresting responses, obtaining advice directly through prompting emotional events can result in the loss of effectiveness and diversity in recommendations. Therefore, we aim to enhance the relevance of advice by introducing group as an additional input, ensuring that the recommendations take into account the specific audience associated with the group as shown in Figure 4. Our comparative analysis indicates that the results obtained by introducing group as a supplementary input surpass those obtained solely by using emotional events as input in terms of effectiveness and diversity.

heading: 4.3 Human Examine
text: To reduce redundancies and errors, and further improve data quality, we adopt a combination of prompting and manual inspection. We prompt the LLMs to avoid generating controversial content and ensure that the answers do not contain any harmful, unethical, racist, sexist, or illegal content. We generate answers in batches and filter out duplicate answers after generation. For each batch, we sample 1k tuples and manually inspect them according to the following criteria: a) relevance of the answer, avoiding unreasonable answers, b) safety of the answer, avoiding harmful information, c) authenticity of the answer, avoiding false information. We fine-tune the prompt based on the inspection results until the manual sampling inspection is qualified.

heading: 4.4 ECoK Statistics
text: Table 1 presents the statistical information of ECoK. Our knowledge graph comprises over 140K emotional inference tuples, encompassing a wide range of emotions from the commonly recognized ones like happiness, anger, sadness, and joy to more complex psychological states such as anxiety and depression. This diversity mirrors the richness and complexity of human emotions. Furthermore, the Advice relationship within ECoK offers over 20K distinct personalized suggestions for coping with different emotions. These recommendations range from seeking support and adjusting cognitions to relaxation techniques. In conclusion, ECoK showcases the complexity and diversity of emotions through its multifaceted relationships. It serves as a comprehensive and systematic knowledge graph of emotional commonsense, providing valuable insights into the intricate world of human emotions.

heading: 5 Experiments

heading: 5.1 Emotion Knowledge Generation
text: While various approaches are employed in the construction of ECoK to collect events describing emotions through multiple ways, the acquisition of emotional knowledge is still limited to querying situations similar to those represented in the knowledge graph. However, this approach has its inherent limitations, as ECoK cannot encompass the infinite diversity of the real world. Following the methodology proposed by Hwang et al., 2021, we opt to partition the ECoK dataset and employ a training set(∼100K inferences) to train the COMET (Bosselut et al., 2019) knowledge generator based on BART (Lewis et al., 2020) to handle unknown situations and expand the application scope of ECoK. After training, the model is capable of generating corresponding tail attributes based on the given head containing emotional descriptions and the relation in the ECoK.
To evaluate our model, we conduct a knowledge generation comparison on the ECoK test set with two versions of the currently prominent opensource LLMs Llama 2 (Touvron et al., 2023), versions 13B and 70B, as well as two widely acknowledged powerful LLMs, GPT-3.5 turbo, and GPT-4 turbo. We use five facts randomly sampled on the training set to prompt both two versions of Llama
2 and GPT. We conduct automatic and human evaluations on the generated results, and the results are presented in Table 2 and 3.
In cases where the model scale is significantly smaller than the baseline, COMET trained on ECoK, demonstrates superior performance across various Natural Language Generation (NLG) metrics, as assessed through automated evaluations. In addition, we sought to ascertain the acceptability of content generated by our trained COMET. Therefore, we sample the output of each model for manual evaluation. In the results of the manual assessment, COMET-ECoK exhibits the highest Accept rate and the lowest Reject rate. This indicates that the results generated by COMET-ECoK we trained are more likely to be accepted by humans. All the aforementioned findings collectively suggest that ECoK can serve as a reliable emotional knowledge base, enabling light-scale LMs to rival LLMs in the generation of emotional knowledge.

heading: 5.2 Enhancing Emotional Reasoning
text: ECoK is rich in emotional knowledge, so we will test whether it can provide better results in downstream tasks. We apply ECoK to enhance the emotional reasoning model MHGT based on the BHG method (Yang et al., 2023) and evaluate its effectiveness in two tasks: Emotion Recognition in Conversations (ERC) and Casual Emotion Entailment (CEE). By incorporating ECoK into MHGT, we aim to improve the model’s ability to understand and reason about emotions in natural language texts, particularly in dialogue settings where emotions play a crucial role.
The main steps of emotional knowledge enhancement are as follows: First, knowledge extraction, target sentences are queried to obtain emotional knowledge. This process involves searching and retrieving relevant emotional knowledge from the ECoK-trained COMET model (Bosselut et al., 2019).The retrieved knowledge can include
information about emotional states, causes, effects, and relationships with other concepts or entities. For example, by querying the sentence "I’ll get married.", we obtain emotional knowledge "to be loved" and "feel happy". Second, knowledge filtering, selecting the most relevant part of the extracted knowledge. This step employs semanticaware knowledge filtering method, which analyzes the semantic relationships between the extracted knowledge and the target utterance to determine which pieces of information are most pertinent to the task. By filtering out irrelevant or redundant knowledge, we can ensure that the model focuses on the most useful and informative aspects of the emotional knowledge. Finally, knowledge interaction involves integrating the filtered knowledge into the model to enhance its reasoning capabilities. This step aims to effectively combine the extracted and filtered emotional knowledge with the model’s internal representations. The enhanced model can leverage external knowledge sources during inference to improve their understanding and reasoning about emotional content and make more informed decisions.
For the ERC task, we use ECoK to enhance four datasets: IEMOCAP (Busso et al., 2008), MELD (Poria et al., 2019), DailyDialog (Li et al., 2017), and EmoryNLP (Zahiri and Choi, 2018). We select the Weighted F1 score as the evaluation metric for IEMOCAP, MELD, and EmoryNLP. These datasets are widely used in emotion recognition research, and the Weighted F1 score is a commonly accepted metric for evaluating performance in multi-class classification tasks. Since DailyDialog contains a large number of "neutral" emotions, we choose the Micro F1 score to evaluate the performance of non-neutral emotions and calculate the Macro F1 score to evaluate overall performance.For the CEE task, we enhance the RECCON (Poria et al., 2021) dataset and use the F1 score on posi-
tive and negative utterances, as well as the Macro F1 score, as evaluation metrics.
The enhanced model is denoted as MHGT+ECoK. To compare the capabilities of emotional knowledge graphs with other commonsense knowledge graphs, we selected MHGT+ConceptNet (Speer et al., 2017), MHGT+ATOMIC (Sap et al., 2019) and MHGT+ATOMIC2020 (Hwang et al., 2021) as baseline models. The results of our MHGT+ECoK and all baseline models on the two tasks is shown in Table 4. ECoK achieves the best comprehensive performance on five datasets while having a lower construction cost than other commonsense knowledge graphs with artificial annotations. These results demonstrate the effectiveness of incorporating emotional knowledge from ECoK into the MHGT model and highlight the importance of emotional commonsense knowledge in enhancing the performance of emotional reasoning models.

heading: 6 Conclusion
text: In this work, we have successfully constructed ECoK, a comprehensive and accurate emotional commonsense knowledge graph. ECoK comprises over 140K high-quality emotional inference knowledge tuples, representing the complexity and diversity of emotions through seven distinct relationships: group, causes, bodily symptoms, feelings, expression, action tendencies, and advice. Furthermore, we leverage ECoK to build a knowledge generation model called COMET-ECoK, designed to facilitate more extensive knowledge generation. Through rigorous evaluation, we have shown that incorporating emotional commonsense knowledge from ECoK enhances the performance of Knowledge Generation, Emotion Recognition in Conversations and Casual Emotion Entailment tasks. These results validate the effectiveness of our ap-
proach and its potential to revolutionize humanmachine interaction. In the future, we will continuously expand the emotional knowledge graph to explore more nuanced emotional representations and further enhance the capabilities of artificial intelligence systems in emotion-related tasks.

heading: Limitations
text: While our work has demonstrated the potential of constructing a comprehensive emotional commonsense knowledge graph, it is important to acknowledge several limitations.
Firstly, our approach relies heavily on the quality and diversity of the text, dialogue, and sentiment analysis data used for mining emotional knowledge. Any biases or inconsistencies in these data sources can potentially affect the accuracy and completeness of ECoK.
Secondly, although we have integrated cuttingedge theories from multiple disciplines, the current version of ECoK may not capture the full complexity and nuances of human emotions. Future iterations could benefit from incorporating more fine-grained emotional representations and models.
Finally, the evaluation of ECoK’s performance in downstream tasks is limited to specific benchmarks and may not generalize to all possible scenarios.
Despite these limitations, we believe that ECoK represents a valuable step towards enhancing emotional understanding and reasoning in artificial intelligence systems.

heading: Ethics Statement
text: In the construction of our ECoK, we have adhered strictly to ethical principles and best practices. We recognize the sensitivity of emotional data and the importance of protecting privacy. Therefore, we have taken careful measures to filter and exclude any data containing potentially private or identifying information from our analysis. Furthermore, we have ensured that all data sources used in this work are publicly available and have been obtained through legitimate means, respecting copyright and intellectual property rights. We are committed to transparency in our methods and have documented our data collection, preprocessing, and filtering procedures comprehensively. Additionally, we acknowledge the potential impact of our work on society and strive to use our findings ethically, promoting positive outcomes for individuals and communities. We emphasize that the use of ECoK
should adhere to ethical guidelines and be subject to appropriate oversight and accountability mechanisms.

heading: Acknowledgements
text: We sincerely thank all the anonymous reviewers for providing valuable feedback. This work is supported by the youth program of National Science Fund of Tianjin, China (Grant No. 22JCQNJC01340).

heading: A ECoK Construction Details

heading: A.1 ECoK Head Selection
text: The head entities of ECoK originate from two parts: a) the commonsense knowledge graph, b) social media datasets. Table 6 displays some examples of the prompts used to select data from social media datasets and format transformation described in Sec. 4.1 using LLMs. Specifically, we first let the LLMs judge if the sentence contains emotional description, which allows us to filter out irrelevant data from social media datasets, such as data we consider useless like "watching ‘House’". These types of data are filtered out at this step. Then, we use the LLMs to convert the selected sentences into the data format of ATOMIC2020 (Hwang et al., 2021); that is, we replace the agent of action in the sentences with "PersonX", and use "Person(Y to Z)" to represent other individuals mentioned in the sentence, for example, transforming the original data "need a huge" into "PersonX needs a huge". During this process, as the data comes from social media, it includes the "@" symbol to mention individuals. We address this by adding words that start with the "@" character to the LLMs bad words list and by including explanations in the prompts to ensure that the processed sentences do not contain the "@" symbol.
During this extraction process, we encounter entities with semantically similar meanings but expressed in different ways. For instance, "PersonX achieves PersonX’s aims" and "PersonX achieves PersonX’s goals" convey the same concept but use different terminologies. To address this redundancy, we employ clustering techniques. Before clustering, we need to represent the entities in a form that captures their semantic meaning. We utilize BERT (Devlin et al., 2019) to calculate the vector representations of the extracted entities. BERT’s ability to understand contextualized word meanings makes it an ideal choice for this task.With the vector representations obtained from BERT, we proceed to cluster the entities. We adopt a hierarchical clustering algorithm for this purpose. Hierarchical clustering algorithms group data points into a hierarchy of clusters, where each cluster at a given level is derived from the clusters at the lower level. Once the clustering is complete, we have multiple clusters, each containing multiple entities.
To summarize the content expressed by these entities within a cluster, we calculate the centroid of each cluster. The centroid is a representative point that minimizes the distance to all other points in the cluster. We then select the entity closest to this centroid as the representative of the cluster. This representative entity captures the essential meaning expressed by the entire cluster, serving as a concise summary.

heading: A.2 Advice Process Detail
text: For advice generation, we introduce the concept of a group as a reference, allowing LLMs to generate suggestions for specific group. During this process, there may be some suggestions that are semantically redundant across different groups, which is due to certain suggestions being applicable to more than one group. To address this, for a given head, we first gather all the group, then collect all the advice for these group. Finally, we compile these pieces of advice and use the prompt from Table 11, prompting the LLMs to deduplicate them to avoid the occurrence of advisories with similar meanings.

heading: B Parameters for LLMs
text: During the data construction process, we read the license terms3 and follow the acceptable use policy4 to obtain a commercial license for Llama 2 (Touvron et al., 2023), and implemented Llama270B-Chat using Hugging Face. The details of the parameters we used for Llama2-70B-Chat in constructing ECoK and in our experiments are given in Table 5. For the GPT series of models, we read the terms of service5 and follow the usage policies6, and we use the default hyperparameters provided by the OpenAI platform.

heading: C Prompts for Attribute Acquisition
text: In Tables 10 and tables 12 to 18, we present the original input we used to prompt Llama2-70B-Chat, with an input format consistent with the templates used for model training as given in the Llama 2 (Touvron et al., 2023) paper. Table 10 displays the prompts used for selecting data from social media datasets and for format transformation. Table tables 12 to 18 shows the prompts used to obtain relations.
3https://ai.meta.com/llama/license/. 4https://ai.meta.com/llama/use-policy/. 5https://openai.com/api/policies/
service-terms/. 6https://beta.openai.com/docs/usage-policies.

heading: D Emotion Knowledge Generation Details

heading: D.1 Evaluatin Details
text: We divided the facts of ECoK into three sets, with size 101086, 20018 and 20006 for training, validation and testing, respectively. Please note that there are no overlapping head entities among these three sets of data. The automatic evaluation employed the following several NLG metrics: BLEU (Papineni et al., 2002), ROUGE-L (Lin, 2004) , METEOR (Banerjee and Lavie, 2005), SPICE (Anderson et al., 2016), and SkipThought (Kiros et al., 2015). For human evaluation, we employed three experts from various regions in the pertinent domain as reviewers, and they were compensated with wages exceeding the local minimum wage standard. Each generated tail entity was assessed by the three experts according to the guidelines displayed in Figure 5. The Accept rate, Reject rate, and No Judgement rate were calculated individually by each expert, and the average value of these was taken as the final result.

heading: D.2 Model Training
text: We trained COMET-ECoK using the code from the COMET repository7, along with the default hyperparameter configuration. We utilize a single Nvidia RTX A6000 GPU with a batch size set to 32, conducting training for 50 epochs, which costs about 6 hour to get the highest ROUGE-L score on the validation set. In addition, in line with the practice from PEACOK, we also trained a DeBERTa (He et al., 2020) discriminator to re-rank the results generated by COMET-ECoK, Llama2-13B, Llama2-70B, GPT-3.5-turbo, and GPT-4-turbo. For the training process, we created negative examples
7https://github.com/allenai/comet-atomic-2020.
by replacing the tail entity of one head entity with a randomly sampled tail entity from the same relations of another head entity. We trained DeBERTa using the hyperparameters recommended by the ComFact (Gao et al., 2022) benchmark and based on a binary classification loss, enabling it to distinguish between real and negative data. The training was performed using two Nvidia RTX A6000 GPUs, and the highest F1 score was obtained at the 8th epoch, with about 18 hours. We had all models generate 5 tail entities for a head entity and a relation, and we used the DeBERTa discriminator to rank these 5 generated tail entities, selecting the first one for evaluation.

heading: D.3 Case Study
text: Table 7 presents 5 examples generated by COMETECoK on the test dataset data. Upon observation, it can be found that COMET, when trained with ECoK as the knowledge base, is capable of generating effective emotional reasoning data.

heading: E Enhancing Emotional Reasoning Details
text: In this experiment, we aim to enhance the emotional reasoning model MHGT, which is based on the Bipartite Heterogeneous Graph (BHG), by
leveraging ECoK rich in emotional knowledge (Yang et al., 2023).

heading: E.1 Datasets
text: We conducted evaluations on two tasks: Emotion Recognition in Conversations (ERC) and Casual Emotion Entailment (CEE). A total of five benchmark datasets were employed for comparison against baseline models.
IEMOCAP (Busso et al., 2008) This is a multimodal dataset. The content is derived from the lines in the scripts of the two actors, and the emotional tags included are excited, neutral, frustrated, sad, happy, and angry.
MELD (Poria et al., 2019) This dataset comes from the dialogue content of the characters in the American drama Friends. The pre-defined emotions are neutral, sad, anger, disgust, fear, happy, surprise.
DailyDialog (Li et al., 2017) Manually compiled data sets about daily communication. The predefined emotion labels are neutral, happy, surprise, sad, anger, disgust, fear.
EmoryNLP (Zahiri and Choi, 2018) This dataset also comes from Friends, and the difference from MELD is the annotation of utterance’s
emotional label category. The emotional tags contained in this dataset are: joyful, neutral, powerful, mad, sad, scared, and peaceful.
RECCON (Poria et al., 2021) A dataset sampled from ERC dataset DailyDialog with both utterancelevel emotion labels and binary emotion cause labels.

heading: E.2 Emotional Knowledge Enhancement
text: To further improve the quality and adaptability of ECoK, we employ the COMET framework for training enhancement. During the enhancement process, we treat the emotional knowledge entries in ECoK as inputs and utilize the COMET model for reasoning and generating emotional knowledge. Through this approach, we can expand the emotional knowledge in ECoK, adding new emotional relationships, attributes, and scenarios, thus mak-
ing the dataset more extensive and diverse.
Then we integrated the ECoK dataset enhanced by COMET training into the MHGT model. Specifically, we added the enhanced emotional knowledge as extra nodes or edges to the BHG, enriching the model’s input information. This approach allowed the model to consider both textual information and emotional knowledge during the reasoning process, improving the accuracy of emotional inference.
BHG provided two additional knowledge aggregation node types designed to automatically perform knowledge filtering and interaction, ensuring effective screening and integration of relevant information during knowledge infusion. The MHGT model retained the ability to preserve consistent feature spaces and unequal dimensions for heterogeneous node types during inference, preventing
unnecessary loss of information. These advantages facilitated the model’s easy extension to multi-type and multi-grained knowledge sources, making the integration of ECoK relatively straightforward and efficient.
Through knowledge aggregation nodes, the emotional knowledge from ECoK was effectively combined with other information in the model. During training, we closely monitored the model’s ability to retain feature spaces and unequal dimensions, ensuring that the enhancement of emotional reasoning capabilities did not sacrifice the information retention advantages of the original model. Additionally, we employed appropriate optimization strategies to improve the model’s training efficiency and performance.
The experimental results demonstrated that the ECoK dataset enhanced by COMET training significantly improved the performance of the MHGT model on both ERC and CEE tasks. This indicated that the enhanced dataset not only enriched the model’s input information but also effectively boosted its emotional reasoning capabilities.

heading: E.3 Additional Experimental Data
text: On the basis of the initial experiments, we conducted additional experiments to compare with larger models and other new model performances. The results of the experiments are shown in the table 8 and 9.
We applied ECoK over Llama-2-7b (Touvron et al., 2023) and KBCIN (Zhao et al., 2023). From the results, it can be seen that after applying ECoK as an external knowledge source, Llama-27B achieves a considerable performance improve-
ment on all four datasets of the ERC task. At the same time, in comparison with ATOMIC2020, KBCIN+ECoK also achieved better performance on the CEE task. Combined with the existing experiments in Section 5.2 of this thesis and these two supplementary experiments, it is well demonstrated that ECoK can be applied as an external knowledge base to enhance the performance of downstream tasks.

heading: Future Work
text: Future iterations could benefit from incorporating more fine-grained emotional representations and models. Finally, the evaluation of ECoK’s performance in downstream tasks is limited to specific benchmarks and may not generalize to all possible scenarios. Despite these limitations, we believe that ECoK represents a valuable step towards enhancing emotional understanding and reasoning in artificial intelligence systems