OvalBot Alpha: the Oval Office Speaks

Project Description

OvalBot is an experiment in combinatory poetry written in Python 3.x. You can find the full code for the alpha version here.

OvalBot responds to tweets from the President of the United States, @realDonaldTrump, with automated combinatory poetry. It uses the President’s most recent tweet as a key, through which it generates each poem, making each of Ovalbot’s posts a unique “response” to @realDonaldTrump.

Methodology

I began to program OvalBot with the goal that it would eventually be able to respond to the President not on his own terms, but with poetry. A few weeks into the project, I thought of using the speech of past Presidents. The reasons for doing so are two-fold. First, I desired to set Trump’s tweets into sharp relief against a background of learned, well-spoken Presidential communication–the motivations behind this will likely be obvious to anyone who must muddle through Trump’s writing. More importantly, however, I also quickly realized that the differences between Trump’s tweets and the speech of past Presidents went beyond vocabulary, grammar, or style: the poems generated by OvalBot would also show differences of priorities. Where the words of Johnson or Kennedy were carefully measured in order to respond to crises among the American people, constantly invoking the nation’s history and their own political philosophies, Trump spends the majority of his time on Twitter defending himself or attacking others. These differences may be gleaned even from poems synthesized using random vocabulary and syntax.

In order to accomplish these goals, I first wrote a Python script which would pull the President’s most recent from the Twitter API using the Twython wrapper for Twitter. The program then splits the tweet into individual letters and saves it as a list. This list is essentially a list of keys which the main algorithm uses to generate its poem.

Each key corresponds to a particular vocabulary of nouns and verbs. Each vowel has a specific vocabulary corresponding to a particular speech in Presidential history: The Gettysburg Address, JFK’s Inaugural Address, FDR’s First Inaugural Address, Lyndon Johnson’s Special Address on Voting Rights, and Barack Obama’s 2008 speech on race in America. For the time being, consonant keys all correspond to nouns and verbs taken from George Washington’s Farewell Speech. Following projects like Sea and Spar Between by Stephanie Strickland and Nick Montfort, I chose to hand-pick each word which would go into these vocabularies based on my own preferences and a few grammatical criteria, the most important of which is that nouns needed to be in the plural so as to form generalized statements, and the verbs should agree (or be transformed in order to agree). Most of my chosen verbs also needed to work as both transitive and intransitive, so that a statement might be either “courts support justice” or simply “courts support.” The latter doesn’t say much, but it doesn’t grammatically offend. These guidelines would have been less strict if I had been able to import a language-check module, but after two days of troubleshooting I had to abandon that effort for the time being.

To construct sentences, the program begins with a noun, then looks for a verb, and then finishes with another noun before ending the phrase. In order to add adjectives, the program performs a coin flip to see if it will decide to append one to any given noun in the poem [it has a 33% chance to append], then chooses from a separate vocabulary made up of selections from all of the speeches referenced above. For conjunctions between the phrases, the program first checks whether or not it has reached the end of a phrase, and then performs a similar random check and acts accordingly from a very limited list of conjunctions. Depending on its length, the final line may end with a noun or simply display the intransitive form of a chosen verb.

The end result are poems which seem to speak on a Presidential scale due to the sweeping generality implied by the syntax of plural nouns affecting other plural nouns (e.g. “cats hate dogs”). At  the time of writing, these poems always result in a few lines which might be taken as legitimate political observations or advice on any number of topics relevant to the country as a whole.

Rationale

Since 2015, the entire world has been obsessed with the Twitter account of @realDonaldTrump. The President’s press secretary has stated that they constitute official statements from the Office of the President of the United States. As just one example of the platform that Twitter provides Trump, consider that a brief statement can impact global markets in an instant. In many ways, in 2019, we live in fear and anticipation of 280 characters which might condone racial violence and social injustice, begin conflicts with major world powers, and denigrate the free press.

In response to this exigence, OvalBot gives the Office of President itself a chance to speak back to @realDonaldTrump using his favorite medium of communication. Each tweet from the President is used as a key by which OvalBot generates a poem meant to advise the President with wisdom from his predecessors. In this way, though we may never look forward to tweets from Donald Trump, we can anticipate OvalBot’s responses as chances to view Trump’s communications within several contexts — historical, lexical, and ideological.

Making use of what Scott Rettburg refers to as “combinatory poetics,” OvalBot is also part of a tradition of experimental poetry which has included Dadaism, “permutation poems,” and other forms which challenge mainstream poetry. I have constructed OvalBot so that its output is nearly always meaningful, and may be read easily–I have even gone so far as to make sure that it has a particular sense of genre to which it adheres–yet the randomized nature of its output is also meant to prompt reflection on the nature of political rhetoric.

The bot is also meant to further my personal understanding of the relationship between texton and scripton, as well as the collaboration possible with artificial intelligence in creating art. Original hesitant to think of AI as participating in art, I read “Literary Texts as Cognitive Assemblages” and was impressed by N. Katherine Hayles’s portrayal of the agency of technology. As Hayles notes, “Considered as a species, then, contemporary humans are engaged in symbiotic relations with computational media.” When thinking of the computer as a collaborator specifically in the task of writing, Hayles lays out the following questions that such a paradigm prompts:

How is creativity distributed between author and computer? Where does the nexus of control lie, and who (or what) is in control at different points? What kinds of selections/choices does the computational system make, and what selections/choices do the human authors encode? What role does randomness play in the composition? Is the main interest of the artistic project manifested at the screen, or does it lie with the code? (Hayles, 2018).

Hayles’s call to consider the computer as a collaborator in digital projects changed my perspective on computer-generated or computer-assisted artwork, even though I am a painter who originally learned to paint digital before I learned how to paint with oil. Thinking of my Python script as a collaborator in the act of writing poetry gave me a particularly useful outlook on the project and its output.

Reading Trump’s tweets and seeing OvalBot’s responses affords one the opportunity to place those tweets in their linguistic context alongside the language and concerns of previous Presidents, while questioning the power with which we invest all speech from the executive branch.

Planned Updates

  • Host OvalBot online so that it runs persistently.
  • Make OvalBot reply directly to the tweets referenced (requires switching from Twython to Tweepy API wrapper)
  • Re-write the code for more sophisticated formatting options.
  • Add stylistic complexity and larger vocabulary.