Etytree: A Graphical and Interactive Etymology Dictionary based on Wiktionary

We present etytree (from etymology + family tree): a new on-line multilingual tool to extract and visualize etymological relationships between words from the English Wiktionary. A first version of etytree is available at http://tools.wmflabs.org/etytree/. With etytree users can search a word and interactively explore etymologically related words (ancestors, descendants, cognates) in many languages using a graphical interface. The data is synchronised with the English Wiktionary dump at every new release, and can be queried via SPARQL from a Virtuoso endpoint. Etytree is the first graphical etymology dictionary, which could be used to search specific etymological definitions as well as to discover new relations among words. Moreover, it can be effectively adopted by Wiktionary editors to identify inconsistencies or missing information in the data. Etytree is a valuable tool for all those users interested in specific etymological definitions as well as for discovering new relations among words. Moreover, it can be effectively adopted by Wiktionary editors to identify inconsistencies or missing information in the data.


INTRODUCTION
Etytree is a new tool to extract and visualize etymological relationships between lexemes (or words, for simplicity) using data coming from the English Wiktionary. The interest of this tool lies in its potential for Wiktionary users, editors and for researchers or more generally people interested in languages and etymologies.
It is built on top of DBnary [1] which extracts word Definitions, Parts of Speech, Synonyms, and other lexical information from Wiktionary pages. With etytree, a RDF (Resource Description Framework) lexical database of etymological relationships collecting all the extracted relationships and lexical data attached to lexemes has also been released. The database consists of triples or data entities composed of subject-predicate-object where a possible statement can be (for example) a triple with a lexeme as subject, a lexeme as object, and "derivesFrom" or "et-ymologicallyEquivalentTo" as predicate. The RDF database has been exposed via a SPARQL endpoint and can be queried at http://etytree-virtuoso.wmflabs.org/sparql.
Etytree provides a graphical interface to the database which consists in an intuitive and multilingual graphical etymology dictionary. The graphical etymology dictionary represents the extracted etymological relationships as well as the associated lexical information using graphs and tooltips, respectively. It uses d3.js 2 , a JavaScript library for manipulating documents based on data, and infers the tree structure from the RDF database on the fly through specific queries from the Virtuoso 3 SPARQL endpoint.
With etytree, users can discover new words when they search for a specific etymological definition, e.g., they can discover words that derive from the same ancestral word, both in their own language and in other languages. This happens in an intuitive way without having to read fairly long and complex sentences that describe etymological relationships between words and without the need to navigate across multiple Wiktionary pages. Moreover, with the visualization of the etymological tree, editors can easily spot inconsistencies between etymological relationships described across multiple Wiktionary pages. Finally, researchers can use the database of etymological relationships to study etymologies on a large scale. Potentially, they could extend the database of etymological relationships to include semantics or pronunciations, to study how they evolved through time across etymological trees and across languages. Figure 1: A screenshot of the interactive visualization produced by etytree for the English word "gorgeous". From the graph it is possible to see that the English words "gorgeous", "disgorge", "gorget", and archaic words "gorge" and "engorge" are etymologically related.
A project similar to etytree is Etymological Wordnet 4 [2,3] which is, unfortunately, neither publicly available nor maintained anymore.

THE MODEL
The etytree extraction tool uses regular expressions and parsing of both Wiktionary templates and links. It assumes a standard structure for the different sections containing etymologies, i.e., the Etymology section, the Derived terms section, the Descendants section, the namespace with Reconstructed Terms (still in the works), the etymtree template 5 . Sense evolution was probably that of "swelling of the throat or bosom due to pride, bridling up" to "assume an air of importance, flaunting".

Etymology sections
After inspection of many different Etymology sections we inferred a set of recurrent patterns that we constructed using regular expressions. The most common pattern is 6 : Using this pattern plus a set of rules we extract etymological relationships into a RDF database. In what follows we present some examples of rules that we use.
If we find a match to the pattern above with DOT or OR in the last group, we ignore all the text following the match. We ignore anything after a dot (DOT) because generally Etymology sections start with a chain of etymological relationships followed by a dot and then contain some descriptive text that is not easily parsable. We ignore anything following OR (alternative etymologies) as alternative etymologies are not presented in a standard format in the English Wiktionary. We also ignore anything that follows a match to 4 www1.icsi.berkeley.edu/~demelo/etymwn/ 5 See https://en.wiktionary.org/wiki/Template: etymtree 6 where FROM can be any of the following: and many more, LANGUAGE corresponds to the etyl template, LEMMA corresponds to different templates in practice (e.g. m, l, etc, generally embedding lexemes) or wiki links, COMMA corresponds to ",", DOT corresponds to "." or ";", and OR corresponds to "or" (neither followed nor preceded by a character). Whenever we find a match to a compound pattern, we ignore everything after the match, as there is no standard for the etymology of compound words.
While the selected patterns generally correctly reflect real patterns (as Etymology sections use very well defined standards 9 ), some etymologies are written in non-standard ways, which implies that the corresponding extraction is incorrect (or partially incorrect). We are trying to interact with the community of editors of English Wiktionary to better understand the standards they use and to encourage the use of more standards that would allow the community to have a lower amount of data loss and a lower rate of incorrectly extracted etymological relationships.
One example of non-standard Etymology sections uses links instead of templates to represent words that are etymologically related (e.g. [[door]] instead of {{m|en|door}}). This is a major problem because in Etymology sections words with links often correspond to descriptive words or glossary, for example the Etymology section of "Davidsen" is: and clearly "patronymic" here is not etymologically related to "Davidson". In this particular case, a standard that encourages the use of links to the glossary for words like "patronymic", i.e. [[Appendix:Glossary#patronymic|patronymic]], (and for "ablative", "zero-grade", etc.) in Etymology sections would help automatic data extraction.
Other lexemes that usually have non-standard Etymology sections are phrases. For example "until the cows come home" has the following Etymology section:  Figure 2: A screenshot of the English entry "gorgeous" in the English Wiktionary stay out for months before scarcity of food causes them to find their way home in the autumn for feeding.
we propose to add template (for example {{detailed etymol-ogy}}) before long descriptive etymologies that don't have a standard chain of etymological relationships which would signal to the extraction algorithm to ignore that section.
In the current version, etytree parses links like [[cattle]] in the Etymology section above as an ancestor of "until the cows come home" and therefore infers an incorrect etymological relationship. We decided to keep those links for now, as we hope that editors will fix those entries and set a clear standard in the structure of Etymology sections.

Derived terms sections
Derived terms sections are pretty standard with some exceptions. Below we copy the Derived terms section of English "gorgeous", which is representative of how Derived terms sections are usually structured:

Appendix with reconstructed words
Reconstructed terms are words, roots, or phrases that are not attested but have been reconstructed by linguists and are conventionally identified with an initial asterisk. They are defined in the namespace Reconstruction (see for example entry "h2k w eh2" defined at https://en.wiktionary.org/ wiki/Reconstruction:Proto-Indo-European/h%E2%82%82% C3%A9k%CA%B7eh%E2%82%82) and are structured similarly to regular Wiktionary entries.

etymtree template
The etymtree template is a template used in Wiktionary to describe etymological trees and reflects the structure of the Descendants sections.

THE DATABASE
The database is installed on the Wikimedia Labs, the Wikimedia Foundation's cloud computing environment. It is managed by Virtuoso version 07.20.3217 on Linux.
With appropriate queries to the SPARQL endpoint we can ask interesting questions.
The most connected entries that are not affixes are English lemmas "man" (353 connections), "back" (303), "head" (290), followed by "work", "house", "wood", "land", "line". These highly connected nodes slow down queries launched by the visualization tool. We are currently working on the design of more efficient queries given the available data.

CONCLUSIONS
We have presented etytree, a tool to visualize etymological relationships between words in the form of a connected graph. The tool is currently under development but a first working release is available at http://tools.wmflabs.org/ etytree/etymology/resources/html/index.html.
This tool can be a valuable resource for people that are interested in the history of words or words in general as they can discover new words in other languages that are etymologically related to the searched words, as well as for etymology enthusiasts, as they can explore etymological relationships in a completely new way. Also we believe that the database can be a valuable resource for linguists as they can study etymologies on a much larger scale.
Because of its nature, we believe this work will attract new users to Wiktionary and will improve as well as increase its content. We also believe it will encourage Wiktionary editors to use more standard rules to format etymologies. We hope that this project will help to turn the whole Wiktionary into a machine readable resource with the minimum possible loss of information.
Because of the complexity of the original data contained in Wiktionary (especially the complexity of Etymology sections) the extracted database contains some incorrect entries. We hope that users will contribute to Wiktionary to spot those inconsistencies. We would like to work together with them to improve even more Wiktionary Etymology sections and to improve etytree simultaneously.
The project has the potential to grow in both content and quality as it is open source and relies on data coming from a collaborative and multilingual resource as Wiktionary.

FUTURE DEVELOPMENTS
As the structure of etymological trees (or graphs) is language independent, this project could be extended to use etymological relationships described in other language versions of Wiktionary, although Etymology sections seem rather incomplete/informal in other languages (Russian might be the next target language).
In addition, as the textual part of the tree (definition of words, language tags, etc.) can be exported from different language versions of Wiktionary, this tool can easily become available in different languages, thus considerably extending its scope.
Last, this tool can be integrated into Wikidata when the Wikidata-for-Wiktionary 10 proposal turns into production.

ACKNOWLEDGMENTS
This work is supported by the Wikimedia Foundation through an IEG grant 11 to Ester Pantaleo. We would like to thank the Wiktionary and the Wikidata communities for their help and for their precious work.
10 https://www.wikidata.org/wiki/Wikidata: Wiktionary/Development/Proposals/2015-05 11 https://meta.wikimedia.org/wiki/Grants:IEG/A_ graphical_and_interactive_etymology_dictionary_ based_on_Wiktionary 7. AUTHOR CONTRIBUTIONS Ester Pantaleo conceived the idea and developed the tool, Tommaso Di Noia contributed to the research project with monthly meetings, Gilles Sérasset helped integration with DBnary and provided some computational resources, Vito Walter Anelli helped formulating appropriate queries to the Virtuoso DBMS. Everyone participated in the writing of this paper.