Inspiration

Many Americans are voting for the Donald because he offers a worldview starkly different from that of politicians. We thought classical literature was over-politicized as well.

What it does

It changes a body of text into how we envision Donald Trump would say it.

How we built it

Stack

Used Flask with Mongo as a backend with two REST endpoints for submitting jobs and collecting finished jobs respectively. Celery was used to handle background processes.

Slack-client was used to make a Slack bot, but we unfortunately couldn't get it to work on Heroku.

We also didn't have enough time to write a front-end; our back-end developer was the only one with a lot of front-end experience!

Algorithm

Used Python's nltk to analyze corpus of Donald Trump's speeches and tweets for frequency. Replaced proper nouns with a set arbitrarily associated with Trump. Used PyDictionary to conduct a breadth-first search of synonyms of queried words and ranked possible Trump-words by degree of separation and frequency of use by The Donald. For words that were indeterminate, we either left them alone or replaced them with hashtags or Twitter handles found on Trump's Twitter proportional to their frequency. Due to our callous disregard for lexical structure, we were able to produce text that seems to come from a drunk-tweeting Trump.

Challenges we ran into

+Heroku timeouts, sockets generally unhappy with Slack-client +Performance of machine-learning algorithms we were trying

Accomplishments that we're proud of

+handling server-side asynchronicity for the first time (it was relatively painless too)! +wrote this with just over a week of experience in Python!

What we learned

+Bootstrap! +How to write a Slack bot (Theoretically!) +I really need to learn Django

What's next for Trumpslator/DrunkDrumpf

Polishing up the Slack bot and maybe turning it into a poor version of Deep Drumpf as well?

NB

Endpoints are: /trumpslator/api/v1.0/trumpslate /trumpslator/api/v1.0/trumpslate/<_id>

Share this project:
×

Updates