Message Passing on Semantic-Anchor-Graphs for Fine-grained Emotion Representation Learning and Classification (2024)

Abstract: Emotion classification has wide applications in education, robotics, virtual reality, etc. However, identifying subtle differences between fine-grained emotion categories remains challenging. Current methods typically aggregate numerous token embeddings of a sentence into a single vector, which, while being an efficient compressor, may not fully capture complex semantic and temporal distributions. To solve this problem, we propose SEmantic ANchor Graph Neural Networks (SEAN-GNN) for fine-grained emotion classification. It learns a group of representative, multi-faceted semantic anchors in the token embedding space: using these anchors as a global reference, any sentence can be projected onto them to form a “semantic-anchor graph”, with node attributes and edge weights quantifying the semantic and temporal information respectively. The graph structure is well aligned across sentences and, importantly, allows for generating comprehensive emotion representations regarding K different anchors. Message passing on this graph can further integrate and refine the learned features. Empirically, SEAN-GNN can generate meaningful semantic anchors and discriminative graph patterns for different emotion, with promising classification results on 6 popular benchmark datasets against state-of-the-arts.

## introduction emotion classification is an important task with applications in many fields like education, virtual reality, and robotics. however, fine-grained emotion classification (fec) remains a challenging problem that is far from being well-solved. unlike coarse-grained emotion classification (cec), which may classify emotions into only a few basic categories @xcite , fec requires more detailed distinctions. for example, the two largest fine-grained emotion classification datasets contain 32 @xcite and 27 @xcite ) categories, respectively. the difficulty of fine-grained emotion classification mainly arises from learning faithful emotion representations, in particular in terms of capturing both the semantic and temporal distribution of emotion-related vocabulary in the sentence: semantically, human emotions are expressed by highly diverse word vocabulary (emotion-related adjectives, nouns, verbs and adverbs describing the intensity of the situation). capturing the distribution of this rich vocabulary, and the subtle difference between similar emotions (e.g., afraid and terrified) is still an important challenge for fine-grained emotion classification. temporally, the meaning of a sentence is related to the meanings of its parts and the way they are combined @xcite ; in particular, subtle differences of emotion categories are in many cases presented by the relationship among the words (waugh, 1977) † . therefore capturing the temporal (or positional) word relations is crucial for emotion classification. unfortunately, since different sentences have different word compositions, directly quantifying and comparing word relationships across sentences is practically challenging. numerous methods have been proposed for finegrained emotion classification, see a review in section 2. despite the technical diversity, these methods typically use pre-trained language models (plms) or those enhanced with contrastive learning @xcite or lstm @xcite to obtain the token embeddings, and then aggregate them into a single vector for sentence-level representation. well-known aggregating schemes include average pooling @xcite , sum-pooling @xcite , and [cls] token @xcite @xcite . although plms provide informative token embeddings for a sentence, aggregating them into a single vector may lead to significant information compression. from data distribution point of view, average pooling of the tokens is like approximating their distribution with the first-order statistics, and higher-order information (e.g. relationship among the tokens) may not be fully quantified † . however, the semantic distribution and the temporal relationship among the tokens are important information for accurate emotion classification. in this paper, we explore new ways for computing sentence-level representations to capture complex semantic distributions and temporal relationship of the tokens. unlike current methods that compress all the tokens of a sentence into one vector, we use a set of "semantic anchors" to extract sentence information in a more delicate manner. our method is called semantic anchor graph neural network (sean-gnn), as in figure 1 . the sean-network has three building blocks. (1) learning semantic anchors, a set of vectors shared globally in the token embedding space covering emotion-related vocabulary. (2) projecting † the [cls] embedding can be deemed as a weighted average of the token embeddings, so with similar observation. a sentence onto the anchors by content projector (which projects token embeddings to anchors by their semantic similarity) and temporal projector (which projects the positional token relationship onto pairs of anchors). then a sentence of arbitrary length can be expressed as a constant-sized anchorgraph, where node attributes and edge weights in turn quantify semantic and temporal information. the semantic anchors provide a flexible and finegrained basis for learning emotion representations. the anchors are learned end-to-end to cover emotion related vocabulary adaptively. besides, anchors are shared globally, and so complex token relations from sentences of different word compositions, which are otherwise hard to compare, can now be easily quantified using the anchors as a common ground. this is beneficial since subtle positional relations of words can be important emotion features. most importantly, rather than compressing all the tokens into a single vector, the semantic anchor graph allows one sentence to be encoded by multiple vectors each associated with one semantic anchor, being a highly enriched representation for fine-grained emotion classification. main contributions of the paper are listed below: ## related work numerous methods have been proposed for finegrained emotion classification. typically, pretrained language models (plm) are used to get token embeddings; these embedding are then further refined/updated before aggregated into a single vector for emotion classification. various strategies were designed to refine either of these 3 steps. for plms, @xcite presented emotion masked language modeling, which only masked off those emotion-related tokens in the pretraining stage; yin and shang (2022) incorporated a whitening method and nearest neighbor retrieval to plms to improve retrieval efficiency so as to better differentiate semantically similar sentences. for token embedding refinement, suresh and ong (2021) modified the supervised contrastive loss @xcite and propose a label-aware contrastive loss to improve token embedding; chen et al. (2023) proposed hypemo, which learned label embedding in hyperbolic space and integrated it with roberta fine-tuned in euclidean space. for token aggregation, a common method involves pooling all token embeddings into a single vector through averaging, summation, or taking the maximum/minimum. for instance, @xcite employed bi-lstm to process token embeddings derived from a pre-trained language model, and concatenated the hidden representations from bi-lstm's final layer to form the context representation. @xcite suggested that a pooling function such as attention, mean or max can be used to aggregate token embeddings to a vector; the [cls] token embedding is also commonly used as the sentence-level feature @xcite . however, @xcite showed that averaging the token embeddings is better than only utilizing [cls] token. both are sub-optimal as demonstrated by @xcite . despite the technical diversity, most of these methods mix up the token embeddings of a sentence into a single vector. such aggregation is a convenient way for sentence-level representation, but it may not be sufficiently effective in capturing the semantic and temporal distribution, which can be crucial to accurate emotion classification. in the nlp literature, concept of anchors have been explored in various tasks, but with motivations and implementations very different from our approach. for example, @xcite selected words that are uniquely associated with a topic as anchors to accelerate topic modeling analysis. @xcite adopted the average contextual representations of each word as the anchors to enhance contextualized representations. @xcite used the class labels/words as anchors and used anchor re-weighting to improve in-context learning performance. in these works, anchors are linked to predefined words, while our anchors are learned adaptively through data. gnn models have also been applied in nlp tasks, like encoding word relations @xcite , recognizing named entities @xcite , modeling syntactic structures @xcite , etc. a main difference is that our gnn is built on semantic anchors rather than raw tokens. using anchors as gnn nodes allows generating emotion representations that are not only rich and multi-faceted, but also well-aligned across different sentences without token padding or cutting (an undesired perturbation of their embeddings). gnn models themselves could also benefit from the use of anchors. these methods use anchors to improve the computational efficiency of gnns or graph-based clustering/semi-supervised learning @xcite @xcite , to better encode relative positional relation between the nodes @xcite , or to improve graph embedding in case of noisy/inaccurate edges @xcite . these anchor based gnn models are different from ours in both their motivations and methodology. they mainly consider graphs like similarity graph (clustering), protein networks and communication networks (link prediction and community detection), without temporal (sequential) relation between the nodes; in comparison, a challenge in our context is how to properly project the temporal relationship between pairs of tokens onto their corresponding anchors. furthermore, our anchors are learned end-to-end, instead of being directly selected from existing nodes or computed through an off-line procedure. ## methodology the sean-gnn model has three main modules, as discussed in the following three subsections. ## conclusion we proposed sean-gnn to extract the content distribution and toke relation for fine-grained emotion classification. it allows generating comprehensive and discriminative emotion representations, and has produced promising results across different benchmark datasets and base plm embedding.