R ep G raph: Visualising and Analysing Meaning Representation Graphs (2021)

Abstract: We present RepGraph, an open source visualisation and analysis tool for meaning representation graphs. Graph-based meaning representations provide rich semantic annotations, but visualising them clearly is more challenging than for fully lexicalized representations. Our application provides a seamless, unifying interface with which to visualise, manipulate and analyse semantically parsed graph data represented in a JSON-based serialisation format. RepGraph visualises graphs in multiple formats, with an emphasis on showing the relation between nodes and their corresponding token spans, whilst keeping the representation compact. Additionally, the web-based tool provides NLP researchers with a clear, visually intuitive way of interacting with these graphs, and includes a number of graph analysis features. The tool currently supports the DMRS, EDS, PTG, UCCA, and AMR semantic frameworks. A live demo is available at https://repgraph.vercel.app/ .

## introduction broad-coverage semantic graphs provide richer representations of sentence meaning than surfacelevel syntax or lexicalised semantic dependencies @xcite . the breadth of meaning representation approaches now includes a large number of semantic graph frameworks -each with their own respective strengths and weaknesses at encoding the meaning of natural language @xcite . recently, a growing body of work has focused on parsing to or generating from graph-based meaning representations @xcite @xcite . the outputs of many other syntactic and semantic analysis tasks can also be represented as graphs, where labelled nodes correspond to token spans and edges to relations between these spans @xcite . visualisations of constituency trees, syntactic dependency trees and semantic dependency graphs are well established for teaching, analysing and presenting the outputs of those representations. however there is no similar established standard for visualising broad-coverage semantic graphs, due to diverging approaches to representing semantics in different frameworks, as well as the challenges involved in visualising both the graph and the correspondence to the sentence it represents clearly. to stem the "balkanisation" caused by framework-specific approaches, conll 2019 and 2020 hosted shared tasks on cross-framework meaning representation parsing (mrp; @xcite . these tasks provided a uniform abstract graph representation with a json-based serialization format and standardized datasets. however, current visualisation tools are either framework-specific or fail to represent graphs clearly and consistently across frameworks ( §5). repgraph is an open source, web-based visualisation and analysis tool for meaning representation graphs, with support for multiple frameworks. the tool provides three novel visualisation formats, each designed to better elicit specific inherent qualities of the graphs ( §3). in contrast to previous approaches, two of our visualisations (hierarchical and tree-like) represent the graph and sentence tokens in an integrated manner, clearly showing the relationship between nodes and the tokens or token spans they correspond to. the third (flat) is akin to existing dependency graph visualisations. the tool provides a unified, intuitive and featurerich platform for interacting with meaning representation graphs. analysis functionality includes: displaying subgraphs, searching graphs by node label or subgraph, comparing graphs visually, testing graph properties such as planarity, and providing dataset-level statistics ( §4). repgraph is targeted towards everyone working with meaning representation graphs, including: researchers developing parsers or generators; computational linguists performing semantic analysis; nlp practitioners using graphs in downstream applications; and students learning about these representations. parsing is not currently integrated, but parser output can easily be processed. repgraph is also not intended to be an annotation tool; such functionality is orthogonal to what we provide. five semantic graph frameworks are currently supported: dependency minimal recursion semantics (dmrs; @xcite , elementary dependency structures (eds; @xcite , prague tectogrammatical graphs (ptg; @xcite , universal conceptual cognitive annotation (ucca; @xcite and abstract meaning representation (amr; @xcite . some framework-specific normalisations are performed to improve compatibility and enable a unified approach to visualisation. while our development focused on english datasets, most of the frameworks also support other languages, and the tool can easily be extended to support additional frameworks. foot_0 ## system description a semantic graph is a triple (t, n, e), where n is a set of nodes, e ⊆ n × n is a set of directed edges, and t ⊂ n is a set of top nodes @xcite . nodes may optionally have zero or more properties with associated values. the relationship be-tween the graph nodes and the input string is referred to as anchoring or alignment. we assume that the input is tokenized; a graph node may be anchored to a token, a token span, or a set of token spans. 2 the alignment is not annotated in all frameworks; we assume that it can be obtained, using an aligner, for (most) graph nodes. the alignment between the nodes and input tokens forms the basis of the design of our hierarchical and tree-like visualisation formats. we also distinguish between surface nodes, which represent the lexical items (tokens) they are aligned to directly, and abstract nodes, which represent the semantic contribution of grammatical constructions. this distinction is annotated explicitly in dmrs and eds (which are based on the same underlying annotations), but we extend it to the other frameworks based on the alignments and framework properties. ## graph visualisation our application provides three distinct visualisations of meaning representation graphs in all the supported frameworks, providing users with multiple perspectives of the same semantic information. as can be seen in figures 1 2 3 , the visualisations use colour and annotations to represent the various elements of the graphs -for example, surface and abstract nodes are differentiated and shown in different colours. an expandable legend is provided to explain the different colours (see fig. 2 ). the user can modify the default colours and spacing of the visualisations from the settings in the panel on the left of the main page. the placement of the edges and edge labels can also be manipulated easily by dragging them with the mouse. the examples in the figures, as well as the demo data provided in application, come from the sample annotations of wall street journal (wsj) corpus sentences provided for mrp 2020. 7 we next discuss each of the visualisations, and in particular how node placement is calculated for each of them ( §3.1 -3.3). then we discuss how edge placement is determined across all the visualisations to minimise collisions ( §3.4), and normalisations to make the anchoring more consistent across frameworks ( §3.5). ## related work the plethora of tools and visualisation options currently available are fragmented and often built without semantic graphs in mind. in the context of the mrp shared tasks, mtool 13 was developed to provide various functionality including format conversion, graph analysis, and evaluation. however, mtool is a command-line only tool and does not provide a simple and intuitive way to interact with large datasets of semantic graphs. in terms of graph visualisation, mtool supports the output of graphs in dot language that is compiled with graphviz. 14 unfortunately, since graphviz is a general-purpose visualization tool, the visualisations produced are often complex and inadequate at capturing framework-specific assumptions. as an example, the ucca visualisation in fig. 5b lacks lexical information. a number of other framework-specific visualisation tools exist, including for dmrs 15 and amr @xcite , but are limited in terms of their functionality and framework support. the delphin-viz dmrs visualisation (fig. 5a ) is similar to our flat visualisation, but lacks the structure conveyed by our other visualisations. ## conclusion the proliferation of graph-based and span-based meaning representations has created the need for a general platform for analysing these representations. repgraph provides such a unified platform for the visualisation and analysis of semantic graphs in multiple frameworks. the tool allows users to explore and analyse these representations in an interactive and intuitive manner that is not possible with existing tools. our work aims to make meaning representations accessible to a broader audience than researchers invested in a particular framework, while providing new insights into these representations through novel visualisations. for future work, we plan to include support for additional semantic frameworks, including spanbased representations such as semantic role labelling. we also intend to integrate parsers for all supported frameworks. this will provide significant utility by allowing users to upload text files or enter sentences directly, and use repgraph straight away rather than having to run a parser separately.