Song Lyrics Graph

Tags GraphsProgrammingPython

Song Lyrics Graph is a Python script designed to convert a text file of song lyrics into a GraphML directed graph showing the relationship between song lyrics.

The generated graph has a node for each unique word in the lyrics, with size proportional to the frequency of that word within the lyrics. Word nodes are connected by directed edges (arrows) indicating which words directly follow which other words.

Song Lyrics Graph of Shop Vac by Jonathan Coulton
Image Credit: Created by Paul Bogard using lyrics from Shop Vac by Jonathan Coulton (CC BY-NC 3.0)

This works especially well with songs with repetitive phrases. For an extreme example, here’s 99 Bottles of Beer:

Song Lyrics Graph of 99 Bottles of Beer

Tools

Graph Format
GraphML Generator
Graph Editor