Organizations: College of Computer Science and Information Systems, Najran University, King Abdul Aziz Rd, 66462, Najran, KSA · Knight Foundation School of Computing and Information Sciences, Florida International University, 11200 SW 8th Street, 33199, FL, USA
Motifs are non-commonplace, recurring narrative elements, often found originally in folk stories. In addition to being of interest to folklorists, motifs appear as metaphoric devices in modern news, literature, propaganda, and other cultural texts. Finding expressions of motifs in the original folkloristic text is useful for both folkloristic analysis (motif indexing) as well as for understanding the modern usage of motifs (motif detection and interpretation). Prior work has primarily shown how difficult these problems are to tackle using automated techniques. We present the first computational approach to motif indexing. Our choice of data is a key enabler: we use a large, widely available text (the Arabian Nights) paired with a detailed motif index (by El-Shamy in 2006), which overcomes the common problem of inaccessibility of texts referred to by the index. We created a manually annotated corpus that identified 2,670 motif expressions of 200 different motifs across 58,450 sentences for training and testing. We tested five types of approaches for detecting motif expressions given a motif index entry: (1) classic retrieve and re-rank using keywords and a fine-tuned cross-encoder; (2) off-the-shelf embedding models; (3) fine-tuned embedding models; (4) generative prompting of off-the-shelf LLMs in N-shot setups; and (5) the same generative approaches on LLMs fine-tuned with LoRA. Our best performing system is a fine-tuned Llama3 model which achieves an overall performance of 0.85 F1.
Figures & tables
Figure 1: Structure of the entries in A Motif Index of The Thousand and One Nights ( El-Shamy, 2006 )
Figure 2: A selection from the available scan of Burton’s 1885 translation of The Arabian Nights , illustrating the archaic vocabulary (red boxes) and grammar, as well as challenging OCR (note specifically the f s in befel and far-famed )
Figure 3: Needleman-Wunsch Example
Figure 4: Conceptual Complexity
Data
Count
Sentences in the Text
45,769
Tokens in the Text
1,398,863
Unique Motifs
200
Positive Examples in the Index
266
Motifs with 1 Positive Example in the Index
175
Motifs with more than 1 Positive Example in the Index
26
Table 1: Annotation Data
Expression Complexity
Conceptual Complexity
↓
Simple
Simple &
Complex
Only
Complex
Only
Total
Simple
34
73
35
142
Complex
11
25
22
58
Overall
45
98
57
200
Table 2: Numbers of Motif by Motif Expression Complexity
Conceptual Complexity
Expression Complexity
↓
Simple
Complex
Overall
Simple
1,467
689
2,156
Complex
211
303
514
Overall
1,678
992
2,670
Table 3: Total Motif Expressions in Each Category
Conceptual Complexity
Expression Complexity
Total
↓
Simple
Complex
Overall
Motifs
Simple
0.87
0.51
0.71
50
Complex
0.73
0.54
0.72
10
Overall
0.85
0.53
0.72
-
Total Motifs
30
30
-
60
Table 4: Cohen’s Kappa Score for Each Category
Conceptual Complexity
Expression Complexity
↓
Simple
Complex
Overall
Simple
Lex.
0.48
0.16
0.38
Sem.
0.69
0.60
0.66
Both
0.82
0.40
0.69
Complex
Lex.
0.61
0.12
0.32
Sem.
0.58
0.59
0.59
Table 5: Recall of each retrieval stage (lexical and semantic) for each category of motif expression
Conceptual
Expression Complexity
Complexity
↓
Simple
Complex
Overall
Simple
0.39 (0.25 / 0.94 )
0.30 (0.20 / 0.62 )
0.35 (0.23 / 0.78 )
Complex
0.37 (0.29 / 0.51 )
0.37 (0.29 / 0.50 )
0.37 (0.29 / 0.50 )
Overall
0.38 (0.27 / 0.72 )
0.34 (0.25 / 0.56 )
0.36 (0.26 / 0.64 )
Table 6: Overall System Evaluations: F1 (precision / recall)
Conceptual Complexity
Expression Complexity
↓
Simple
Complex
Overall
Simple
22 / 3 / 9
81 / 17 / 10
103 / 20 / 19
Complex
6 / 3 / 2
31 / 7 / 9
37 / 10 / 11
Overall
28 / 6 / 11
112 / 24 / 19
140 / 30 / 30
Table 7: Breakdown into training / validation / testing
Conceptual Complexity
Expression Complexity
Model Type
↓
Simple
Complex
Overall
Simple
text-embedding-4
0.64 (0.71 / 0.58 )
0.55 (0.49 / 0.63 )
0.60 (0.60 / 0.60 )
Embedding
NV-Embed-v2
0.60 (0.67 / 0.54 )
0.55 (0.47 / 0.66 )
0.58 (0.57 / 0.60 )
Embedding
mistral-embed
0.58 (0.44 / 0.81 )
0.34 (0.21 / 0.78 )
0.47 (0.33 / 0.80 )
Embedding
jina-embeddings-v3
0.72 (0.71 / 0.74 )
0.57 (0.46 / 0.73 )
0.65 (0.59 / 0.74 )
Embedding
sentence-t5-base
0.73 (0.66 / 0.83 )
0.57 (0.42 / 0.89 )
0.66 (0.54 / 0.86 )
Embedding
Table 8: Overall System Evaluations: F1 (presion / recall)
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
Motif ID
Motif
+Examples
-Examples
Expression
Conceptual
J0
Acquisition and possession of wisdom
43
258
Simple&Complex
Simple
A630.1.1
Adam created from clay (mud), mud foam (zabad), foam from sea, sea from darkness, darkness from bull, bull from whale, whale from rock, rock from ruby (gem), ruby from water, water from [God’s] Omnipotence (al-Qudrah)
2
192
Simple&Complex
Complex
F1041.15.1
Addiction as an illness. Adverse effects of excessive consumption of commodity or service (e.g., food, drink, drug, or sex, entertainment, etc.)
4
193
Simple&Complex
Complex
K1514.4.1.1
Adulteress refuses to admit husband under pretense that he is a stranger. [Husband forgot password]
1
237
Simple&Complex
Complex
K1966
Alchemist
11
188
Simple&Complex
Simple
A1174.7
Angel of nights and day
1
279
Simple&Complex
Simple
Appendix
Table 9: List of Motifs
Motif ID
Motif
+Examples
-Examples
Expression
Conceptual
D1707.8
Blessed places
45
389
Simple&Complex
Simple
M224
Blind promise of immunity from punishment. Person of authority (king, queen, father, etc.) grants request for safety for culprit before learning nature of offense
2
214
Simple&Complex
Complex
T610.2.4
Boy’s puberty
12
297
Simple&Complex
Simple
T415
Brother-sister incest
3
253
Simple&Complex
Simple
P448
Butcher
40
147
Simple&Complex
Simple
K199.2.1
Buying an item for “Whatever [price] you may say.” Trickster names impossible price (e.g., bushel of fleas of which half are males and half females-or the like)
9
177
Simple&Complex
Complex
Appendix
Table 10: List of Motifs
A2921.1
Eblis: born as one of the fourteen children of Khalit and Malit. He disobeyed his father by refusing to marry one of his seven twin-sisters, and was transformed into worm (which became Eblis)
2
194
Simple&Complex
Complex
T320
Escape from undesired lover
2
190
Simple&Complex
Simple
T33.1
Faithless woman transforms lovers (husbands) to animals (birds) and keeps them as pets
8
188
Simple&Complex
Complex
F969.7
Famine
41
156
Simple&Complex
Simple
P140.0.3
Favor (pardon) won through intercession of person of influence
29
224
Simple&Complex
Complex
L51
Favorite youngest daughter
1
280
Simple&Complex
Simple
Motif ID
Motif
+Examples
-Examples
Expression
Conceptual
Appendix
Table 15
F1041.2
Horripilation. Hair rises on end in extraordinary fashion from joy, anger, or love.
2
194
Simple&Complex
Complex
P414
Hunter
65
104
Simple
Simple
P12
Hunting a madness of kings
14
273
Simple&Complex
Simple
K1874.2.1
Husband driven insane with pseudo-doubles. His private possessions exhibited before him at his workplace, then quickly returned to his home before his arrival (usually via tunnel): he thinks he has seen a double and regrets having suspected his wife
4
228
Simple&Complex
Complex
Motif ID
Motif
+Examples
-Examples
Expression
Conceptual
K1534.1
Husband made to sift dirt. Wife, whose food purchase was replaced with dirt and rocks during her sexual liaison with merchant, claims that she dropped the money on ground and that she brought the dirt home to search for it
6
201
Simple&Complex
Complex
R151
Husband rescues wife
1
298
Simple&Complex
Simple
Appendix
Table 16
D1266
Magic book
5
406
Simple&Complex
Simple
D1272
Magic circle
4
392
Simple&Complex
Simple
D1242.0.1
Magic elixir (nectar)
21
448
Simple&Complex
Simple
D2031
Magic illusion
23
401
Simple&Complex
Simple
D1071
Magic jewel (jewels)
13
324
Simple&Complex
Simple
D1254.2
Magic rod
24
376
Simple&Complex
Simple
D1960
Magic sleep
8
345
Simple&Complex
Simple
Appendix
Table 17
Motif ID
Motif
+Examples
-Examples
Expression
Conceptual
K2139
Poisonous medicine for king: envious man gives king’s barber (doctor, etc.) a supposedly healing substance (actually poison), then he reports to the king that the barber plans to assassinate him with that ‘medicine’
4
188
Simple&Complex
Complex
P5.3
Possessions as indicators of social status
58
250
Simple&Complex
Complex
V59.0.1
Prayers answered especially when gates of sky (heavens) are open
11
185
Simple&Complex
Complex
F679.12.1
Precious stones (diamonds, emeralds, etc.) retrieved from bottom of inaccessible valley with the help of vultures. (Meat thrown from great heights into valley, stones adhere to meat, vultures carry meat along with stones to valley ridge where miners can collect them)
5
177
Simple&Complex
Complex
J1913.6
Price of an ‘inexpensive’ article (service) raised through mutually misunderstood gesture (murmur). Owner thinks buyer is ridiculing him by offering too high a price and makes gestures to that effect, but buyer thinks owner thinks offer is too low and raises his offer-(this happens repeatedly)
8
192
Simple&Complex
Complex
L400
Pride brought low
17
268
Simple&Complex
Simple
Appendix
Table 18
Motif ID
Motif
+Examples
-Examples
Expression
Conceptual
B811.10.1
Sacred she-mule
1
635
Simple&Complex
Simple
B811.7
Sacred wolf
2
352
Simple&Complex
Simple
B71
Sea horse
4
416
Simple&Complex
Simple
B215.5
Serpent language
1
468
Simple&Complex
Simple
P234.0.3.1
Seven daughters
7
358
Simple&Complex
Simple
A874
Seven strata of earth
10
282
Simple&Complex
Simple
Appendix
Table 19
Motif ID
Motif
+Examples
-Examples
Expression
Conceptual
W290.2
The good wife (woman): no divorce, no remarriage, no desertion due to vanity (batar), no disagreement with husband, no quittuing of husband’s home to parent’s due to unhappiness (gadbanah)
10
197
Simple&Complex
Complex
K2151.2
The seemingly dead is abandoned in street and made to look as if leaning against wall: one unsuspecting passer-by after another tries to awaken him and thinks that he caused his death
3
213
Simple&Complex
Complex
K366.1.5
Theft by trained monkey
1
266
Simple&Complex
Simple
B778.5
Thieving bird
7
302
Simple
Simple
P234.0.3.1
Three daughters
5
380
Simple&Complex
Simple
M412
Time of giving curse
3
299
Simple&Complex
Simple
Appendix
Table 20
Motif ID
Motif
+Examples
-Examples
Expression
Conceptual
B731.11.1
White viper
12
373
Simple&Complex
Simple
R152
Wife rescues husband
5
293
Simple&Complex
Simple
T197
Wife’s relatives (father, brother, etc.) force her divorce from husband without her consent
5
190
Simple&Complex
Complex
B3.3.1
Winged viper
2
429
Simple&Complex
Simple
B121.7
Wise tortoise
7
471
Simple&Complex
Simple
D658.3.4
Women (queen) transforms self to bird (animal) in order to copulate with men she had bewitched into birds (animals)
Thematic indexing -- the practice of assigning structured conceptual labels to sections of text -- is essential to scholarly access in large-scale literary and historical editions, yet it remains a largely manual, labour-intensive process. This paper explores the application of machine learning to automatic thematic indexing, using two substantial sub-corpora of the Complete Works of Voltaire as a test case: the Essai sur les mœurs et l'esprit des nations and the Questions sur l'Encyclopédie. The task is framed as a multi-label classification problem, in which a model must assign the set of index entries that a professional indexer would apply to a given page of text. We compare a range of approaches -- from encoder-based models with classification heads to generative large language models (LLMs) fine-tuned via Low-Rank Adaptation (LoRA) -- spanning model sizes from approximately 3 to 120 billion parameters. Our best-performing model, from the Mistral family in a 4-bit quantised configuration, achieves F1 scores of up to 0.67; we argue that these figures represent lower bounds, given the inherent subjectivity of professional indexing and the frequency with which model predictions prove semantically valid despite diverging from the print index. We further evaluate cross-corpus generalisation and conduct a detailed qualitative analysis of model behaviour on literary and rhetorical features of the source texts that prove particularly resistant to automated treatment. Our findings have implications for the broader challenge of providing structured thematic access to large-scale literary and historical corpora.
Deep narrative understanding requires distinguishing what happens from how it is presented, moving beyond the chronological fabula to decode the sjuzet, the discursive organization through which themes are staged. We study this through the recurrence of literary motifs (blood in Macbeth, for instance), where symbolic significance emerges not from local cues, but through repetition-with-variation across the whole work. We operationalize this setting as Computational Motif Discovery, a transductive task that predicts missing line-motif links using the full narrative structure of a play. We propose Critic's Eye, which models the work as a heterogeneous Narrative Topology Graph and performs discriminative inference over global structural evidence. Critic's Eye achieves 84.8% Hit@5 on our benchmark, nearly quadrupling state-of-the-art proprietary foundation models (Gemini-3-pro-preview, ~22.6%). Our analysis reveals that despite massive scaling, sequence-based models hit a "semantic ceiling", struggling to resolve dispersed dependencies. These findings suggest that explicit structural priors are a far more effective inductive bias than parameter scaling for decoding the complex architecture of long-form literature.
Xinyu Sun, Zhangyue Yin, Xinyi Ju +1
College of Computer Science and Artificial Intelligence, Fudan University · Shanghai Key Laboratory of Intelligent Information Processing
AraGenre is a shared task on hierarchical, definition-guided Arabic genre classification, motivated by the limited availability of annotated data in Arabic and other low-resource languages. Systems assign each Arabic text segment both a broad communicative genre and a fine-grained specific genre. The released training and development sets contain limited, primarily synthetic and controlled examples, whereas the hidden final benchmark contains noisier naturally occurring text spanning Modern Standard Arabic, Classical Arabic, and multiple dialects. Participants received natural-language definitions for 74 previously unseen specific genres, creating a zero-shot label generalisation setting in which systems had to infer class semantics rather than memorise fixed label-feature associations. The task attracted 46 registrations and 373 submissions, with 17 teams completing the final evaluation. Thakaa ranked first with a Hierarchical Macro F1 of 0.7352, followed by HoangPhong (HP) with 0.7169 and NAMAA with 0.7013. The results show strong broad-genre recognition but a substantial gap in fine-grained classification under linguistic and domain variation.
Mo El-Haj, Saad Ezzini, Shadi Abudalfa +3
VinUniversity, Vietnam · Lancaster University, UK · King Fahd University of Petroleum and Minerals, Saudi Arabia +3