Who does President Trump love the most in the Twitterverse?

Barbara Maseda
Text Data Stories
Published in
4 min readFeb 16, 2018

NYT’s Kevin Quealy analyzes over 10K tweets to find out

One of tweets about the person the president praises the most: himself / Image: Twitter

On Valentine’s Day 2018, The New York Times used their in-house collection of President Trump’s tweets to — in the spirit of the holiday — answer a question that is not normally the first that comes to mind about a user like @realDonaldTrump: Who does the president appreciate? What figures and organizations are worthy of his public praise?

“I think it’s more revealing, in a way, than the insults,” said the author, NYT’s graphics editor and reporter Kevin Quealy, in an exchange of emails about the making of the story.

Titled The People, Places and Things Trump Has Praised on Twitter: A Complete List,” the piece is an inventory of the subjects that the president has mentioned in a positive manner, presented in alphabetical order, and followed by the praising quote(s) linking to the tweet in question.

Under each name, there’s a brief description of who or what they are. In certain cases, at the end of the list of compliments, a button gives the reader access to negative tweets about that same person or organization.

Collection size The tweets analyzed for the story are those posted by Mr. Trump after the announcement of his candidacy in June 2015 — a collection that included over 10700 tweets at the time of writing.

Data visualization A color code is used to separate the quotes in two groups: tweets from before / after Mr. Trump’s election.

Different readers will find different quotes/trends interesting. Among some of the popular highlights noted by Twitter users are:

  • That the person that Mr. Trump has complimented the most is himself
  • That the only thing he praises more than himself is “Campaign Events and Crowds”
  • That “great” is his favorite superlative

Adding Love to Insult

The idea for this piece comes from the other extreme of the sentiment spectrum: in January 2016, along with NYT colleague Jasmine Lee, Quealy co-authored a similar article titled “Donald Trump’s Twitter Insults: The Complete List (So Far)”, which continues to be updated with new data at the Times.

“I thought Valentine’s Day was a good chance to do the opposite,” said Quealy about the 2018 story.

The following image shows the original piece compiling the negative tweets—now replaced by this updated version from January 3, 2018:

Top screen of the first piece published on January 28, 2016. This version is no longer available in the NYT’s website. / Image recovered from The Internet Archive/NYT

As the new title indicates (see tweet below) the number of people, places and things insulted by President Trump amounted to 425 by January 3, 2018:

This print copy provides an excellent visualization of the accumulation of insults:

Production: “More art than science”

One of the peculiar aspects of this story is that it is based on a a dataset that has been labeled by hand. Instead of relying on sentiment analysis algorithms to automate the process, the author classified each tweet as positive or not-positive himself.

This approach, which is more time-consuming, is also one that Quealy thinks is more accurate: “I do it by hand because there’s so much subtlety with the language I wouldn’t trust a machine to get it right. It’s more art than science.”

Data acquisition“To fetch the tweets, I used a Ruby script created by my former colleague Jeremy Merrill, now at ProPublica,” said Quealy. “Like many organizations, we’re storing lots of political candidates’ tweets in a local database, so that’s always running. That’s what I query to get the most recent ones. Labeling Then I put them in a Google spreadsheet and tag them myself. Data preparation I have one sheet with tweets, and one lookup table with names, titles, etc.”

Google spreadsheet used to annotate the data / Image: Courtesy of Kevin Quealy

According to Quealy, the most time-intensive part of the process was the manual annotation of the tweets: Production time “It took me several hours to do them all, in batches, and another few hours to double-check all those names and titles with some other editors.”

Data analysis Once the manual annotation of the dataset was ready, he processed it using the googlesheets R package, and then used JavaScript to render a TSV export of the data in the browser.

Story datasheet

Title: The People, Places and Things Trump Has Praised on Twitter: A Complete List
Media outlet: The New York Times
Author:Kevin Quealy
Type of analysis:Opinion classification (positive/not positive)
Data source: Twitter API/Locally-kept database updated periodically using a Ruby script to query the Twitter API
Collection size:10700+ tweets
Selection criteria: all the tweets from a single Twitter account (@realDonaldTrump) posted from June 2015 (announcement of Mr. Trump’s candidacy) to date. Retweets excluded.
Data analysis technique:Manual annotation
Tools/Software:
Ruby script, Google Sheets, R (googlesheets package)

This story’s datasheet has been added to the database of text-driven stories that I’m building. If you’ve worked on a journalism project that involved processing large amounts of text, you can add it to the database by filling out this survey.

If, like me, you are interested in the intersection of text processing and journalism, follow my blog or email me to take part in the conversation.

--

--

Barbara Maseda
Text Data Stories

Journalist. Exploring text-data processing challenges and solutions in newsrooms. John S. Knight Journalism Fellow at Stanford University #nlp #ddj #foss