Dr. Seuss + Markov Chains

Objective: Generate new stories and poems based on a Markov chain trained with Dr. Seuss

Using Daniel Shiffman’s example code on Markov chains by words, I used Dr. Seuss’ book Oh, the Places You’ll Go! as my input. Dr. Seuss is one of my favorite childhood authors so I was curious to explore what new outputs I could generate from his rhythmic style. Here are my favorite results created using the Markov algorithm with 2 as the n-gram length and 2000 as the max length of characters generated:

Do you dare to go there

and footsy as you.
though your enemies prowl.
that Bang-ups
in a Lurch.
a frightening creek,
Do you dare to go there."
Simple it's not, I'm afraid that some times
or a bus to come, or the waiting around for a Yes or No
with many strange birds as you go.
for a mind-maker-upper to make up his mind.
You won't lag behind, because you'll have the speed.
And then things start to happen,
in the wide open air.

Wherever you go, you will go

Wherever you go, you will go
About some you will find,
or a Better Break
is not easily done.
You'll be left in a Slump,
once more you'll ride high!
and face up to your problems
and frequently do
You'll look up and down streets. Look 'em over with care.
I'm sorry to say so
as you already know.

and remember that Life’s

as you go.
and footsy as you.
Just go right along.
and remember that Life's
and remember that Life's
You will come to a place where the streets are not marked.
That's not for you!
and Hang-ups
You'll be on y our way up!
You won't lag behind, because you'll have the speed.
Today is your day.

I love how deep and philosophical these feel! They have a flow to them and a cryptic meaning. The first poem has a theme of fear and facing your fears no matter what “strange birds” you see as you go by. The second poem has a motif of a journey. It might be long and hard, with many up and downs. Ultimately, it is up to you the path you take, but you know what is best for you. The third poem has a motif of life. Life is unpredictable with unmarked streets. Live in the present and try your best so “you won’t lag behind.”

Overall, I think the results are quite beautiful. I am curious to hear how other people interpret each poem and the meaning it holds. This exercise, in my opinion, reveals more about the author than the algorithm. Despite distorting his word order, Dr. Seuss’ creative genius and poetic style shines through.

PS. I had originally tried to use one of my favorite Spanish artist lyrics, Juan Luis Guerra, as the input text file for this algorithm. However, it did not produce successful results no matter how I changed the parameters. I am not sure if this had to with the fact that the text was in Spanish or the way the song lyrics were formatted, but the output would just select a random phrase from txt file rather than generate new lyrics.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s