The Tree of Babel
Machine Learning with narrative graphs
Youjin Chung
Interactive Narrative
choices + branches
Interactive Narrative Structure

= design pattern

= flow chart

= graph
Why ML?
…Checking 14M possibilities
1. ML implementation

to interactive narrative structure 

as graphs
2. Provide a web app

for graph generation 

for writers/game makers
Goal
1. Graph Embeddings



2. Classification



3. Generation
Flow
1. Graph embeddings
Graph embeddings
↔
[-0.13391995429992676,

-0.03493423014879227,
0.005581242498010397,

-0.05787748470902443,]
Transverse Reading Gallery
~740 graphs from gamebooks
Raw data to graph embeddings
Graph representation
{“nodes": [[1], [2], [18], … ], 

"edge_index": [[1, 2], [2, 18], [2, 12], … ]}
Data formatting
{-0.13786359131336212,

-0.028311695903539658,

0.017919035628437996, 

… ,

-0.05109648406505585}
Graph embeddings
2. Classification
Classification
Clustering Algorithms Self Classification
[Basic, 

Broad,

Long,

Merged,

Clustered,

Cycle]

using graph properties
Basic
basic directed graphs
tree shapes
clean + straightforward
Broad
Larger widths
Short playthrough
Strong replayability
Linear
The linearity of narrative structure
Easy control of plot
engaging storytelling through long playtime
Merged
The graphs merge into certain points.
important events in a story
modular structure
detailed choices in a single situation
organized by geography.
Fragmentary, episodic.
Clustered
Cyclic
loop back
unlock new status while looping
time loops / geographic travel
3. Generation
Autoencoder
Visualization
https://treebabel.herokuapp.com/
What’s next?
Labeling nodes with sentences: 



similarity(node vector, sentence vector)
Train Graph CNN with my own categories.
Takeaways
ML implementation for narrative graphs
Understanding of Graph Theory, Vector Embeddings, 

ML models and implementation
Refining and Formatting Custom Data
Special Thanks: 

Allison Parrish, Gene Kogan, Dan Shiffman, Jeremy Douglass and Dongphil Yoo

The Tree of Babel