A Generic Tool for Visualizing Patterns in Poetry

Onur Musaoglu, Özge Dag, Özge Küçükakça, Alkim Almila Akdag Salah, Albert Ali Salah

Abstract

Poetry analysis requires a balance between aesthetic appreciation and rigorous linguistic data. This paper introduces a modular, web-based visualization tool designed to bridge this gap. By implementing a hierarchical database structure and integrating Turkish-specific Natural Language Processing (NLP) and sentiment analysis, the system enables researchers to explore large poetic corpora. Key features include "poetry barcodes" that visualize emotional and grammatical shifts and statistical alliteration maps. We validate the tool through a case study of the works of Nâzım Hikmet Ran, demonstrating its ability to reveal stylistic evolutions linked to historical and personal contexts.

Introduction

Natural Language Processing (NLP) has traditionally focused on prose for information extraction. Poetry, however, presents unique challenges due to its reliance on visual structure, rhythm, and affective tone. Current visualization tools typically fall into two categories: aesthetically pleasing but data-sparse word clouds, or dense technical analyses that lack intuitive interfaces. There is a distinct lack of tools that allow researchers to explore a massive corpus—thousands of poems written over decades—to see how a poet’s style and emotional state shifted in response to life events.

Methodology

The authors developed a full-stack application (Java/Spring backend, AngularJS frontend) designed for scalability and granular analysis. The core innovation lies in the data structure and processing pipeline:

Hierarchical Database Structure

To preserve the poet's structural intent, the system uses a strict SQL hierarchy: Book → Work → Line → Word → Character. This allows for multi-scale analysis, from broad thematic shifts across books down to the specific font or indentation of a single line.

Hierarchical database schema used to preserve poetic structure from books down to individual characters.

NLP and Affective Analysis

The system integrates a Turkish Morphological Parser and Disambiguator to handle the complexities of suffix-heavy grammar. For emotional mapping, it assigns values for Valence (pleasantness), Arousal (intensity), and Dominance (control) to every word and line. Treating each line as a standalone unit for sentiment analysis was found to most accurately reflect a poem's rhythmic emotional beats.

The "Poetry Barcode"

A novel visualization was developed where each line of a poem is represented as a horizontal sliver. The color and length of these slivers encode linguistic features (such as active vs. passive voice) and emotional tone, allowing researchers to "see" the shape of a poem at a glance.

The "Poetry Barcode" visualization, mapping linguistic features and emotional dimensions (valence, arousal, dominance) across lines.

Case Study: The Works of Nâzım Hikmet Ran

The primary dataset consists of the collected works of Nâzım Hikmet Ran, a prominent Turkish poet whose life included significant periods of imprisonment and exile. The tool successfully identified historical shifts in his work; for example, usage of the words "freedom" (hürriyet) and "jail" (hapis) spiked significantly after his arrest in 1938. Qualitatively, the poetry barcodes allow for high-level comparisons of different translations, revealing where stylistic or emotional features may be lost in translation.

Limitations and Future Work

The most significant hurdle remains copyright, which currently prevents the full web tool from being opened to the general public. While the system is modular, it is currently optimized for Turkish. Future work aims to adapt the tool for other languages by integrating different morphological parsers and sentiment dictionaries, eventually allowing for cross-poet comparisons and deeper insights into how different artists respond to similar historical events.

Summary updated

BibTeX
@inproceedings{musaoglu2017generic,
  author = {Onur Musaoglu and Özge Dag and Özge Küçükakça and Alkim Almila Akdag Salah and Albert Ali Salah},
  title = {{A Generic Tool for Visualizing Patterns in Poetry}},
  booktitle = {DH},
  year = {2017},
}
Figure