Political Text Processing

»

«

Advised by Brian Kernighan

Jul 24, 2008

In the summer of 2008, I began to wonder what types of imagery could be produced by examining the message of political candidates over time. Would one candidate abruptly change message in response to the other? Were these messages uniform and consistent or wildly fluctuating given the political considerations of the daily campaign trial?

In order to resolve these questions, I generated a python script that automatically updates a small database for both Mccain and Obama speeches as found on the website of each candidate respectively. Once I had this information I was able to generate a number of different graphs. The first visualization in which I was interested was a view of the relative importance of terms across time for any given candidate as determined by the frequency of those terms. I developed a program that accepted as arguments the terms one wished to examine and generated a file that showed, at every interval of the campaign, the frequency of that word's use in that week as compared to its baseline frequency for the entire campaign.

The result, shown at right, rapidly demonstrates some of the largest differences between the two campaigns in terms of message. In comparison with Obama, Mccain places a great deal more emphasis on the words Trust and Freedom. Obama, on the other hand seems to favor (rather predictably) Change and Hope. However, the aspect of the above image that is most interesting is the huge switch by Mccain to espousing the term "Hope" following the end of the democratic primary. In what is likely to become a trend, Mccain's message moves quickly to match that of the senator from Illonois.

To a lesser degree and during the same time-period, Obama does take on Mccain's message of Freedom. This file, and its Democratic counterpart can be found under the related files section of this post to the right.

I also made several other visualizations to try and take a look at the other dimensions of the political race.

Related files:
5

Related links:
0


Mccain Arc Diagram
Demonstrates the appearance and span of terms in Mccain speeches

Obama Arc Diagram
Demonstrates the appearance and span of terms in Obama Speeches

Mccain Ribbon Diagram
Demonstrates relative importance of terms over the span of Mccain Primary

Obama Ribbon Diagram
Demonstrates relative importance of terms over the span of the Obama primary

Top 100 Words
The top 100 words for each candidate and how those words stack up against their opponent