Predicting Poets' Origins from Verse: A Computational Analysis of Regional Linguistic Fingerprints in the Complete Tang Poems
Summary
This paper uses TF-IDF and neural models on the Complete Tang Poems to predict poets' regional origins from linguistic features, finding detectable regional fingerprints, distance-decay effects, and temporal modulation of the signal.
View Cached Full Text
Cached at: 06/24/26, 07:45 AM
# A Computational Analysis of Regional Linguistic Fingerprints in the Complete Tang Poems
Source: [https://arxiv.org/html/2606.24093](https://arxiv.org/html/2606.24093)
## Predicting Poets’ Origins from Verse: A Computational Analysis of Regional Linguistic Fingerprints in the*Complete Tang Poems*
Chi\-Sheng Chen1Hung\-Yun Liu2 1Harvard University2University of Washington m50816m50816@gmail\.comhungyun@uw\.edu
###### Abstract
We ask whether the geographic origin of Tang\-dynasty poets leaves a detectable linguistic trace in their work\. Aggregating every poem attributed to each author in the*Complete Tang Poems*\(*Quan Tang Shi*, 《全唐詩》\) and linking poets to their administrative circuit \(*dao*, 道\) of origin via the China Biographical Database \(CBDB, 中國歷代人物傳記資料庫\), we build a poet\-level corpus of 357 poets across the ten Tang circuits and frame origin prediction as multi\-class classification\. Using characternn\-gram TF\-IDF together with interpretable domain features \(imagery, season, and allusion\), classical and neural models predict a poet’s broad region \(South vs\. North\) at0\.690\.69accuracy, well above the0\.530\.53majority baseline, and finer circuit\-level origin above chance\. Beyond classification, three findings emerge\. \(i\) Linguistic distance between circuits grows with geographic distance \(Mantelr=0\.40r=0\.40,p≈0\.09p\\approx 0\.09over nine circuits\), evidence of a distance\-decay effect in poetic language\. \(ii\) The signal interacts with time: South/North separability is at chance in the High Tang \(盛唐\) and strongest in the Late Tang \(晚唐\), consistent with court\-driven homogenization at the empire’s height followed by regional divergence\. \(iii\) The model’s confident errors are historically meaningful—in the Early Tang \(初唐\), every misclassification is a southern poet read as northern, reflecting the prestige of the northern court idiom\. We further show that, when given the whole corpus through a hierarchical frozen\-encoder representation, a classical\-Chinese transformer \(GuwenBERT\) only matches—not beats—simple TF\-IDF, and that combining them adds nothing, indicating that characternn\-grams already capture the regional signal\. Our results position interpretable machine learning as a hypothesis generator for literary history\.
††Accepted as a Short Paper at Digital Humanities 2026 \(DH2026\), Alliance of Digital Humanities Organizations \(ADHO\)\.## 1Introduction
Literary historians have long debated the existence of regional schools and local poetic traditions in Tang China, yet the question of whether geographic origin manifests as quantifiable patterns in poetic language has resisted systematic study\. We approach it computationally\. The*Complete Tang Poems*, compiled in the Qing dynasty, is the most comprehensive anthology of Tang verse, collecting roughly 49,000 poems by more than 2,200 poets\. We ask three questions: \(1\) Can a model predict a poet’s circuit of origin from their collected work alone? \(2\) Which linguistic features—lexical choice, imagery, tonal patterns, or thematic preference—carry the strongest regional signal? \(3\) Does any regional fingerprint persist across the dynasty’s poetic eras?
We find that origin is predictable well above chance, that imagery and lexical choice dominate while tonal patterns are weak, and—most interestingly—that the regional signal is modulated by both geography \(distance decay\) and time \(High\-Tang homogenization vs\. Late\-Tang divergence\)\. We treat the model not as a replacement for close reading but as a tool that surfaces patterns worth interpretive attention, including its own informative mistakes\.
## 2Data
#### Corpus\.
We parse all 900 volumes of the*Complete Tang Poems*and aggregate every poem under its author, yielding poet\-level corpora\. Text is cleaned to retain only Chinese characters; per\-line title prefixes introduced by the source and role suffixes on author names \(e\.g\.*zhu*著,*zhuan*撰\) are removed\. We verified the join against well\-attested poets \(e\.g\. Bai Juyi 白居易,≈2600\\approx 2600poems\)\.
#### Labels\.
Each poet’s circuit \(*dao*, 道\) of origin is taken from CBDB\[[1](https://arxiv.org/html/2606.24093#bib.bib5)\], the highest administrative level of Tang geography\. We exclude poets with fewer than five surviving poems or no clear attribution, giving a final set of357 poets across 10 circuits\. The distribution is heavily imbalanced \(Jiangnan 江南道126126vs\. Longyou 隴右道66; Figure[1](https://arxiv.org/html/2606.24093#S2.F1)\), which we address with stratified cross\-validation and class weighting\. We additionally study three coarser targets: a binary*South vs\. North*\(南/北\) split and a three\-way macro grouping\.
Figure 1:Poets per circuit \(red = South, blue = North; poets with≥5\\geq 5poems\)\. The corpus is dominated by Jiangnan and the central/northern circuits\.
## 3Methods
#### Features\.
Two families are concatenated into a poet representation: \(i\) characternn\-gram TF\-IDF \(11–22grams,≤8000\\leq 8000features, sublinear term frequency\), and \(ii\) interpretable*domain features*, each a per\-character relative frequency: imagery classes \(mountain, water, plant, fauna, celestial\), seasonal and temporal markers, allusion density \(canonical citations and historical figures\), and a type–token ratio\.
#### Models and evaluation\.
We compare logistic regression, a linear SVM, a random forest, a feed\-forward neural network \(MLP\), and a fine\-tuned classical\-Chinese transformer \(GuwenBERT\[[6](https://arxiv.org/html/2606.24093#bib.bib3)\], a RoBERTa\[[2](https://arxiv.org/html/2606.24093#bib.bib4)\]for literary Chinese\)\. All classical models use balanced class weights and are evaluated with stratified 5\-fold cross\-validation, reporting accuracy and macro\-F1 against a most\-frequent baseline\. Because each poet is a single sample whose features summarize their whole corpus, cross\-validation already measures generalization to held\-out poets\. Models are built with scikit\-learn\[[4](https://arxiv.org/html/2606.24093#bib.bib1)\]\.
## 4Results
### 4\.1Origin is predictable above chance
Table[1](https://arxiv.org/html/2606.24093#S4.T1)and Figure[2](https://arxiv.org/html/2606.24093#S4.F2)report the South/North task\. The best model \(MLP\) reaches0\.690\.69accuracy and macro\-F1, far above the0\.530\.53majority baseline\. Task difficulty increases with granularity: the three\-way macro task reaches macro\-F10\.430\.43and the 10\-class circuit task macro\-F10\.180\.18—still roughly twice the corresponding baseline\.
Table 1:South/North classification \(5\-fold CV\)\.Figure 2:Model comparison on South/North \(5\-fold CV\)\. Dashed line: chance\.
### 4\.2Periphery vs\. center
At the circuit level \(Figure[3](https://arxiv.org/html/2606.24093#S4.F3)\), the most culturally distinct peripheries are the most identifiable: Jiangnan reaches recall0\.710\.71, whereas circuits around the political centers of Chang’an \(長安\) and Luoyang \(洛陽\) \(Guannei 關內道, Henan 河南道\) are heavily confused with one another\. This asymmetry suggests that proximity to the imperial court exerted a homogenizing influence on poetic language, while geographic and cultural distance preserved local distinctiveness \(Figure[4](https://arxiv.org/html/2606.24093#S4.F4)\)\.
Figure 3:Circuit\-level confusion matrix \(row\-normalized\) and per\-circuit identifiability \(recall\)\. Jiangnan is by far the most separable\.Figure 4:Identifiability \(recall\) rises with distance from the capital \(Chang’an\): peripheries are more distinctive than the center\.
### 4\.3Which features carry the signal
Imagery is the strongest regional marker: southern poets use mountain and water imagery more than northern poets \(Figure[5](https://arxiv.org/html/2606.24093#S4.F5)\)\. The most discriminative characters \(Figure[5](https://arxiv.org/html/2606.24093#S4.F5), right\) are interpretable—southern weights load on Buddhist/recluse and landscape vocabulary, northern weights on palace and*gongti*\(宮體\) boudoir motifs\. Lexical and functional\-character choice contributes substantially; tonal patterns carry comparatively weak geographic signal, plausibly because regulated\-verse prosody is standardized across regions\.


Figure 5:Left: imagery features, South vs\. North\. Right: most discriminative characters per side \(the bar labels are the characters themselves\)\.
### 4\.4Distance decay
We test the dialect\-geography hypothesis directly: poetic language should be more similar between nearby circuits\. For each circuit pair we compute the linguistic distance \(1−cos1\-\\cosbetween mean TF\-IDF vectors\) and the geographic distance \(haversine between circuit centroids\), and correlate them with a Mantel permutation test\[[3](https://arxiv.org/html/2606.24093#bib.bib7)\]\. Over the nine sufficiently populated circuits we findr=0\.40r=0\.40\(p≈0\.09p\\approx 0\.09\): farther\-apart circuits are linguistically more distant \(Figure[6](https://arxiv.org/html/2606.24093#S4.F6)\)\. The effect is suggestive rather than decisive at this sample size, and is driven less by smooth geography than by the strong distinctiveness of the southern Jiangnan idiom\.
Figure 6:Linguistic distance between circuits grows with geographic distance\.
### 4\.5The signal is real, and it changes over time
We rule out two confounds\.*Corpus length*is not responsible: South and North have nearly identical median corpus sizes, and truncating every poet to a common budget barely changes accuracy \(0\.60→0\.590\.60\\to 0\.59; Figure[7](https://arxiv.org/html/2606.24093#S4.F7)\)\.*Era*is genuinely associated with region \(χ2=11\.9\\chi^\{2\}=11\.9,p=0\.008p=0\.008: the Early Tang skews north, the Late Tang skews south, reflecting the southward migration of literary culture\)—but the regional signal persists within eras, and its strength itself is a finding: South/North is*at chance in the High Tang*\(0\.500\.50\) and*strongest in the Late Tang*\(0\.680\.68; Figure[7](https://arxiv.org/html/2606.24093#S4.F7)\)\. This is quantitative evidence for court\-driven homogenization at the empire’s height giving way to regional divergence as central authority weakened\.


Figure 7:Left: corpus\-length control \(stable⇒\\Rightarrownot a length artifact\)\. Right: South/North separability by era\.
### 4\.6Reading the model’s mistakes as literary history
The classifier’s confident errors are biographically and historically meaningful\. Broken down by era \(Figure[8](https://arxiv.org/html/2606.24093#S4.F8)\),*every*Early\-Tang misclassification is a southern poet read as northern \(7 of 7\), with no errors in the opposite direction\. Early\-Tang southern figures \(e\.g\. Yu Shinan 虞世南, Chu Liang 褚亮, He Zhizhang 賀知章\) wrote in the dominant northern court idiom, so the model reads their verse as northern\. The “error” thus encodes the homogenizing pull of the court—corroborating Section[4\.5](https://arxiv.org/html/2606.24093#S4.SS5)—and illustrates how a model can generate hypotheses for close reading and literary history\.
Figure 8:Misclassification direction by era\. Early Tang: all South→\\toNorth\.
### 4\.7A fair comparison for the transformer
Naively fine\-tuning GuwenBERT on 250\-character fragments and averaging fragment probabilities yields only0\.62±0\.060\.62\\pm 0\.06under grouped cross\-validation—but this handicaps the transformer, which never sees the whole corpus that TF\-IDF reads\. We remove the asymmetry with a hierarchical representation: encode each fragment with a*frozen*GuwenBERT, masked\-mean\-pool its token states, then mean\-pool all of a poet’s fragments into a single vector, evaluated under the*same*stratified 5\-fold protocol\. Given the whole corpus, the transformer now*matches*the best classical model \(0\.6740\.674, Figure[9](https://arxiv.org/html/2606.24093#S4.F9)\); crucially, combining BERT with TF\-IDF adds nothing, indicating that characternn\-grams already capture the available regional signal\. On a corpus of this size and in a script where the character is the natural unit, the pretrained encoder offers no information beyond simple lexical statistics\.
Figure 9:Fair comparison under identical 5\-fold CV: hierarchical frozen BERT ties TF\-IDF; the hybrid does not improve over either\.
## 5Discussion
Methodologically, the study shows that geographic\-linguistic analysis— traditionally confined to spoken dialects—can be applied to a historical literary corpus, and that interpretable models yield humanistically meaningful insight rather than black\-box prediction\. Substantively, our evidence speaks to the long\-running debate over regional schools in Tang poetry: detectable regional variation persists, concentrated in imagery and lexical choice, even within an empire that shared a classical education and a court\-centered prestige idiom\. The temporal pattern reframes the debate—regional distinctiveness is not constant but waxes and wanes with the political integration of the dynasty\.
## 6Limitations
The usable sample \(357 poets; 242 for South/North\) is small, attribution and geographic labels inherit noise from the source and from CBDB, and the within\-era analyses rest on tens of poets per era\. Tonal \(*pingze*, 平仄\) features, which require a Middle\-Chinese \(中古漢語\) rime dictionary, are approximated only\. The distance\-decay effect is suggestive \(p≈0\.09p\\approx 0\.09\) and would benefit from finer \(prefecture\-level\) geocoding and more poets per region\.
## 7Conclusion
A Tang poet’s geographic origin leaves a computationally detectable trace in their verse, carried chiefly by imagery and lexical choice, decaying with geographic distance and modulated by historical era\. Interpretable models, and even their mistakes, generate concrete hypotheses for literary history— productive human–machine collaboration in humanistic inquiry\. Future work will extend the temporal analysis and build stylistic similarity networks to ask whether textual proximity tracks geography or transcends it through literary influence\.
## Data and Code Availability
The*Complete Tang Poems*text is in the public domain; biographical and geographic attributions are derived from the China Biographical Database\[[1](https://arxiv.org/html/2606.24093#bib.bib5)\]\. All data\-processing, modelling, analysis, and figure\-generation code is openly available athttps://github\.com/ChiShengChen/ctext\.org\_\-crawler\(subject:gender\_poem\_predictor/\)\. The derived poet\-level dataset can be reconstructed from the released scripts\.
## Acknowledgements
We thank the maintainers of the China Biographical Database \(CBDB\) and the Chinese Text Project \(中國哲學書電子化計劃\)\[[5](https://arxiv.org/html/2606.24093#bib.bib9)\]for the resources that made this study possible, and the developers of GuwenBERT\[[6](https://arxiv.org/html/2606.24093#bib.bib3)\]and scikit\-learn\[[4](https://arxiv.org/html/2606.24093#bib.bib1)\]for their open\-source tools\.
## References
- \[1\]\(2024\)China biographical database \(cbdb\)\.Note:https://projects\.iq\.harvard\.edu/cbdbCited by:[§2](https://arxiv.org/html/2606.24093#S2.SS0.SSS0.Px2.p1.2),[Data and Code Availability](https://arxiv.org/html/2606.24093#Sx1.p1.1)\.
- \[2\]Y\. Liu, M\. Ott, N\. Goyal, J\. Du, M\. Joshi, D\. Chen, O\. Levy, M\. Lewis, L\. Zettlemoyer, and V\. Stoyanov\(2019\)RoBERTa: a robustly optimized BERT pretraining approach\.arXiv preprint arXiv:1907\.11692\.Cited by:[§3](https://arxiv.org/html/2606.24093#S3.SS0.SSS0.Px2.p1.1)\.
- \[3\]N\. Mantel\(1967\)The detection of disease clustering and a generalized regression approach\.Cancer Research27\(2\),pp\. 209–220\.Cited by:[§4\.4](https://arxiv.org/html/2606.24093#S4.SS4.p1.3)\.
- \[4\]F\. Pedregosa, G\. Varoquaux, A\. Gramfort, V\. Michel, B\. Thirion, O\. Grisel, M\. Blondel, P\. Prettenhofer, R\. Weiss, V\. Dubourg, J\. Vanderplas, A\. Passos, D\. Cournapeau, M\. Brucher, M\. Perrot, and E\. Duchesnay\(2011\)Scikit\-learn: machine learning in Python\.Journal of Machine Learning Research12,pp\. 2825–2830\.Cited by:[§3](https://arxiv.org/html/2606.24093#S3.SS0.SSS0.Px2.p1.1),[Acknowledgements](https://arxiv.org/html/2606.24093#Sx2.p1.1)\.
- \[5\]D\. Sturgeon\(2021\)The Chinese Text Project: a dynamic digital library of premodern chinese\.Digital Scholarship in the Humanities36,pp\. i101–i112\.Cited by:[Acknowledgements](https://arxiv.org/html/2606.24093#Sx2.p1.1)\.
- \[6\]E\. Yan\(2020\)GuwenBERT: a pre\-trained language model for classical chinese\.Note:https://github\.com/Ethan\-yt/guwenbertCited by:[§3](https://arxiv.org/html/2606.24093#S3.SS0.SSS0.Px2.p1.1),[Acknowledgements](https://arxiv.org/html/2606.24093#Sx2.p1.1)\.Similar Articles
Do Large Language Models Perform Well on Comprehending Poetic Logic in Modern Chinese Poetry?
The paper introduces Peony, the first benchmark for evaluating large language models on comprehending poetic logic in modern Chinese poetry, and evaluates six mainstream LLMs, revealing their limitations in this specialized task.
Characterizing Human-Likeness in AI Generated Poetry: A Zero-shot Classification Study
This paper proposes a zero-shot detection pipeline to characterize human-likeness in AI-generated poetry, aiming to identify attributes that distinguish human from machine poems and improve detection methods.
Neo-Classic: A Benchmark for Evaluating Linguistic-Aesthetic Reasoning in Classical Chinese Poetry
The Neo-Classic benchmark evaluates linguistic-aesthetic reasoning in classical Chinese poetry using contemporary poems to test LLMs, revealing performance gaps and difficulties in global hierarchical planning.
Detecting and Guiding LLM-Generated Korean Poetry with Interpretable Form-level Features
This paper introduces interpretable form-level features to detect and guide LLM-generated Korean poetry, achieving improved detection accuracy and generating poems that more closely resemble human writing in form.
Tangut Word Segmentation under Extreme Resource Scarcity: Integrating Traditional Lexicons and Unlabeled Text
This paper presents the first systematic study of word segmentation for the extinct Tangut language, combining traditional lexicons, unlabeled text, and a pretrained character encoder to achieve high performance despite extreme resource scarcity.