Introduction
During the "Modern Breakthrough" in Scandinavia (c. 1870–1900), literary production was characterized by a tension between realism and romanticism. Authors and critics debated whether fiction should confront contemporary social issues or provide an escape into historical romance. For modern literary historians, classifying these works into historical novels (set in the past) and contemporary novels (set in the author's present) is a foundational task. However, manual classification of large-scale corpora is labor-intensive and subjective. This study investigates whether Transformer-based language models can automate this distinction, identifying the specific textual signals that differentiate these two temporal genres.
Methodology
The researchers evaluated four state-of-the-art Transformer models to determine their efficacy in genre classification:
- DanskBERT: A high-performance model trained on Danish text.
- DFM (Large): A Danish Foundation Model encoder.
- MeMo-BERT-03: A model specifically fine-tuned on the historical Danish and Norwegian corpus used in this research.
- NB-BERT-base: A Norwegian-specific BERT model.
To identify which parts of a book contain the strongest genre signals, the models were tested on three distinct input configurations: Titles and Subtitles (analyzing the paratextual "packaging"), the First 15 Sentences (analyzing the narrative opening), and a Concatenation of both.
The MeMo Corpus
The study utilized the MeMo (Measuring Modernity) corpus, comprising 859 Danish and Norwegian novels published between 1870 and 1900. The dataset reflects the prevailing literary trends of the era, showing a significant imbalance where approximately 78% of the works are contemporary and 22% are historical.
The corpus is extensive, containing over 53 million words and 3.2 million sentences, providing a robust foundation for training and validation across the two languages.
Results and Discussion
The experimental results revealed a surprising trend: paratextual information (titles and subtitles) often provided a clearer signal for genre classification than the actual narrative text.
As shown in the results table, MeMo-BERT-03 achieved its highest F1-score of 0.91 using only titles and subtitles. Conversely, performance typically declined when models were restricted to the first 15 sentences of the text. For instance, the DFM (Large) model's test performance dropped from 0.88 to 0.86 when moving from titles to narrative text. Combining both inputs did not significantly improve results over titles alone, suggesting that models struggled to weigh clear paratextual signals against more ambiguous narrative text.
Key Insights
- The Power of Paratext: 19th-century historical novels were often explicitly marketed as such through subtitles like "A Story from the Year 1780." These act as high-precision flags for machine learning models.
- Genre through Silence: Contemporary novels rarely state their temporal setting explicitly. Models learned to interpret the absence of historical markers as a strong indicator of a contemporary setting.
- The "Knight" Trap: Models remain susceptible to keyword-based errors. A title containing "Knight" might trigger a historical classification even if the narrative immediately establishes a modern urban setting.
- Calibration Challenges: Models became more overconfident and less accurate when processing narrative sentences, likely because genre-revealing cues are not uniformly distributed throughout the opening of a novel.
Conclusion
This research demonstrates that Transformer models can effectively distinguish between historical and contemporary fiction, with paratextual elements serving as surprisingly potent indicators. While the models perform well, they still struggle with the "near past" and subtle 19th-century social cues that human scholars recognize. Future work will explore whole-novel analysis and hybrid approaches that combine machine learning with expert-defined rules to navigate the complexities of literary genre.
Summary updated