RhyAnT: A web-based tool for interactive rhyme annotation

In times where home office is an obligation rather than an option, I have finally found time to create a first draft version of a web-based tool for interactive rhyme annotation. The tool is written in plain JavaScript, without any additional libraries, and supports the inline rhyme annotation format which we proposed in an earlier study. It allows for an efficient and save annotation of poems for their rhyme structure and will hopefully help us to assemble larger samples of rhyme patterns across genres, languages, times, and cultures.

Rhyme annotation is not the first thing a person will think of when asking a linguist what they do for a living. Nevertheless, poetry is a very interesting topic for linguistics, not only because it is realized in language, but also because it is so deeply influenced by communication, culture, and cognition. Additionally, poetry, or more specifically, rhyming, is of great importance for the reconstruction of Ancient Chinese pronunciation, since the Chinese characters alone would not provide us with enough hints to learn about their ancient pronunciations (Baxter 1992).

Starting from initial studies where I used rhyme networks to study the reconstruction of Old Chinese (List 2016, List et al. 2017), I have learned how important it is to be able to annotate what rhymes in a poem in an efficient way. My initial attempts, carried out also in close collaboration with Nathan W. Hill, consisted in the digitization of rhyme judgments on Ancient Chinese poetry collections (notably the Book of Odes), which I did in part by myself, in part with the help of student assistants. Back then, we realized that we would need an annotation format that would be both simple enough to be conveniently produced by various people while at the same time allowing for a very detailed annotation of the rhyme judgments that can be found in the literature.

Later in 2019, we found time to systematize these early attempts, proposing a first format that can be both annotated in inline fashion (meaning that you have an original text in front of you and add some information on top of it) and in stand-off fashion (meaning that you place the annotation somewhere else). In the study in which we presented this format (List et al. 2019), I also presented a first Python library that could parse texts in both basic formats and allow for a quick handling of the data inside Python scripts. This library, called PoePy (List 2019) is available in a very initial draft version.

In order to test the two different formats, I started to create examples in which I showed how different poems can be annotated. I quickly realized that specifically the simple format for inline annotation was the most efficient way to annotate poems directly, even if it had some drawbacks, since it uses square brackets to indicate the rhyme group of a word.

Thus, if you want to annotate a little line, such as the refrain of Eminem’s “Lose yourself”, you would have to do it as follows:

@Artist: Eminem
@Title: Lose yourself

  You better lose yourself in the mu[a]sic, the moment
  You own_[it], you better never let it [b]go.
  You only get one [c]shot, do [c]not miss your chance to [b]blow
  This opportunity comes once in a lifetime.

The fact that there are two empty spaces preceding each line here indicates that we are dealing with the refrain of the poem. Lines that start without preceding spaces are treated as normal stanzas, and stanzas and refrain are separated by a blank line each. Additional metadata can be added in front of a poem by using a construct of @key:value. In this way, the German folk song Hänschen klein, could be annotated as follows:

@Author: Franz Wiedemann
@Source: Wikipedia
@Url: https://de.wikipedia.org/wiki/H%C3%A4nschen_klein

Hänschen [a]klein, 
ging al[a]lein, 
in die weite Welt hi[a]nein. 
Stock und [b]Hut, 
steh'n ihm [b]gut, 
ist gar wohlge[b]mut.

  Aber Mutter weinet [c]sehr, 
  hat ja nun kein Hänschen [c]mehr!

Da be[d]sinnt, 
sich das [d]Kind, 
läuft nach Haus ge[d]schwind.

For the quick annotation of poems, the stand-off format was never an option, I have to admit, since it shows such a high level of sophistication that it can only be used to store a given poem after the initial annotation has been done in this format, allowing scholars interested in details of rhyming to annotate additional aspects, providing alignments of rhymed sequences, and the like.

When I found out that one of my colleagues, Oleg Sobchuk, was not only personally fascinated by rap and hip-hop, but also scientifically, we decided to try and make a collection of annotated rap songs in German, Russian, and ideally also in English. During the first months, when we tested how well the inline annotation format could be used to consistently annotate poem after poem, I quickly realized how annoyed I always became when having to write another pair of square brackets and trying to remember which letter code I had been using for the rhyme pattern.

I was hoping to find a way to arrive at a more convenient way of annotating a poem without having to type too much. However, although I have some experience in writing interactive applications in JavaScript (List 2017), I did not know how to design the tool for rhyme annotation in such a way that it would really make the annotation process convenient. Last weekend, I finally had the flash of inspiration I was waiting for. By designing an interactive application in which one can annotate both the plain text in typing, while at the same time being able to modify the text interactively, one would have the possibility to test specific ideas for interactive annotation while at the same time never losing touch to the original data.

As a result, I managed to prepare a first prototype of a rhyme annotation tool, which I now call RhyAnT for the lack of a better name. The tool is distributed in form of a website at https://digling.org/calc/rhyant (but you can also download the code from GitHub and use it offline) and first offers a text field in which one can paste the poem one wants to annotate. Once having pasted the text (adding metadata, refrain annotation, and stanza separation manually), one can press the ESCAPE key at one’s computer, and annotate the data in an interactive panel, as shown in the following figure.

Figure 1: Loading an unannotated poem in RhyAnT

The annotation itself is pretty straightforward. To assign a word to a rhyme group, one has to select a “New Rhyme” from the top-right Settings panel first. Once this has been done, one can click on whatever word in the interactive annotation panel in order to assign it to that rhyme group. In order to switch to another rhyme, one just needs to click on the next “New Rhyme” again, or one can select one of the rhymes that have already been used. In order to de-select a rhyme assigned to a word, one just has to click a second time on it.

While annotating a poem interactively, the text in the original text panel will constantly be updated with the new annotations. At the same time, one can always modify the rhyme text directly, press ESCAPE again, and the interactive display will be updated. This allows not only to make sure that rhymes are properly added to syllables (by placing them before the syllable where they occur, such as I did when writinghin[a]nein in the Hänschen klein song above, which is not yet available in interactive mode), it also normalizes the rhyme text itself while annotating, making sure that the text can really be parsed by the tool. This nicely illustrates the core idea of interfaces in computer-assisted approaches, as it facilitates data annotation while securing that the annotation is correct at the same time.

While writing this text, I just used the tool to annotate the originally unannotated children’s song “Hänschen klein” with the tool. The following screenshot shows how this looks in action.

Figure 2: A readily annotated poem in RhyAnT.

The tool is not yet perfect and there are both some minor quirks that I would like to address in the future, as well as some bigger challenges that would allow for a more detailed annotation of rhymes. Among these, I would like to add the possibility to inspect all words that have been assigned to the same rhyme pattern. I would also like to have the possibility to add rudimentary alignments that would allow to be more specific on the parts of which one thinks that they make up for the rhyme pattern in question. Last not least, I would like to integrate this into some kind of a database system that would allow us to store annotated poems immediately and display them interactively on a website.

Whether this will be done any time soon is hard to tell, as I rarely find the leisure to code a whole Sunday. But I hope that even in this form the tool will help us to get closer to the dream of having a database of poetry across genres, languages, times, and cultures.

References

Baxter, William H. (1992): A handbook of Old Chinese phonology. Berlin:de Gruyter.

List, Johann-Mattis (2017): A web-based interactive tool for creating, inspecting, editing, and publishing etymological datasets. In: Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics. System Demonstrations. 9-12.

List, Johann-Mattis and Pathmanathan, Jananan Sylvestre and Hill, Nathan W. and Bapteste, Eric and Lopez, Philippe (2017): Vowel purity and rhyme evidence in Old Chinese reconstruction. Lingua Sinica 3.1. 1-17.

List, Johann-Mattis (2016): Using network models to analyze Old Chinese rhyme data. Bulletin of Chinese Linguistics 9.2. 218-241.

List, Johann-Mattis and Nathan W. Hill and Christopher J. Foster (2019): Towards a standardized annotation of rhyme judgments in Chinese historical phonology (and beyond). Journal of Language Relationship 17.1. 26-43.

List, Johann-Mattis (2019): PoePy. A Python library for handling annotated rhymes. Jena:Max Planck Institute for the Science of Human History.

 


OpenEdition suggests that you cite this post as follows:
Johann-Mattis List (March 25, 2020). RhyAnT: A web-based tool for interactive rhyme annotation. Computer-Assisted Language Comparison in Practice. Retrieved February 12, 2025 from https://doi.org/10.58079/m6kl


This entry was posted in Annotation and tagged , , , on by .

About Johann-Mattis List

Seit Anfang 2023 leite ich den Lehrstuhl für Multilinguale Computerlinguistik in Passau. In meiner Forschung nehme ich generell einen datenbasierten, empirischen und quantitativen Standpunkt in Bezug auf Sprachwandel und Sprachgeschichte ein, mit einem speziellen Fokus auf südostasiatischen Sprachen. Im Gegensatz zu rein computerbasierten Ansätzen versuche ich jedoch, meine Forschung nah an der traditionellen historischen Linguistik und der linguistischen Theorie auszurichten, weshalb ich einen computer-gestützten Ansatz im Gegensatz zu einem rein computer-basierten Ansatz verfolge.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.