PALMYRA 2.0: A Configurable Multilingual Platform Independent Tool for Morphology and Syntax Annotation (2020)

Abstract: We present PALMYRA 2.0, a graphical dependency-tree visualization and editing software. PALMYRA 2.0 is designed to be highly configurable to any dependency parsing representation, and to enable the annotation of a multitude of linguistic features. It uses an intuitive interface that relies on drag-and-drop utilities as well as pop-up menus and keyboard shortcuts that can be easily specified.

## introduction the development of treebanks is central to research on automatic syntactic and morphological analysis. treebanks can vary based on the syntactic representations they are in, and the languages they encode. there is a large number of syntactic representations that vary in terms of linguistic theories underlying them, and in terms of their file formats. the universal dependency (ud) representation @xcite aims to be applicable in all languages. ud is currently one of the most popular representations being available in 90 languages, but many other treebanks are designed for a limited number of languages. the penn treebank (ptb) @xcite is the most used representation for constituency treebanks, and it is available in a number of different languages including english @xcite , arabic @xcite , and chinese @xcite . the prague dependency treebank (pdt) @xcite is another representation used to annotate treebanks in czech @xcite as well as arabic @xcite . the annotation of syntactic trees with morphological features, especially for morphologically rich languages, is often done in a cascading manner: text is annotated first for morphology then for syntax. this method of annotation can have errors cascading from one level of annotation to the other. having the annotation done in tandem, or at least having the morphological features displayed and editable when annotating syntax, will allow annotators to look at the annotations in a different light, bringing to their attention different readings that may have been missed otherwise. the richness of a language's morphology is not necessarily related to the richness of its treebank representation. arabic, for example, is a very morphologically rich language, and it has different treebanks, with different representations. the penn arabic treebank (patb) @xcite uses a constituency representation that is rich in morphological features. the columbia arabic treebank (catib) @xcite , on the other hand, is a dependency representation with poor morphology. the designers of catib claimed that the simplified morphology was intended among other choices to speed annotation up. this motivated us to create a tool that is configurable and can work for multiple languages and morphosyntactic representations. the existence of these varying treebanks and different approaches to annotation naturally raise the need for a tool that can be used with the different representation schemes and languages. we sum up our desiderata for such a tool as follows: this work is licensed under a creative commons attribution 4.0 international license. license details: http:// creativecommons.org/licenses/by/4.0/ . in our previous work describing the creation of palmyra @xcite (henceforth, palmyra 1.0), we addressed platform independence by building a web-based dependency syntax annotation tool that did not require any installation. palmyra 1.0 uses an intuitive drag-and-drop interface, and has the options of annotating using both buttons and shortcut keys. palmyra 1.0's most important feature is the ease of fixing tokenization errors caused by morphological analyzers or syntactic parsers, by allowing users to easily split and merge nodes in the displayed trees. in the new iteration of palmyra (henceforth, palmyra 2.0), foot_0 we extend the tool's ability to be used with varying syntactic representations and linguistics features through the introduction of an adaptable configuration file. palmyra 2.0 can be configured to support annotations that go beyond pos tags and syntactic relations, and extend to other linguistic features such as morphological features. when building palmyra 2.0 we only focused on syntactic dependency representations, but we imagine many of its design elements can be expanded to constituency trees. we discuss some related work in section 2. we then present our design specifications (section 3), user interface (section 4), and the configuration setup (section 5). ## related work many annotation tools have been created in the context of all the work done on syntactic parsing and morphological analysis. most tools are designed for one type of annotation only, and have limited configurations. in this section, we review previous work that was done on developing tools for linguistic annotation, specifically syntactic annotation as well as joint syntax and morphology annotation. while the tools we present here all have great features, some features that we consider key for ease of annotation are also lacking. ## design specifications in this section, we discuss the key decisions that we followed in designing palmyra 2.0. we are aware that there are various specification that are desirable by different annotators, such as user management, automatic parsing, and inter-annotator agreement reports. however, there is a tradeoff between having those features and having a lightweight and fast tool that can run offline, which we prioritized. design and implementation palmyra is a platform independent open-source software foot_1 that is written entirely in javascript, html, and css. this makes it usable with modern browsers without the need of any installation or setup. 3 input file the most commonly used format for dependency parsing currently is the conll-u format, a revised version of conll-x @xcite , that was made popular for its use in ud @xcite . because we want palmyra 2.0 to be usable by people annotating in different dependency representations, we decided to adopt this well established format for our files. furthermore, palmyra 2.0 can be used to display any languages that can be encoded in unicode. entries in conll-u files have ten columns that correspond to the following fields: id, form, lemma, pos, xpos, features, parent, relation, enhanced dependency, and miscellaneous. the pos field is what is used to populate the tree with pos tags. the xpos field, if specified in the configuration files, can be edited alongside the morphological features. figure 1 shows two trees from different representations, in the same conll-u file format. we decided to go with an example in arabic, a morphologically rich language, for two reasons. first, we want to illustrate the usability of palmyra 2.0 with different representations, in this case catib (figure 1 (a) ) and ud (figure 1 (b) ). and secondly, we want to demonstrate a use case that requires word tokenization and rich morphological features as part of creating syntactic trees: in figure 1 , see tokens 1, 8 and 11 which are proclitics, and the many features in column 6. in the current version of palmyra 2.0, the conll-u enhanced dependency field and the miscellaneous field are not used in the visualization of the tree, and are not editable through the interface. however, if they appear in the input file, they will be saved by the tool and written in the output file. multi-token words and hidden nodes are not supported in the current version. comments in the conll-u format are stored and written to the output file. however, we currently do not allow editing them. we plan to do these extensions in the future. output files palmyra 2.0's main output is in the same conll-u format as the input files. it also give the option of downloading the trees as png images. configuration file palmyra 2.0 uses json format for its configuration file. the configuration file is discussed in details in section 5. gloss id token lemma pos xpos features parent relation depd misc and 1 + prt _ @xmath0;was;were|@xmath1;people|@xmath2;land|@xmath3;talk|@xmath4;by mod _ _ tongue 9 nom _ @xmath5. 14 . . pnx _ _ mod _ _ (a) catib tree in conll-u format gloss id token lemma pos xpos features parent relation depd misc and 1 + cconj conj _ cc _ _ was 2 aux verb @xmath6. 14 . . punct punct _ punct _ _ (b) ud tree in conll-u format ## palmyra 2.0's user interface in this section, we present the details of the interface. this section has some information that was first presented in palmyra 1.0 @xcite , however, some repetition is required to illustrate the work we built on top of it. dependency tree display figure 2 presents a dependency tree being edited. the sentence's tokens are projected at the bottom, and the tree nodes are aligned directly above them. the pos tag for each word is shown directly below it, and the relation is displayed half-way on the edge connecting the node to its parents. the display direction can be changed to be left-to-right or right-to-left using the direction button. it can also be automatically configured, as we will show in section 5. the screenshot in figure 2 is taken midway through dragging and dropping a node. the 'drop zone' of each node is indicated by a red halo around it. when a node is attached to a new parent, the order of the words in the sentence, and in the tree, remains the same. palmyra also has tree zoom-in and zoom-out options. tree navigation and editing users who prefer to use the keyboard to edit the trees can do that with ease. once a node is selected, users can use arrows to move from one node to the other. the selected node is always highlighted to provide visual feedback to the user. editing pos tags and relation labels can be done by either using configurable keyboard shortcuts, or using sub-menus that provide button lists of all available annotation options. the tagging sub-menus are invoked by clicking on the tags button. the sub-menu button lists are populated dynamically from the configuration file, and can be grouped in whichever way the user feels relevant to their annotations task. figure 4 (a) shows an example of these sub-menus for ud annotation. switching between annotating pos tags and relation labels is done using the tab key. additions, deletions, and mergers in palmyra 2.0, the addition and deletion of nodes is done using the edit mode, which can be initiated by clicking on the edit button. in this mode, icons are displayed on the tree to indicate addition, deletion, and left and right mergers. figure 3 displays the tree in sentence token editing mode. the clickable red "x" sign and green "+" sign are used to delete and insert nodes, respectively. the default pos tag and relation of the new node are configurable. merging neighboring words is done through the clickable left and right arrows. the node under which the arrow is clicked is deleted, and its "name", i.e. the word itself, is added to the "name" of the respective neighbor node. the children of the merged node are assigned to the node it was merged with. the user can also use the button +tree to add a new tree to the end of the the file. the tree starts as a root node only, and the user can add new nodes using the word insertion functionality described above. the -tree button deletes the tree that is currently in focus. word and feature editing clicking on one of the words projected at the bottom of the tree allows the users to edit that word and its features. this includes the token, which users can edit to fix typographical errors, or add spaces to split the token into multiple tokens. additionally, palmyra 2.0 gives the option of editing lemmas, and the features that appear in the sixth column of the conll-u file. figure 4 shows the menu that pops up when a word is clicked. users can use the configuration file to allow or disallow some features from being annotated with specific poss. figure 4 (b) shows the menu with a verb selected, where the features state, case, and rationality are disabled, and figure 4 (c) shows the same menu when a noun is selected where person, voice, aspect, and mood are disabled. text listing palmyra 2.0 can show a listing of the sentences that are in the file that is being displayed. figure 5 presents the box that appears when clicking on the listing button, showing all the sentences that are in the uploaded file. because palmyra 2.0 is a light tool, our approach is to exploit the existing search utility in web browsers to our advantage. the text in this box is searchable with the search utility, and the users can easily navigate to the sentence they desire by clicking on it in this box. if a specific key is specified in the configuration file, the text displayed in the listing box will come from the text in the comments with that key. if the key is not in the configuration, or if a tree does not have a comment with that key value, the text displayed in the listing box will be the concatenation of the sentence's tokens. text listing the text displayed in the listing box by default comes from treating the tokens in the tree as independent words. palmyra 2.0 can be configured to populate the listing box from a specific comment in the conll-u file. ## conclusion and future work in this paper, we described palmyra 2.0, a platform independent graphical software for dependency tree visualization and editing. the features of palmyra 2.0 allow it to be easily configured to work with any syntactic dependency representation. they also allow for editing linguistic features through simple drop-down menus and text fields. being built entirely using standard web technologies, palmyra 2.0 runs on all major web browsers. palmyra 2.0's configuration file allows it to be used for annotating features that do not commonly appear in syntactic dependency treebanks. the flexibility of not limiting the linguistic annotations to one kind of features makes the repurposing of this tool to annotate, for example, sentiment datasets, or ner gazetteers, a functionality that can be easily integrated into the tool. we plan to continue maintaining and enhancing palmyra 2.0's capabilities, such as supporting multi-token words, hidden node representations, and enhanced dependencies annotation. we also plan on adding support for additional linguistic annotations, and sentence splitting. inter-annotator agreement, user management, and automatic parsing are also features we are looking to add to palmyra to increase its usability in large annotation projects, particularly since we will be using palmyra 2.0 heavily as part of a large-scale treebanking annotation project in the near future.