Comparing Tools for Sentiment Analysis of Danish Literature from Hymns to Fairy Tales: Low-Resource Language and Domain Challenges

Pascale Feldkamp, Jan Kostkan, Ea Lindhardt Overgaard, Mia Jacobsen, Yuri Bizzoni2024

Abstract

While Sentiment Analysis has become increasingly central in computational approaches to literary texts, the literary domain still poses important challenges for the detection of textual sentiment due to its highly complex use of language and devices—from subtle humor to poetic imagery. Furthermore, these challenges are only further amplified in low-resource language and domain settings. In this paper, we investigate the application and efficacy of different Sentiment Analysis tools on Danish literary texts, using historical fairy tales and religious hymns as our datasets. The scarcity of linguistic resources for Danish and the historical context of the data further compounds the challenges for the tools. We compare human annotations to the continuous valence scores of both transformer- and dictionary-based Sentiment Analysis methods to assess their performance, seeking to understand how distinct methods handle the language of Danish prose and poetry.

Introduction: The "City Slicker" Problem in NLP

Most modern Sentiment Analysis (SA) tools are optimized for contemporary English data, such as movie reviews, social media posts, or news articles. When applied to the "wilderness" of 19th-century Danish literature, these tools encounter a triple challenge: a low-resource language environment, a significant domain shift toward complex literary imagery, and historical linguistic evolution (archaic spellings and semantic shifts). This study evaluates whether the "Transformer revolution" (e.g., BERT, RoBERTa) has effectively bridged the gap for literary studies or if traditional, rule-based dictionaries remain more robust in niche, historical domains.

Methodology

We compared three primary computational approaches against a human-annotated gold standard (valence scores on a 0–10 scale):

  1. Dictionary-based (Lexicon): Tools such as Afinn, Sentida, and Asent that utilize pre-defined sentiment weights for specific words.
  2. Transformer-based: Neural networks including Senda (Danish-specific) and RoBERTa-xlm (multilingual).
  3. Cross-lingual Baselines: Translating Danish text to English via Google Translate and applying high-resource English tools like VADER.

To facilitate comparison, we utilized "detrending." Raw sentiment scores in literature are often noisy; by applying polynomial fits, we extracted smooth "sentiment arcs" that represent the narrative's emotional trajectory.

Narrative Arcs in Fairy Tales (Prose)

In the analysis of Hans Christian Andersen’s fairy tales (the HCA dataset), Transformer models demonstrated a clear advantage. Because these models are "context-hungry," they leverage the narrative structure of long-form prose to track emotional shifts effectively.

Figure 2: Comparison of sentiment arcs from various automated models against the human mean for 'The Little Mermaid' (Den Lille Havfrue).

As seen in the sentiment arcs for The Little Mermaid, while individual models vary in their raw valence, they generally track the overall "vibe" of the story. Interestingly, multilingual RoBERTa applied to English translations outperformed native Danish tools, suggesting that translation into a high-resource language remains a viable strategy for low-resource literary analysis.

The Complexity of Poetic Sentiment (Hymns)

In contrast to the success of Transformers in prose, the Hymns dataset (1798–1873) presented a different challenge. These texts are shorter, more repetitive, and rely on dense symbolic meaning and archaic register. In this domain, the dictionary-based tool Sentida outperformed all Transformer models.

Figure 3: Valence scores for specific hymn verses, illustrating the discrepancies between human annotators and automated tools like Sentida and RoBERTa.

Specific linguistic traps, such as the "archaic trap," were evident. Models frequently failed to recognize 19th-century spellings (e.g., hielp vs. modern hjælp). Furthermore, humans identified poetic exclamations like "Ak!" (Alas!) as highly negative, while automated models often treated these register-specific cues as neutral. This "poetic blindness" suggests that for fragmented, archaic text, a well-curated lexicon is often more reliable than a complex model seeking context that the verse structure does not provide.

Conclusion

Our findings indicate that the choice of Sentiment Analysis tool should be domain-dependent. For long-form narrative prose, Transformer-based models (and translation-based pipelines) excel at capturing the narrative arc. However, for historical poetry and hymns, dictionary-based methods remain superior due to their robustness against archaic spelling and their focus on specific emotional keywords. Future work must focus on developing "historically-aware" models to better navigate the evolution of language and literary devices.

Summary updated

BibTeX
@misc{feldkamp2024comparing,
  author = {Pascale Feldkamp and Jan Kostkan and Ea Lindhardt Overgaard and Mia Jacobsen and Yuri Bizzoni},
  title = {{Comparing Tools for Sentiment Analysis of Danish Literature from Hymns to Fairy Tales: Low-Resource Language and Domain Challenges}},
  year = {2024},
  doi = {10.18653/v1/2024.wassa-1.15},
}
Figure