All work

Bachelor's thesis 2024

Emotional Arcs in Books

Emotional Arcs in Books is my bachelor's thesis on how emotions change over the course of a book. A model rates every sentence of 914 books, and the arcs from beginning to end are smoothed, compared and sorted into groups.

The opening sentences of Peter Pan appear, each with three bars for valence, arousal and dominance. In a cube with these three axes, a cloud of points and a line from “Beginning” to “End” appear; these become three curves across the whole book. Curves of four more novels follow, each labelled with its arc: The Picture of Dorian Gray (rise and fall), The Secret Garden (rise), Frankenstein (fall, rise, fall) and Pride and Prejudice (fall and rise). Among many more arcs, Peter Pan and War and Peace are picked out as the closest pair and linked to each other; then all of them are sorted into a tree diagram.
Made for
HTWK Leipzig
Availability
I can share the bachelor's thesis on request.

An AI model gives every sentence of a book three scores: how positive, how stirred up and how in control it is. It comes from the MANGAN research project by BUCHFUNK and the Leipzig University Computing Centre. From these, each book gets an arc from beginning to end.

That's how I studied and compared 914 books for my bachelor's thesis at HTWK Leipzig. Books with similar arcs can be sorted into groups. But these groups hardly match the plot patterns known from literary studies.

What it is about

In literary studies, there is an idea that many stories come down to a few basic patterns: rise and fall, fall and rise, the voyage and return. In my bachelor's thesis at HTWK Leipzig, I looked at whether such patterns also show in a book's emotions, measured sentence by sentence. And whether books with similar arcs can be sorted into groups automatically, for example to find similar books later.

How the arcs are made

The basis is 914 English-language works of fiction from Project Gutenberg, with about 3,700 sentences each on average. A transformer model gives every sentence three values: valence, arousal and dominance, that is, how positive, how stirred up and how in control it reads. The model came from the MANGAN research project by BUCHFUNK and the Leipzig University Computing Centre. The values of single sentences fluctuate a lot. Only when smoothed and brought to the same length do they form an arc that can be compared with others. I tried several kinds of smoothing and clustering for this. Hierarchical clustering that compares the shape of the arcs with dynamic time warping worked best. As a cross-check, a language model (GPT-4o) assigned each book a known plot pattern from its title and author.

What it showed

Books can be grouped by their emotional arcs, for example those with a similar beginning and a similar end. But the groups do not match the known plot patterns, and the results of a widely cited study by Reagan et al., which had found such patterns in sentiment, could not be confirmed. Part of the reason lies in the material itself: emotions in a book change from sentence to sentence, and every smoothing takes some of that away. Taking the context of the plot into account would be more promising.