back

Any Iliad, This Iliad -- My Machine Bard

Do you know the Iliad?

How about this one?

Machine Bard uses a Python script, along with my own translation of Homer's "Iliad" and a fair bit of improvisation, to continually rewrite the first twenty lines of the ancient ballad. Here is everything in action.

Details

If you're familiar with the "Western Canon", odds are you've heard the story of the fall of Troy. You might be familiar with Achilles, the greatest of Greek warriors, and the Trojan Horse, and the judgement of Paris. If you know a little more you'll probably recognize the less-discussed characters, like Nestor and Polydamas and Teucer. It's a story that's been circulating more or less in its current form since around 450 BC, so people have had plenty of time to get acquainted.

Only, this isn't the /whole/ story. The story we've had passed down to us has a story of its own (it was commissioned by an Athenian ruler), and in fact it's only one of the myriad forms the Iliad has taken throughout history. In the tradition of oral poetry, the Iliad was sung over and over by traveling bards, and though the bones of the story stayed mostly the same each individual telling was different. We can see the remnants of this in some of the textual variations we have (link to papyrus fragments).

I'm enamored with this idea of fluidity and ambiguity: of the individual, of a culture, of a story. So I built my own bard, to tell a different story each time. I've always felt that wherever there is data there's a story, and converting that data into something meaningful is one of the most valuable endeavors a person can undertake (and that this is the point of art, maybe??)

Here's how it works: we started by scraping the text of the top 25 books on Project Gutenberg. We also selected ten characters from the Iliad, five Greeks and five Trojans, and assigned each character three different words that were meant to be somewhat representative of their personality and/or role in the story. Using Python, we built a script that compiles a JSON file of all number of times every keyword appears in each book, and scaled the word occurrences so that they would be in roughly the same range. Then, for each character, we assign them one of the twenty five books. We add the word occurrences for each of the three words together to get a total score. This score is divided by the total score of all characters to get the "level of influence" for each character in that particular story.

example of words

The story itself is my own translation of the first twenty lines of the Iliad with certain sections added and removed. For each of these changed sections there are ten possible choices we can use to fill them in, one for each character. We use a JS script to randomly select one of the characters with a probability based on their influence score from before, and in that way we populate the story. Thus, each time the page is refreshed each character gets a new book, a new score, and a new story is written.

example of story insertions

Books used:
A Tale of Two Cities
Adventures of Huckleberry Finn
Alice's Adventures in Wonderland
Dracula
Emma
Fox Tales
Frankenstein
Great Expectations
Grimm's Fairy Tales
Heart of Darkness
Metamorphosis
Moby Dick
Pride and Prejudice
The Adventures of Sherlock Holmes
The Adventures of Tom Sawyer
The Brothers Karamazov
The Iliad (ironically)
The Importance of Being Earnest
The Picture of Dorian Gray
The Prince
The Romance of Lust
The Strange Case of Dr. Jekyll and Mr. Hyde
The Yellow Wallpaper
Treasure Island
Ulysses
War and Peace

Constructed with the help of my oft-times collaborator, Ben Tidswell.