Source-linked AI summary
Syntactic Patterns and Stylistic Functions in Narrative Prose: A Rule-Based and Machine-Learning Approach
Stefana Janicijevic
TL;DR
Quantitative literary stylistics has traditionally emphasized lexical features, with syntactic information used less often or at a coarse level. This paper labels sentence-level narrative functions from dependency parses and classifies linearised syntactic triples; Random Forest performs best among the reported approaches, while DistilBERT with LoRA falls short. The workflow offers a reusable baseline, with results bounded by the corpus and evaluation setup.
Problem
Quantitative approaches to literary style have used syntactic information less often or only at a coarse level, leaving its relationship to sentence-level narrative functions less explored.
Source: §1 · p. 1Method
The paper applies rule-based labels for five narrative categories to dependency-parsed sentences, encodes them as lemma–UPOS–dependency triples, and trains classifiers to predict style.
Source: §1 · p. 1, §7 · p. 12Results
Random Forest reached macro-F1 = 0.9764 on the full dataset and 0.9845 after Firefly Algorithm optimisation with Lévy-flight perturbation; DistilBERT with LoRA failed to match the weakest baseline.
Source: §7 · pp. 12–13Takeaways & Limitations
The workflow provides an interpretable, lightweight baseline for stylistic sentence classification and supports qualitative inspection alongside quantitative evaluation.
Source: §7 · p. 13The corpus comes from one literary domain, ideological and neutral classes are underrepresented, and metaheuristic results from the 3,300-sentence sample are not directly comparable to full-dataset baselines.
Source: §6.6 · p. 12
Abstract
from arXiv · showhide
This paper presents a small-scale quantitative experiment that links syntactic structure to stylistic functions in narrative prose. Starting from a dependency-parsed corpus of 3,300 sentences, we derive sentence-level stylistic labels across five categories --- descriptive, introspective, causal, ideological, and neutral --- using a transparent rule-based procedure that inspects lemmas, universal part-of-speech tags, and syntactic relations. For each sentence we construct a compact representation of its syntactic profile as a sequence of linearised triples combining lemma, POS tag, and dependency relation. These patterns serve as input to standard machine-learning classifiers trained to predict sentence-level style. The best-performing model achieves a macro-F1 of 0.948 under 10-fold cross-validation. The experiment is implemented entirely in Python using open-source tools. Our goal is not to propose a fully fledged stylistic theory, but to offer a reproducible and extensible workflow for exploring how grammatical structure contributes to narrative interpretation.
1 Introduction
The paper addresses the underuse of syntactic information in quantitative stylistics by linking sentence-level grammatical patterns to narrative functions. It proposes a transparent, reproducible pipeline that derives rule-based labels, encodes syntactic patterns, and trains classifiers to predict style.
- The representation uses lemmas, universal POS tags, and dependency relations rather than raw tokens or surface word forms.This captures grammatical structure while remaining relatively robust to vocabulary variation across texts and genres.Source: §1 · p. 1
- Five sentence-level categories—ideological, descriptive, introspective, causal, and neutral—represent different narrative functions.An interpretable rule-based procedure inspects syntactic and lexical cues in dependency annotations to assign the labels.Source: §1 · p. 1
- The pipeline derives sentence-level stylistic labels from syntactic annotation, encodes sentences as linearised syntactic patterns, and trains classifiers to predict style.The authors frame this as a transparent and reproducible methodological workflow, not a definitive theory of narrative style.Source: §1 · pp. 1–2
- The lightweight, modular workflow can be applied to small corpora without large annotated training sets or specialised hardware.Its readable rule definitions and inspectable model outputs support qualitative interpretation, and components can be revised or extended to other genres, languages, or annotation schemes.Source: §1 · p. 2
2 Background and Related Work
Prior work shows that lexical features are established in stylometry, while syntactic features connect grammatical patterns with functional variation and may address limits in lexical approaches. The paper situates its sentence-level narrative classification within this work and uses Slovenian dependency annotation as its input.
2.1 Stylometry and Authorship Attribution
- Closed-set authorship attribution is broadly solved with function words or character n-grams, while open-set, cross-genre, and very-short-text settings remain harder for lexical features alone.This motivates interest in syntactic and structural features that are less sensitive to topic and more stable across varying text lengths.Source: §2.1 · p. 2
2.2 Register Analysis with Syntactic Features
- Biber’s analysis linked grammatical features to functional register distinctions, while Argamon calls for empirically grounded feature inventories over parsed corpora.The paper’s weighted scoring framework is aligned with that recommendation, replacing binary rule-firing with weighted interpretable feature groups derived from dependency parses.Source: §2.2 · pp. 2–3
2.3 NLP Resources for Slovenian
- Universal Dependencies and the SSJ treebank provide Slovenian prose with lemmas, UPOS tags, and dependency relations for the pipeline.The SSJ treebank is described as the reference resource for Slovenian dependency parsing and morphosyntactic tagging.Source: §2.3 · p. 3
2.4 Computational Analysis of Literary Prose
- This work classifies sentence-level narrative functions using lemma–UPOS–dependency triples rather than author or genre labels or coarse syntactic counts.Logistic Regression and Random Forest serve as transparent baselines, while DistilBERT with LoRA illustrates differing modeling assumptions.Source: §2.4 · p. 3
3 Data and Rule-based Stylistic Annotation
The paper starts with Universal Dependencies-parsed narrative prose and assigns sentence-level style labels through rules over lexical and syntactic cues. It also describes an enhanced weighted scoring framework using interpretable feature groups, a confidence threshold, and calibrated weights.
3.1 Parsed Corpus
- The corpus supplies sentence-level token records with lemmas, UPOS tags, and dependency relations, and subsequent labelling, pattern construction, and classifier training operate at sentence level.The corpus is processed in CoNLL-U format under the Universal Dependencies schema.Source: §3.1 · p. 4
3.2 Sentence-Level Style Categories
- Five mutually exclusive categories capture introspective, causal, descriptive, ideological, and neutral functions using lexical, POS, and dependency cues.Because rules can overlap, the earliest matching class in the priority order—introspective, causal, descriptive, ideological, then neutral—is assigned.Source: §3.2 · p. 4
3.3 Enhanced Heuristic Design
- The enhanced heuristic replaces binary rule firing with weighted sums over interpretable features, including trigger lemmas, dependency motifs, clause structure, modality markers, and discourse connectives.A confidence threshold assigns neutral when the score is too low; ties use the Section 3.2 priority order, and weights are initialized by linguistic judgment then refined on a held-out validation partition by macro-F1 optimization. The passage says the feature inventory and calibrated weights will be updated once the specification is completed.Source: §3.3 · p. 5
4 Syntactic Pattern Representation and Classification
Sentences are represented as linearised syntactic triples, then converted to TF-IDF features for style classification. The section also cautions that the classifiers reproduce rule-defined labels and notes ambiguous category boundaries.
4.1 Linearised Syntactic Patterns
- Each sentence is encoded as surface-order triples of lemma, UPOS tag, and dependency relation, retaining grammatical information while discarding raw word forms.The representation is intended to reduce sparsity and focus on syntactic behaviour.Source: §4.1 · p. 5
4.2 Classification Setup
- Linearised patterns serve as input text and stylistic categories as target labels; TF-IDF vectors use 500 unigram and bigram terms and a stratified train/test split.The stratification preserves class distribution.Source: §4.2 · p. 6
- The classification setup compares Logistic Regression, Random Forest, and LinearSVC, evaluating per-class and macro-averaged precision, recall, and F1.LinearSVC is described as learning a maximum-margin hyperplane suited to high-dimensional sparse features; Random Forest predicts by majority vote over trees.Source: §4.2 · p. 6
4.3 Interpretation and Limitations
- Because labels come from simple rules, the models replicate a syntactic operationalisation of style rather than gold-standard human annotations.The authors frame the setup as a proof of concept: relatively coarse syntactic patterns carry enough signal to distinguish narrative functions.Source: §4.3 · p. 6
- The discussion identifies ambiguous boundaries especially between ideological and descriptive, and causal and neutral categories, alongside possible refinements to rules and features.It also outlines extensions to other genres, languages, and annotation schemes.Source: §4.3 · p. 6
5 Results
The experiments compare feature-based classifiers across a 3,300-sentence sample, cross-validation, the full corpus, and tuned and neural configurations. Random Forest with Firefly optimisation is the best-performing configuration reported, while DistilBERT with LoRA falls short of feature-based models.
5.1 Dataset and Experimental Setup
- Baseline experiments use a stratified sample of 3,300 sentences from 9,253, with an 80/20 split and a 500-term TF-IDF vocabulary.The three evaluated classifiers are Logistic Regression, Random Forest, and LinearSVC.Source: §5.1 · p. 6, Table 1 · p. 7
5.2 Baseline Classification Results
- The ideological class is hardest on the held-out test set: Logistic Regression has F1 0.58, compared with Random Forest at 0.90 and LinearSVC at 0.77.The class has only 22 test instances, approximately 3.3% of the test set.Source: §5.2 · p. 7, Table 2 · p. 7
5.3 Cross-Validation Results
- Random Forest has the highest out-of-fold macro-F1 at 0.9473 ± 0.0129, despite perfect train-fold F1 scores indicative of overfitting.Its k-fold sensitivity results and repeated stratified shuffle split are also described as stable and consistent.Source: §5.3 · p. 7, Table 3 · p. 8
5.4 Evaluation on the Full Dataset
- All three classifiers improve on the full 9,253-sentence dataset; Random Forest reaches macro-F1 0.9764, versus 0.9422 on the 3,300-sentence sample.The sample-based and full-dataset rankings are consistent, with Random Forest strongest in both conditions.Source: §5.4 · p. 8, Table 4 · p. 8
5.5 Metaheuristic Hyperparameter Optimisation
- Macro-F1 rises from 0.9422 to 0.9845 (+0.0423) with Firefly-optimised Random Forest, the best-performing configuration across the experiments.Its accuracy rises from 0.9530 to 0.9877.Source: §5.5 · pp. 8–9, Table 5 · p. 9
5.6 Neural Baseline: DistilBERT with LoRA Fine-tuning
- Both DistilBERT LoRA configurations fall well short of feature-based classifiers; Version 2 reaches macro-F1 0.539 despite adjustments for imbalance and underfitting.The paper attributes the gap to a mismatch between syntactic-pattern strings and the natural-language input on which DistilBERT was pretrained.Source: §5.6 · pp. 9–10, Table 6 · p. 9
6 Discussion
Random Forest leads the evaluated feature-based classifiers across sample, full-corpus, and tuned conditions, with stable cross-validation performance. The discussion also highlights minority-class difficulty, symbolic-input mismatch, and limits on generalizing the results.
6.1 Random Forest as the Dominant Feature-Based Classifier
- 0.9764 macro-F1: Random Forest outperformed Logistic Regression and Linear SVC across conditions and reached this score on the full 9,253-sentence dataset.On the 3,300-sentence sample, it achieved accuracy 0.9530 and macro-F1 0.9422. The authors attribute its advantage to feature subspace sampling and flexible tree partitions in sparse, high-dimensional data.Source: §6.1 · p. 10
6.2 Overfitting and Generalisation in Random Forest
- 0.9473 ± 0.0129 out-of-fold macro-F1: Random Forest exceeded Logistic Regression (0.8048 ± 0.0374) and LinearSVC (0.8694 ± 0.0275).Its perfect in-fold F1 of 1.00 signals memorization, while accuracy remained stable across 3-, 5-, and 10-fold evaluations and repeated shuffle-split estimates.Source: §6.2 · p. 10
6.3 The Minority-Class Challenge: ideological
- 22 test instances (≈3.3%) made ideological the most difficult class; the authors identify targeted collection for underrepresented categories as the highest-yield improvement strategy.Logistic Regression had F1 = 0.58 and recall 0.41 for this class, while Random Forest reached F1 = 0.90 and recall 0.82. The authors conjecture that overlap with descriptive or causal constructions contributes to the difficulty.Source: §6.3 · p. 11
6.4 Metaheuristic Optimisation: Gains and Limits
- 0.9422 to 0.9845 macro-F1 (+0.0423): Firefly Algorithm optimization with Lévy-flight steps was the only evaluated metaheuristic to substantially improve on its Random Forest baseline.The authors argue that search is most useful when a model has enough capacity and its hyperparameter landscape is multimodal; the LinearSVC tuning did not meaningfully beat baseline, and Logistic Regression gained only +0.038 macro-F1.Source: §6.4 · p. 11
6.5 Why DistilBERT Underperformed
- Macro-F1 ≤0.539 for DistilBERT + LoRA, versus 0.9422 for TF-IDF + Random Forest, was attributed to a mismatch between symbolic triple inputs and natural-language pretraining.The tokeniser fragments pipe-delimited triples, whereas TF-IDF treats each triple as an atomic feature. Longer contexts, weighted loss, and lower learning rates improved the neural model but did not close the gap under this input regime.Source: §6.5 · pp. 11–12
6.6 Implications and Limitations
- >0.97 macro-F1 on the full dataset after tuning suggests the five-category scheme is internally consistent and its labels are recoverable from syntactic patterns.The corpus comes from one literary domain, and ideological and neutral classes remain underrepresented; moreover, tuning used the 3,300-sentence sample, so those optimized results are not directly comparable to full-dataset baselines.Source: §6.6 · p. 12
6.7 Directions for Future Work
- Proposed next steps include raw-text input for Slovenian or South Slavic language models, full-corpus Firefly optimization, and active learning for uncertain minority-class examples.The authors expect full-corpus optimization could exceed the sample's 0.9845 macro-F1 and propose prioritizing ideological candidates in active learning.Source: §6.7 · p. 12
7 Conclusion
The paper presents a reproducible workflow for classifying sentence-level narrative functions from dependency-based syntactic patterns. Random Forest led the tested approaches, while the conclusion notes minority-class and domain limitations and proposes extensions to the workflow.
7 Conclusion
- Random Forest led the feature-based models across conditions, reaching macro-F1 = 0.9764 on the full dataset and 0.9845 after Firefly optimization.Cross-validation and k-fold sensitivity analyses indicate these gains were stable across data partitions.Source: §7 · pp. 12–13
- Ideological sentences comprise fewer than 3.5% of the corpus and partially overlap syntactically with descriptive and causal constructions, making them a recurring challenge.The conclusion identifies targeted collection for underrepresented categories as a promising future annotation priority.Source: §7 · p. 13
- DistilBERT + LoRA failed to match even the weakest baseline; the authors attribute this to pipe-delimited triples being opaque to a natural-language-pretrained model.They conclude that transfer learning is most beneficial when pretraining and target input representations align.Source: §7 · p. 13
- The corpus is limited to one literary domain, optimized results use a 3,300-sentence sample, and rule-based labels are not gold-standard human annotations.The classifiers therefore replicate a particular syntactic heuristic rather than human stylistic intuition.Source: §7 · p. 13
- The lightweight workflow uses interpretable rule-based labels and TF-IDF features, standard Python libraries, open-source parsing tools, and CoNLL-U corpora.The authors present it as an accessible and reusable foundation for quantitative exploration of narrative style.Source: §7 · p. 13
- Future work proposes raw-sentence input for Slovenian or South Slavic language models, expanded full-corpus optimization, and active learning focused on uncertain minority-class examples.The active-learning proposal aims to improve macro-averaged performance without annotating the entire unlabelled corpus.Source: §7 · p. 13