Politics and Inspiration

Posted by Hunter Sapienza on December 21, 2019

2019 was quite the year, as is evident by the flood of memes, opinions, and reflections throughout my social media channels. Whether it’s the government, our ever-dividing political lines, crises at our borders, in our schools and our homes, the looming demise of our planet, and, ultimately, the constant influx of this negativity from Facebook, Instagram, the news, and every other source of media. That’s not to say nothing positive has emerged from this sense of chaos - whether it’s the viral memes of Nancy Pelosi and baby Yoda lifting our spirts, or Greta Thunberg rallying the world around environmental activism, shards of light stream through the gloom that shrouds much of this year. And whether it’s the call to action that many alarmed citizens feel in light of these changes, or simply the fact that this election cycle is the first in which I am away from home and can form (at least seemingly) independent thoughts of political nature, 2019 is the first year I have felt defined and driven by my political beliefs. No matter on which side of the debate one falls, it’s a confusing time and with the future feeling so uncertain, we are all seeking a path forward.

In light of this newfound political fascination and involvement, I have felt compelled to explore intersections of data science with politics and was intrigued to find a project by fellow Flatiron School data science student Raymond. Featured on Towards Data Science, his investigation into using artificial neural networks to analyze presidential speeches was both fascinating and inspiring to me, combining a personal interest of mine with the career field I am just beginning to touch upon.

Throughout the Flatiron data science curriculum, I have been particularly drawn to natural language processing (NLP) applications and uniquely engaging visualizations. In his project, Raymond does both, while piecing together a coherent, deeply knowledgeable walkthrough of neural networks. With a clever, engaging introduction and clearly articulated purpose behind his project, he serves as an inspiration to me as I attempt to craft similar projects of my own. Throughout the body of his work, Raymond clearly defines each step of the process, explaining - with just the right balance of detail and brevity - the importance and effect of each stage of the modeling process. With helpful chunks of code, visualizations, and outputs to support his commentary, the project is easy to follow, and I found myself brainstorming similar ideas for which I could apply his strategic process. Ultimately, he tests support vector machines, logarithmic regression, random forest, and convolutional neural networks, before settling on the recurrent neural network as the best performing model with over 93% accuracy in differentiating between words from Hillary Clinton’s and Donald Trump’s speeches.

Finally, the project concludes by applying this model to presidential speeches between Democratic and Republican candidates throughout history, with varying degrees of accuracy. Additionally, the resuls of each are represented by unique word clouds in the step of each politician’s profile, filled with words that best characterize and differentiate their speeches. With an error cloud as well, we can see which words are the most distinctly common between each candidate, as the model found it difficult to predict which person’s speech they came from. The interpretation of these results is - keeping with the traditions of this project as a whole - articulate and comprehensive, refining the models by analyzing which pieces of network architecture are most effective, and comparing the results of 500 different pairs of presidents.

While claimed to be a starting point for future work into “finding areas of common ground, and identifying opportunties for collaboration,” but I feel like it does much more than just that, serving as inspiration for me in terms of project structure, presentation, and analytical depth. With The Grammar Lab as a source for presidential speech analysis and a starting point for future work into political data science, I am intrigued by the possibilities for work that can utilize and build upon Raymond’s project. I hope moving forward that I am able to replicate such thoughtfulness and expertise in my projects and find additional entrypoints into political analysis through data science.