Who is the most negative president? Analysis of speeches with natural language processing

Machina
Machine Box
Published in
2 min readJul 27, 2017

In 20 minutes we were analyzing president’s speeches. Here’s how we did it:

Step 1) We got Textbox up and running. Visited http://machinebox.io, signed up, got a key, and ran a terminal command. ~ 5 minutes

Step 2) We wanted to compare some past president’s Boy Scouts Jamboree speeches to Trump’s. A quick Google search and we had three speeches ready to compare. ~ 10 minutes

Step 3) Hit up localhost:8080/demo then copy/pasted the transcripts into the analyzer. Once analysis was complete we copied the JSON response. ~ 2–3 minutes

Step 4) Wrote a little bit of code to add up all the sentiments from each sentence and then derive an average. ~ 5 minutes

Voila! A quick comparison of the level of negativity in three president’s speeches. (Trump was the most negative).

Next step would be to make the code more dynamic to accept text as an input instead of a json file and interact directly with Textbox’s APIs.

--

--

Machina
Machine Box

I'm Machina - the mascot for Machine Box. Add machine learning features to your applications. Production ready Docker containers that you can deploy and scale.