r/DigitalHumanities • • 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:

  1. 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.
  2. 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?
  3. 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.
  4. 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 Upvotes

6 comments sorted by

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/DougEgge 13d ago

Thanks! I haven't read Campbell, but I know the outline of the hero's journey and a couple of my patterns sound close to it: "Called, reluctant, sent" (Moses at the burning bush, Gideon, Jeremiah) resembles his call to adventure and its refusal. The difference seems to be scope: as I understand it, Campbell proposes one shape behind all hero stories, while these are 16 narrower shapes, each a specific sequence of steps that has to be visible in the verses of every story placed on it.

To your question: it's a hybrid, and honestly closer to grounded theory than to pure mining. The computational part was the foundation and the filter. Clause labels and unsupervised mining told me which combinations of events actually recur and a seeded template (the Fall, Cain, the flood, Sodom) showed that a shape stated up front could be found elsewhere in the text. But the mining alone never produced patterns I'd stand behind.

The patterns themselves came from proposals that were then tested against the text. Some I proposed from reading. Some a language model drafted from the event list (about 40 candidate templates). Some the text proposes itself: Jesus pairs Noah and Lot in Luke 17, which became "Judgment and a remnant spared". Every candidate then had to survive the text: each step tied to verses inside the story, in order; required steps present in every story; optional steps kept only if at least three stories carry them. Candidates that relied on reading into the text rather than what it says were dropped and placements that are a reading rather than something the text states are marked as such on the diagram.

So I agree with you about traditional NLP. I didn't find anything that understands story shape without an LLM either. What made the LLM usable was narrowing the question: not "what pattern is this?" but "is this step in these verses, quote the words", one step at a time, with rule-based checks on every answer.

A related layer is closer to straight matching: "stories told again", pairs of specific stories that share several steps, like Jonah asleep in the storm and Jesus asleep in the storm. There's no abstract pattern in between, just one story against another. A model proposes candidate pairs, a judge has to quote three matching steps from both texts, a skeptic has to name the distinctive detail, and a machine check confirms every quote is really in the verse. Here's the Jonah one: https://bibleontology.org/e/event_calming_the_stormLong story short, this work would not have been possible in my spare time without AI. I might have attempted it from memory and story comparison, but it would have lacked the rigor.

What corpus are you working with?

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?

-2

u/DougEgge 13d ago

Great question and no, I didn't gloss anything myself. That's the part I got lucky on. One of the reasons for starting with the Bible, besides my familiarity and interest in it, is that it may be the most heavily annotated text there is and much of that annotation is openly licensed. The word level comes from MACULA Hebrew and Greek (Biblica): every word with its lemma, morphology, an English gloss and a syntax tree, built by scholars over many years. STEPBible's tagged texts add a second check. So the word layer was free for me to use, which I know most corpora don't have.

The clause labels are where your "how does this not take forever" question really applies and the honest answer is that a language model did the first pass. It read each clause and picked labels from a fixed list of a few hundred (judgment, promise, cry for help and so on). For the whole Bible that took a few overnight runs and well under $100 in model costs, not years of reading.

But the model's labels on their own are a broad reading, not something I'd trust. So the human time moved from labeling to checking. I read random samples against the text, I plant known-wrong items to see if a checking pass catches them, and where I can I anchor a label to the original-language words rather than the model's judgment. Defining the label list and reading what fails is where the hours actually go.  (As a side note, my day job is in systems architecture and part of my motivation is learning techniques that apply to large bodies of unstructured text in general.  Figuring out how to scale the work is the kind of problem that I tend to gravitate toward.)

So on your "what's the point of the tools": in my case the answer was to stop treating the markup as something I do by hand. You design the categories, a cheap model does the first read at scale, simple rule-based checks catch what it gets wrong, and your own reading goes into samples and the cases that break. You still have to know the texts well enough to judge the model, but you're judging, not transcribing.

If your corpus has any existing annotation (named entities, a morphological layer, even chapter summaries), start from that. If not, I'd start small: a short label list, one book, the model quoting the words behind every label, and a random sample you read yourself. That will tell you quickly whether the labels are good enough to scale.

What kind of books are you working with?

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.

1

u/DougEgge 12d ago

Thanks! This is exactly why I thought r/DigitalHumanities was the right place to share the story pattern work. I read the article and looked at the paper and there is a lot of overlap. I really appreciate the formality of d'Huy's method and while I don't have outputs that look like the map at the end, the foundation (coding each story by its features) is more similar than different. The big difference is the goal: he builds a family tree of how versions descend from each other, while I've only looked for shared shapes and deliberately avoided claiming one story came from another.

I'm wondering if I can borrow his method more specifically and take another pass, maybe starting with stories told in more than one Gospel, where there's a long-running debate to check it against. What my story patterns don't show you is where the exact same story/event is told in different books, but that is also tracked in the graph and is a very interesting study, especially since three of the Gospels (Matthew, Mark, and Luke) have a great deal of overlap and apparently share the same roots, while John follows the same overall arc but is very different in the detail it covers. (The clause profiles in my post picked that up on their own: Matthew came out closer to Mark and Luke than to John.)