P enman: An Open-Source Library and Tool for AMR Graphs (2020)

Abstract: Abstract Meaning Representation (AMR) (Banarescu et al., 2013) is a framework for semantic dependencies that encodes its rooted and directed acyclic graphs in a format called PENMAN notation. The format is simple enough that users of AMR data often write small scripts or libraries for parsing it into an internal graph representation, but there is enough complexity that these users could benefit from a more sophisticated and well-tested solution. The open-source Python library Penman provides a robust parser, functions for graph inspection and manipulation, and functions for formatting graphs into PENMAN notation. Many functions are also available in a command-line tool, thus extending its utility to non-Python setups.

## introduction abstract meaning representation (amr; @xcite is a framework for encoding english language foot_0 meaning as structural-semantic graphs using a fork of propbank @xcite for its semantic frames with additional amr-specific roles. the graphs are connected, directed, with node and edge labels, and may have multiple roots but always have exactly one distinguished top node. amr corpora, such as the recent amr annotation release 3.0 (ldc2020t02), 2 encode the graphs in a format called penman notation @xcite . penman notation is a text stream and is thus linear, but it first uses bracketing to capture a spanning tree over the graph, then inverted edge labels and references to node ids to capture re-entrancies. proper interpretation of the "pure" graph therefore requires the deinversion of inverted edges and the resolution of node ids. some tools that work with amr use the interpreted pure graph @xcite @xcite , but many others work at the tree level for surface alignment @xcite , for transformations from syntax trees @xcite , or to make use of tree-based algorithms @xcite . others, particularly sequential neural systems @xcite , use the linear form directly. furthermore, while amrs ostensibly describe semantic graphs abstracted away from any particular sentence's surface form, human annotators tend to "leak information" @xcite about the source sentence. this means that an annotator might be expected to produce the amr in fig. 1 for sentence (1), but then swap the relative order of the adjunct relations :location and :time for (2). 3 van noord and bos (2017) embraced these biases and intentionally reordered relations, even frame arguments such as :arg0 and :arg1, by their surface alignments, leading to a boost in their evaluation scores. ## decoding and encoding graphs penman uses three-stage processes to decode pen-man notation to a graph and to encode a graph to penman, as illustrated in fig. 2 . parsing is the process of getting a tree from a penman string, and interpretation is getting a graph from a tree, while decoding is the whole string-to-graph process. going the other way, configuration is the process of getting a tree from a graph and formatting is getting a string from a tree, while encoding is the whole graph-to-string process. splitting the decoding and encoding processes into two steps each allows one to work with amr data at any stage. the variant of penman notation used by penman is described in §2.1. the tree, graph, and epigraph data structures are described in §2.2. getting a tree from a string (and vice-versa) depends only on understanding penman notation, but getting a graph from a tree (and vice-versa) requires an understanding of the semantic model. semantic models are described in §2.4. ## use cases here i describe a handful of use cases that motivate the use of penman. ## applicability beyond amr this paper has described penman as a notation for encoding amr graphs, but it is also applicable to other dependency graphs that share the same constraints (e.g., connected, directed). penman notation can encode dependency minimal recursion semantics (dmrs; @xcite , such as for learning graph-to-graph machine translation rules (goodman, 2018) and neural generation @xcite , and it can encode elementary dependency structures (eds; @xcite , as shown in fig. 11 using pydelphin (goodman, 2019b) for conversion. it is also useful for extensions of amr, such as uniform meaning representation (umr; @xcite .