Rearranging MLK Speeches With Python and MS Paint

Martin Luther King, Jr. at his "I Have a Dream" speech in front of the Lincoln Memorial in Washington, DC

Martin Luther King, Jr. at his “I Have a Dream” speech in front of the Lincoln Memorial in Washington, DC

EDITED TO ADD: I’ve shared all the code and files that I used for this project up on GitHub here.

Around 75 minutes into Armin van Buuren’s ASOT: 700 set at Ultra, he played a track that mixed in a clip of Martin Luther King Jr. speaking at his Drum Major Instinct sermon, which he gave in February of 1968. Here is the portion of the sermon that Armin cued:

“And I would submit to you this morning that what is wrong in the world today is that the nations of the world are engaged in a bitter, colossal contest for supremacy. And if something doesn’t happen to stop this trend, I’m sorely afraid that we won’t be here to talk about Jesus Christ and about God and about brotherhood too many more years. If somebody doesn’t bring an end to this suicidal thrust that we see in the world today, none of us are going to be around, because somebody’s going to make the mistake through our senseless blunderings of dropping a nuclear bomb somewhere. And then another one is going to drop. And don’t let anybody fool you, this can happen within a matter of seconds. They have twenty-megaton bombs in Russia right now that can destroy a city as big as New York in three seconds, with everybody wiped away, and every building. And we can do the same thing to Russia and China. But this is why we are drifting. And we are drifting there because nations are caught up with the drum major instinct. “I must be first.” “I must be supreme.” “Our nation must rule the world.””

I don’t think anybody would disagree that this is strong and somewhat inflammatory language from Dr. King. So why did Armin van Buuren play this during his Ultra set? For a guy who has been accused of selling out his music for popularity and stardom, why take such a risk by playing something political that might induce controversy? To be honest with you, this was the most shamelessly direct political message that I’ve ever seen or heard at an electronic music event.

So I did some research.

Obviously I am familiar with Dr. King and his importance to the Civil Rights Movement; he has a national holiday named for him, after all, and we learned about him in school. But I didn’t realize that, towards the end of his life and after focusing much of his efforts towards domestic civil rights issues, he ventured into anti-Vietnam War rhetoric.

I also didn’t realize how much FBI surveillance had been placed on MLK. Apparently, FBI director J. Edgar Hoover was so paranoid that MLK had “communist connections” that he utilized almost every resource at his disposal in an effort to neutralize the perceived threat. This included a scathing, threatening, and inflammatory anonymous letter to MLK hinting him towards suicide. It’s disturbing to think that people within our own government could be capable of this, but it’s a part of our history that we should own and acknowledge.

After reading through some of MLK’s speeches, I started to look more closely at his language. I’m a pretty big word nerd, and I think that looking at the patterns in others’ speaking and writing can tell you a lot about their intentions and the perspective from which they’re coming from. I wanted to get a better idea of which words MLK used most often, and how he used them in order to carefully craft and convey his message, so I fired up Python and imported the NLTK library.

NLTK has a neat function called “concordance” that lets you search for instances of how a word is used within a text. Here is an example output from MLK’s “I Have a Dream” speech when we use the command:

An example of concordance for the word 'dream'.

An example of concordance for the word ‘dream’.

I started playing around with the speeches, looking at the most common words and the context in which they were used. Then I tried putting collections of these outputs (from the same speech) together in MS Paint to show a perspective of each speech through the lens of related concordance outputs. This seemed like a neat art project for a Friday afternoon, so I looked at three of MLK’s speeches and put together a collage for each of them.

These are the three speeches I explored:

1. I Have a Dream from August, 1963 at the steps of the Lincoln Memorial in Washington, DC.

 "I Have a Dream" Concordance Collage

“I Have a Dream” Concordance Collage

This is by far MLK’s most famous speech and was a critical moment in the March on Washington that encouraged Congress to pass civil rights legislation. This speech is widely considered to be one of the greatest works of oratory in history.

After tokenizing the speech text into 1684 tokens, removing the stopwords narrows it down to 828 tokens. This is probably close to an average-sized speech (the speech was roughly 17 minutes long). Here are the twenty most common non-stopwords in the speech:

Most frequent non-stopword tokens from "I Have a Dream"

2. Beyond Vietnam: A Time to Break Silence from April 4, 1967 in New York.

"A Time to Break Silence" Concordance Collage

“A Time to Break Silence” Concordance Collage

This was MLK’s first public stance against the War in Vietnam, and it did not make him a very popular man. Many people who supported MLK’s work in the civil rights movement couldn’t comprehend why he had to suddenly speak with dissent towards the war. Political allies abandoned him for his lack of patriotism and support for his nation. The media questioned and criticized his motives, and there were fears that his rhetoric was being influenced by communists.

Here is an excerpt from this speech where MLK addresses these concerns:

“Over the past two years, as I have moved to break the betrayal of my own silences and to speak from the burnings of my own heart, as I have called for radical departures from the destruction of Vietnam, many persons have questioned me about the wisdom of my path. At the heart of their concerns this query has often loomed large and loud: “Why are you speaking about the war, Dr. King?” “Why are you joining the voices of dissent?” “Peace and civil rights don’t mix,” they say. “Aren’t you hurting the cause of your people,” they ask? And when I hear them, though I often understand the source of their concern, I am nevertheless greatly saddened, for such questions mean that the inquirers have not really known me, my commitment or my calling. Indeed, their questions suggest that they do not know the world in which they live.”

Dr. King seems to be speaking about his objection to war, in principle. He goes on to make the point that the incentives in waging the war in Vietnam do not align with his vision of peace and understanding. This is a neat speech to read through and it gives a new light to his legacy: MLK wasn’t just a civil rights leader in a time of racial tension, but an activist for peace around the world—and he wasn’t afraid to criticize his own government when he thought it was acting in the wrong.

This speech was split into 6779 tokens, with 3295 non-stopwords, and it was the longest of the three MLK speeches I looked at. Here are the most frequently appearing words:


3. Drum Major Instinct Sermon from February 4, 1968 in Atlanta.


The clip I referenced earlier was taken from this sermon. This was the last sermon (not speech) that MLK gave before he was assassinated two months later. MLK talks about leadership how all people have a certain “drum major instinct” of attracting attention to themselves as superior, as a drum major does in a marching band. He goes on to explain that conflict between nations and racism all stem from this human trait, and that instead, we need more people to harness it for peace and understanding.

This sermon broke down into 5150 tokens, including 2293 non-stopwords. Here are the top 20 words:



I wish I had some Photoshop or design skills to work some more color into these collages. For now they will have to remain as bare-bones MS Paint images in the “conceptual art” department of data visualizations.

This was a neat project that got me reading about modern American history. MLK and the Civil Rights Movement were at the front and center of 1960s America, with a direct impact on national legislation and the behavior of government intelligence agencies. He had a message that appeals to everybody: people need to work together instead of against each other, and that starts by stopping violence. And I think there’s always been a lot of that feeling in trance music, which is why Armin decided to play MLK at Ultra.

One thought on “Rearranging MLK Speeches With Python and MS Paint

  1. […] did a Natural Language Processing art project on MLK speeches the other day, and while I was doing it I read through some of MLK’s speeches to […]

Leave a Reply

Your email address will not be published. Required fields are marked *