Direct parsing to sentiment graphs (2022)

Abstract: This paper demonstrates how a graph-based semantic parser can be applied to the task of structured sentiment analysis, directly predicting sentiment graphs from text. We advance the state of the art on 4 out of 5 standard benchmark sets. We release the source code, models and predictions.

## introduction the task of structured sentiment analysis (ssa) is aimed at locating all opinion tuples within a sentence, where a single opinion contains a) a polar expression, b) an optional holder, c) an optional sentiment target, and d) a positive, negative or neutral polarity, see figure 1 . while there have been sentiment corpora annotated with this information for decades @xcite , there have so far been few attempts at modeling the full representation, rather focusing on various subcomponents, such as the polar expressions and targets without explicitly expressing their relations @xcite or the polarity @xcite . dependency parsing approaches have recently shown promising results for ssa @xcite . here we present a novel sentiment parser which, unlike previous attempts, predicts sentiment graphs directly from text without reliance on heuristic lossy conversions to intermediate dependency representations. the model takes inspiration from successful work in meaning representation parsing, and in particular the permutation-invariant graph-based parser of @xcite called perin. experimenting with several different graph encodings, we evaluate our approach on five datasets from four different languages, and find that it compares favorably to dependency-based models across 1 github.com/jerbarnes/direct_parsing_ to_sent_graph all datasets; most significantly on the more structurally complex ones -norec and mpqa. ## related work proposing a dependency parsing approach to the full task of ssa, @xcite show that it leads to strong improvements over state-of-the-art baselines. @xcite propose a sparse fuzzy attention mechanism to deal with the sparseness of dependency arcs in the models from @xcite and show further improvements. however, in order to apply the parsing algorithm of @xcite , both of these approaches have to rely on a lossy conversion to bi-lexical dependencies with ad-hoc internal head choices for the nodes of the abstract sentiment graph, see section 3 for a discussion of these issues. more generally, decoding structured graph information from text has sparked a lot of interest in recent years, especially for parsing meaning representation graphs @xcite . there has been tremendous progress in developing complex transition-based and graph-based parsers @xcite @xcite . in this paper, we adopt perin @xcite , a state-of-theart graph-based parser capable of modeling a superset of graph features needed for our task. ## issues with dependency encoding as mentioned above, previous dependency parsing approaches to ssa have relied on a lossy bi-lexical conversion. this is caused by an inherent ambiguity in the dependency encoding of two nested text spans with the same head (defined as either the first or the last token in @xcite ). to be concrete, we can use the running example "nowadays i actually enjoy the bad acting," which has two opinions with nested targets; "the bad acting,", which is associated with a positive polarity indicated by the polar expression "enjoy", and "acting,", with a negative polarity expressed by "bad". as shown in the dependency representation in figure 2 , both expression-target edges correctly lead to the word "acting" but it is impossible to disambiguate the prefix of both targets in the bilexical encoding, i.e., to determine that the tokens "the" and "bad" are part of the target only for the positive opinion. for that, we need a more abstract graph encoding, such as the ones suggested in this paper. ## perin model perin is a general permutation-invariant text-tograph parser. the output of the parser can be a directed graph with labeled nodes connected by labeled edges where each node is anchored to a span of text (possibly empty or discontinuous). we propose three graph representations for ssa that meet these constrains and thus can be easily modeled by this parser. we use only a subset of the full perin's functionality for our ssa version -it does not need to use the "relative label rules" and model node properties or edge attributes. please consult the original work for more technical details about perin @xcite . ## experiments 6.1 evaluation following @xcite , we evaluate our models using sentiment graph f 1 (sf 1 ). this metric considers that each sentiment graph is a tuple of (holder, target, expression, polarity). a true positive is defined as an exact match at graph-level, weighting the overlap in predicted and gold spans for each element, averaged across all three spans. for precision it weights the number of correctly predicted tokens divided by the total number of predicted tokens (for recall, it divides instead by the number of gold tokens). sf 1 allows for empty holders and targets. in order to further analyze the models, we also include token-level f 1 for extraction of holders, targets, and polar expressions, as well as nonpolar sentiment graph f 1 (nsf 1 ). ## analysis there are a number of architectural differences between the dependency parsing approaches compared above. in this section, we aim to isolate the effect of predicting intermediate dependency graphs vs. directly predicting sentiment graphs by creating more comparable dependency foot_3 and perin models. we adapt the dependency model from @xcite by removing the token, lemma, and pos embeddings and replacing mbert @xcite with xlm-r @xcite . the 'xlm-r dependency' model thus has character lstm embeddings and token-level xlm-r features. since these are not updated during training, for the opinion-tuple 'frozen perin' model, we fix the xlm-r weights to make it comparable. as shown in ## conclusion previous work cast the task of structured sentiment analysis (ssa) as dependency parsing, converting the sentiment graphs into lossy dependency graphs. in contrast, we here present a novel sentiment parser which predicts sentiment graphs directly from text without reliance on lossy dependency representations. we adapted a state-of-the-art meaning representation parser and proposed three candidate graph encodings of the sentiment structures. our experimental results suggest that our approach has clear performance benefits, advancing the state of the art on four out of five standard ssa benchmarks. specifically, the most direct opinion-tuple encoding provides the highest performance gains. more detailed analysis of the results shows that the benefits stem from better extraction of global structures, rather than local span prediction. finally, we believe that various structured prediction problems in nlp can similarly be approached in a uniform manner as parsing into directed graphs.