AI in Literature: Mapping Emotions and Character Networks
This article explores how computational narratology researchers utilize artificial intelligence to analyze and quantify literature. By leveraging natural language processing (NLP), sentiment analysis, and machine learning algorithms, scholars can map the emotional valence arcs of stories and construct complex character interaction networks. These technologies transform text into measurable data, revealing universal storytelling patterns, tracking shifting emotional tones, and visualizing the social structures that drive narratives across massive literary databases.
Understanding Computational Narratology
Computational narratology merges literary theory with computer science. Instead of reading a single book closely, researchers use AI to perform "distant reading," analyzing thousands of texts simultaneously. AI models break down unstructured text into quantifiable data points, focusing primarily on two elements: how a story makes the reader feel over time (emotional valence) and how characters relate to one another (interaction networks).
Mapping Emotional Valence Arcs
An emotional valence arc—often called a plot arc or sentiment arc—tracks the emotional highs and lows of a narrative from beginning to end. AI maps these arcs through a systematic process:
- Text Segmentation: The AI divides a book into smaller, sequential chunks, such as individual sentences, paragraphs, or fixed-word windows.
- Sentiment Scoring: Using NLP techniques, the AI evaluates the words within each segment. Early methods relied on sentiment lexicons, where words had pre-assigned emotional scores (e.g., "triumph" is positive, "despair" is negative). Modern researchers use transformer-based language models, like BERT, which understand context, irony, and complex syntax to assign a precise emotional valence score to each passage.
- Time-Series Smoothing: The AI plots these scores sequentially on a graph, with time (narrative progression) on the horizontal axis and emotional valence on the vertical axis. Mathematical smoothing techniques are applied to filter out minor fluctuations, revealing the overarching emotional shape of the story.
Through this method, researchers have discovered that most fiction falls into a limited number of universal emotional shapes, such as the "Rags to Riches" (a steady emotional rise) or the "Man in a Hole" (a fall followed by a recovery).
Constructing Character Interaction Networks
To understand the social dynamics of a novel, researchers use AI to build character interaction networks, turning a cast of characters into a mathematical graph of nodes (characters) and edges (interactions).
- Named Entity Recognition (NER): First, the AI scans the text to identify all mentions of people. Advanced NER models distinguish between characters and other capitalized words.
- Coreference Resolution: Characters are often referred to by different names, titles, or pronouns (e.g., "Elizabeth," "Miss Bennet," "she"). AI uses coreference resolution algorithms to link all these variations to a single character entity.
- Defining Interactions: Once characters are identified, the AI maps their interactions. The simplest method is co-occurrence: if two characters appear within the same sentence or paragraph, the AI draws a connection (edge) between them. More advanced dependency parsing models analyze the verbs connecting the characters to determine who is acting upon whom, and whether the interaction is hostile, friendly, or neutral.
- Network Analysis: The resulting data is fed into graph theory algorithms. Researchers can then mathematically determine the true protagonist (the node with the highest centrality), identify isolated subplots (clusters of nodes), and track how social communities fracture or unite as the story progresses.
Synthesizing Emotions and Networks
The cutting edge of computational narratology involves combining emotional arcs with character networks. By layering sentiment analysis onto the edges of a character network, AI can track how the emotional relationship between two specific characters evolves over time. Instead of just knowing that two characters speak frequently, the AI can map the exact moment an alliance turns into a rivalry based on the shifting emotional valence of their shared scenes.
By translating words into numbers and graphs, artificial intelligence allows researchers to test literary theories at an unprecedented scale, uncovering the hidden mathematical architectures that make human storytelling universally compelling.