Metaphor Detection with Effective Context Denoising (2023)

Abstract: We propose a novel RoBERTa-based model, RoPPT, which introduces a target-oriented parse tree structure in metaphor detection. Compared to existing models, RoPPT focuses on semantically relevant information and achieves the state-of-the-art on several main metaphor datasets. We also compare our approach against several popular denoising and pruning methods, demonstrating the effectiveness of our approach in context denoising. Our code and dataset can be found at https://github.com/MajiBear000/RoPPT .

## introduction metaphor is a pervasive linguistic device, which attracts attention from both the fields of psycholinguistics and computational linguistics due to the key role it plays in the cognitive and communicative functions of language @xcite @xcite . linguistically, metaphor is defined as a figurative expression that uses one or several words to represent another concept given the context, rather than taking the literal meaning of the expression @xcite . for instance, in the sentence "this project is such a headache!", the contextual meaning of headache is "a thing or person that causes worry or trouble", different from its literal meaning, "a continuous pain in the head". 1 metaphor detection is challenging, as it requires understanding the nuanced relationships between abstract concepts embodied by the metaphoric expression and its surrounding context. recent studies on this direction show its potential in benefiting a wide range of nlp applications, including sentiment analysis @xcite , metaphor generation @xcite and mental healthcare @xcite . when modelling relevant context for metaphor detection, various strategies have been proposed. these range from using highly restricted forms of linguistic context such as subject-verb and verbdirect object word pairs @xcite , to a wider context accounting for a fixed window surrounding the target word @xcite , and modelling the full sentential context @xcite . while it has been argued that modelling a wider context is beneficial @xcite , it has also been noted that a wider context is likely to introduce noise into the representations, and hence hinder model's performance in metaphor detection @xcite . some recent efforts @xcite attempt to improve context modelling by explicitly leveraging the syntactic structure (e.g., dependency parse tree) of a sentence in order to capture important context words, where the parse trees are typically encoded with graph convolutional neural networks. melbert @xcite employs a simple chunking method which separates sub-sentences by commas. the sub-sentence that contains a target word is then marked with a special token type, signalling its contextual importance to the target. however, these strategies are either difficult to apply to batch optimisation due to their tree-dependent encoding process, or have limited effectiveness for context denosing. for instance, the simple chunking mechanism misses the syntactic structure, and thus can neither determine the degree of importance of context words, nor connect information across different subsentences. in this paper, we propose a novel metaphor detection model roppt: roberta with pruning on target-oriented parse tree. roppt introduces a flat, target-oriented tree structure by reshaping and pruning the ordinary parse trees to extract semantically relevant neighbours of a target word. the resulting tree representation allows the model to focus on syntactically relevant information of a target word, and ignore irrelevant parts despite their position. it thus retains more relevant context for metaphor detection. extensive experiments conducted on three public benchmark datasets (i.e., vua, moh-x, trofi) show that roppt can significantly improve metaphor detection on all datasets against several popular denoising and pruning methods. our model also yields better or comparable performance to the state-of-the-art models @xcite in micro f1 measure. to further validate our approach, we conducted an additional investigation to assess the effect of sentence length on the performance of our model. experimental results demonstrate a positive correlation between the increase in the performance of roppt and the length of the input sentence. in summary, our paper makes three contributions: (1) we propose a flat, target word-oriented tree structure by reshaping and pruning the ordinary parse trees to retain the most relevant context for a target word; (2) we propose roppt, a roberta-based model which can effectively encode the target-oriented parse tree for metaphor detection, achieving state-of-the-art results on three bench mark datasets; (3) we compare and evaluate a range of context denoising methods for metaphor detection, demonstrating the effectiveness of our proposed tree structure in context denoising. ## method the overall architecture of roppt is shown in figure 1 , which can be divided into two parts: a targetoriented parse tree pruning module and a roberta @xcite contextual encoder. ## experimental results overall results. we also compared our method against several common denoising strategies. the results show that our tree-based denoising method is more effective than other popular denoising approaches such as rochunk and rowindow, which are sequence-based methods. we also apply our target-oriented tree to roberta_seq, denoted as the roberta_tree model. the improvement of roberta_tree over roberta_seq on two vua datasets (i.e. 0.3% and 0.7%) further demonstrates the utility of our tree-based denoising method. following the setup of @xcite , we also conducted a zero-shot transfer learning experiment shown in ## conclusion in this paper, we proposed, roppt, an effective approach to extract contextual information for target words for metaphor detection based on a targetoriented parse tree structure. extensive experiments show that our model can yield better performance compared to the state-of-the-art. in addition, our method is particularly effective in denoising long sentences, despite its simplicity.