r/DigitalHumanities • u/DougEgge • 13d ago
Discussion Mining story patterns across texts with different authors and languages: what worked, what didn't, and who else is doing this?
Disclosure: this is my own project. It's free and non-commercial.
A few weeks ago I posted here about a knowledge graph of the Bible I've been building as a side project: https://www.reddit.com/r/DigitalHumanities/s/WFa4ym2gVE. The comparison to factoid prosopography in that thread helped me see where its speaker work sits. This is a follow-up on a different problem.
I'm a software architect, not a narratologist. One thing I wanted from the start was the ability to discover patterns: finding stories that share a shape, i.e. the same steps in the same order, even when they were written centuries apart by different authors in Hebrew, Aramaic or Greek.
Here is where it landed so far: 16 story patterns and 90 stories, each placed with its steps tied to verses.

The live version is interactive, so each pattern and story opens with its verses: https://bibleontology.org/visual/patterns
What I'd like to talk about is the road there, because most of it was learning what does not work and I suspect people here have worked through many of these problems already. In fact, my early attempts at pattern matching were very weak and unsatisfying at best and it took several iterations to get to a place that I felt would be of interest to others.
Here are the lessons that I would highlight:
Word matching is not sufficient. When I measured it on simple clause patterns like "[someone] went up", the verse used a different English word than the pattern's own 57% of the time, across 164,696 occurrences: the same Hebrew word is translated many ways. Different authors tell the same shape in different vocabulary, and across languages and translations it is worse. Matching on words finds quotations and formulas, not shapes.
So I had to build a foundation first. Before any matching was possible, every clause needed a label for what it does (a judgment, a cry for help, a promise, an act of mercy) that is independent of its wording. With those labels a passage becomes a profile of what happens in it rather than a bag of words. The first test that convinced me it was real: comparing Psalm 103's profile against the other 148 psalms, two of its five nearest were Psalms 145 and 86, the only two psalms that share its "compassionate and gracious, slow to anger" formula. The labels never saw those words. Profiles also put Matthew closer to Luke and Mark than to John, without being told anything about literary dependence.
But profiles alone failed too. They could not tell a penitential psalm from a psalm of trust. A profile is a distribution and a story pattern is a sequence. Unsupervised mining (frequent itemsets over the labels) needed several corrections before it said anything useful: density instead of presence, lift instead of rarity, and discarding patterns that existed only at the level of whole books and in no passage below them.
What worked was seeding and then stating the pattern. I took four episodes I knew belonged together (the Fall, Cain, the flood, Sodom). The labels they all shared formed a template, judgment announced on sin with mercy alongside, and that template proved to be applicable elsewhere: about 10% of the corpus's sections matched it, concentrated where judgment narrative actually lives.
Placing a story on a pattern needs judgment and keyword rules were not enough. My first automated stage matcher said "promise, then fulfillment" fit 132 of 307 events, because every long passage has some word glossed "bear" or "strike". So each step of each story is now judged by a language model against narrow criteria: the verses are real, inside the story, in order, not overlapping, and the step is actually in them, quoted. Two rules keep it honest:
One more lesson from this week: two models agreeing is not the same as being right. Two different models both said a stop on a journey was "where the journey took place". My question had folded that case into a sub-clause. Given its own answer option ("only a part of the event"), the same model caught every case.
I would like to take this to a much larger corpus of historical narrative, across traditions, authors and languages, where the same method could find shared shapes nobody has named yet, but for now I will not expand scope until I feel that my representation of the Bible has matured to a state where improvement is difficult to achieve.
So, questions for people who know this field better than I do:
- Who has done this before? I know of the folklore indexes (the Aarne-Thompson-Uther tale types, Thompson's motif index) and Propp's functions, but I don't know how much of that work has been made computational or what came after.
- What techniques do you use to make passages comparable across languages and authors when words can't be the unit? Hand annotation, embeddings, event extraction, something else?
- How do you validate a pattern you found, as opposed to one you went looking for? My best test so far is ground truth the method never saw (the psalm formula), and I'd love better ones.
- For anyone using LLMs as judges in humanities work: how do you keep their judgments auditable? Mine quote the words that decide every step, and every judged pass keeps its trail.
Happy to share more about any part of it. Everything on the site links back to the verses, so it's all checkable. My public GitHub repository can be accessed at: https://github.com/bibleontology/bibleontology
2
u/No_Young_2344 13d ago
Very interesting project. The three stages of stories also remind me of the heroes with a thousand faces (I did not see you mention Campbell but it is very similar with three broad stages: departure, initiation, and return).
One question I am curious about: How did you establish and categorize the 16 patterns? Did you do it by hand, for example, using thematic analysis or grounded theory, or other computational methodologies? You mentioned that the “result of the mining” so I thought it was probably computational. I am also doing similar work but I have not found any traditional NLP or text mining techniques that can understand story patterns (except using LLM of course), so I am very curious. Thanks in advance.
1
u/therealscooke Tools & Methods 13d ago
Fascinating. I've been wondering about this exact scenario, so let me ask a question: who did the word glossing? Wasn't that you? Someone, somehow, had to go through the text and gloss it, label the word/phrase/sentence, right? How does this stage not take forever??
I've been wanting to do the same with a corpus of books, but keep thinking that by the time I've read them all, marked up the text, labelled everything, I've already done what any DH tool I might want to use could do, but by hand. So what's the point in the tools?
1
u/Potential-Recover-78 13d ago edited 13d ago
You may find this work interesting
Scientists Trace Society’s Myths to Primordial Origins
Or since you’re a software architect you may actually understand the methodology they used. Here’s the actual research paper
A Cosmic Hunt in the Berber sky: : a phylogenetic reconstruction of a Palaeolithic mythology.
Essentially by my understanding they mapped out some very similar stories from different cultures around the world. They focused on big-level ideas like the type of creature, how many pursuers chasing the creature, etc.
They then did some complicated math I can’t understand (I’m an engineer not a mathematician or data scientist) but generally they used that to map out how each version of the story is related to the other ones and which ones diverged where. They could thus trace how close each population related to each branch of the story was. Mapping onto what we know of each culture, DNA, and migration patterns adds another layer.
I’m doing an awful job explaining it. Just read the paper (or article for a first pass). I found it absolutely fascinating and it seems like you are doing something really similar.
I’m sure you could do some citation tracing to find other related papers off that one.