Using NLP to Analyze the Obama Presidency Part 1
By: Yujian Tang
Tags: Programming, Headlines, New York Times, NLP, Obama

Using NLP to Analyze the Obama Presidency Part 1

Image from Citizen Truth

We all know the media is a ruthless business machine. We’ve already seen how scathing the media can be when it comes to public figures such as the President. Maybe I’ll be a media victim as well one day, but for now, I’m in a nice place an unknown writer and educator. Anyway, I wanted to take a look at how the media portrayed former President Barack Obama during his presidency.

If you’ve been keeping up with my articles of my educational Python blog, you know I’m a Natural Language Processing enthusiast. I decided to use the NY Times Archived Headlines and The Text API to do some NLP analysis on what the media said about Obama during his presidency. In this post, part 1 of my analysis, we’ll be taking a look at the most common phrases associated with Obama from November 2008 to January 2017. Click here for the associated tutorial on how to do this yourself.

The Most Common Phrases Used in Headlines about Obama During His Presidency

Click here to see the most common phrases used in headlines about Obama during his presidency in list form.

Let’s extract out the information from the list and take a look at the most common phrases.

The Most Common Words Associated with Obama in Each Year — Term 1

Image from Wikimedia

2008: Cabinet, Win, Choice, Deal, Education, Hopes, Report, Breach, Pledge, Slur. Okay, some of these are what you’d expect. For example: Cabinet, Win, Deal, Hopes, Report, and Pledge. I’m not terribly certain about Breach, and I think Education is related to his actual policy. Slur is most definitely a racist thing. This wouldn’t have been mentioned in any headline for a white president.

2009: Bill, Policies, Effort, Trip, Budget, Inauguration, Team, Video, Lunch, Nominees. Nothing really out of the ordinary here. There were a TON of articles published about Obama in 2009, but I assume this is true for any president’s inaugural year. We’ll have to see when I do the analysis for Trump and Biden (and maybe Bush).

2010: Speech, Agenda, Team, Visit, Diplomacy, Nominee, Family, Adviser, Advisers, Aides. Once again nothing too far out of the ordinary. Seems like there was a lot of talk about Obama’s adviser or advisers during 2010. That makes sense to me as 2010 was a midterm year. More talks about his team, which links with advisers and aides. The first time his family is mentioned in the top 10, so I guess the media was running out of things to talk about.

2011: Policies, Visit, Meeting, Ad, Aides, Jobs Plan, Re, Party, Turf, Vacation. More talks about his policies, the first mention of his jobs plan in the top 10. From what I can remember, this should have been mentioned earlier, but the media gonna do what the media gonna do. His vacations made it into the top 10 this year, I’m not sure if he took a lot of vacations in 2011 or not, if you know please drop a comment and let me know! Everything else seems pretty normal, of course there will be ads as he seeks re-election.

2012: Policy, Voters, Role, Supporters, Shift, Remark, Visit, Edge, Event, Allies. 2012 seems to be a year that really focused on Obama’s re-election. Makes sense, running for president is a full-time job on top of already being president. More focus on his policies in the media, that’s nice to see.

The Most Common Words Associated with Obama in Each Year — Term 2

Image from bdnewsnet

2013: Plan, Agenda, Nominees, Advisers, Meeting, Trip, Call, Aide, Message, Panel. 2013 Seems like it was a pretty normal year. I’m honestly surprised that we’ve seen things like Job Plans, but still no mentions of the Affordable Care Act in these headlines, nothing about health care yet. Mainly weird because that was implemented way back in 2010 and saw complaints and praise for years.

2014: Trip, Plan, Efforts, Allies, Appointment, Aide, Aides, Suit, Initiatives, Critics. Considering that appointment cropped up here, you’d think that Obama appointed a Supreme Court Justice in 2014, but nope, that was in 2009 (Sotomayer) and 2010 (Kagan). More trips for Obama this year. Seems like the media was bored again as they’re talking about his suit. I wonder what critics were saying in 2014.

2015: Talk, Rules, Library, Victory, Programs, Senator, Order, Aide, Veteran, Operative. I don’t know how the hell this happened, but for some reason Senator Obama made it to the top of this list. Obama hadn’t been senator for like 7 years by this point. I’m not sure what kind of drugs these people were on, but I want to know. Other than that, looks like Obama did some more education work (Library), won some more things (Victory), implemented more programs, and did some work for the veterans this year.

2016: Speech, Effort, Trip, Nominees, Presidency, Veto, Agenda, Aides, Access, Strategy. There’s been lots of talk about Obama’s speeches and talks so far. I agree with this coverage, he gives some good speeches. 2016 also saw the media talk about his presidency, which makes sense considering this was the end of it. I’m sure he vetoed a lot of things this year too. I’m surprised that there wasn’t anything about his denied Supreme Court nomination following the death of Scalia.

2017: Legacy, Policies, Regulations, Envoys, Watchdog, Health Plan, Health Law, Staff Members, Trump Siege, Musical Legacy. Well January of 2017, was probably the most relevant summary of Obama’s presidency. Finally, talk of the affordable care act regarding health plans is up in the top 10. Of course, Trump is also up here, he did win in 2016. One surprising twist about this was the musical legacy.

Thanks for reading! If you enjoyed this, please share with your friends on Twitter. For more interesting NLP projects and commentary, remember to follow me, Yujian Tang. To learn more about NLP in Python, check out how to build your own AI text summarizer.