Writing Trump Tweets with Artificial Intelligence

Adam Grant
5 min readAug 16, 2017

--

What happens when you teach a computer to speak English, but expose it only to Donald Trump’s tweets?

What if you expose it only to “yo mama” jokes, recipes, or the entire King James Version of the Bible?

This seemed like a formidable first step to getting my feet wet with artificial intelligence. I’m just going to dive into the fun stuff here. You can learn more about the code in the footnotes below[1].

Donald Trump’s Tweets

It took a while for the program to get the hang of it. It deserves reminding that algorithmic scripts like this one have no concepts of things like the English language or even sentences and punctuation. This script is meant to write new written works based on pattern recognition from what I feed to it.

It’s like teaching a baby its first words by saying “Can you say ‘bigly?’ Say ‘bigly,’ Bobby. ‘biiiiiiglllyyyy’.”

To give you an idea of this leap, here is its first attempt at a Donald Trump tweet:

[T�⢢����������4444444[[[555�Ñ�&&�rrr++::���BBBB�ggqf!!!!!!���6666WW�hhh�����”���))____�__���===””))�����;;;����l���00����pp��Ğ��������?;;;IIIII::::DDDeDFF��F�VVVV��ZZEEE111"”���?�Y��?�dd������.jjjjddVVV��𢢢���))��)yy������22EE[[;;KCCCCoooVVVVZZZZ��������������4444444[[[555�Ñ�&&�rrr++::���BBBB�ggqf!!!!!!���6666WW�hhh�����”���))____�__���===””))�����;;;����l���00����pp��Ğ��������?;;;IIIII::::DDDeDFF��F�VVVV��ZZEEE111"”���?�Y��?�dd������.jjjjddVVV��𢢢���))��)yy������22EE[[;;KCCCCoooVVVVZZ

Close but no covfefe.

After 12 hours running a 12-core CPU machine teaching itself Trump all night, the script improved and came up with these gems:

The plant and the political care of the people of the planters are totally reporting to be truly to be the plant

I will be going to Mary the American people of the politicians are so badly by the terrible state of the failing @nytimes is a total disaster

Thank you for your support to make a great day in New Hampshire and Marco Rubio is a disgrace for a big day for the people of the party of the party to the people of the party

Thank you for your support of the race to see that I am the only one who was a great honor to welcome the @WSJ

I noticed @foxandfriends and the “failing” @nytimes make frequent appearances.

Some tweets were pretty docile and what you’d expect of any public figure with a Twitter account

I will be interviewed on @foxandfriends at 10:00 A.M. Enjoy!

Thank you America! #Trump2016 #MakeAmericaGreatAgain #TrumpPence16

Thank you for your support in to get out and VOTE on 11/8/16. Watch on @CNN at 7:00 A.M.

Others went to bizarre extremes and took special liberties in punctuations and words the script sounded like things it read.

The debate results to see you the deal with @GOP presidential candidate @JebBush is doing a great new poll for the senious to the Republican Primary Committee had to defeat the debate last night on @FoxNewsSunday w/ @BreitbartNews by @FoxNews is so much to talk about the serious problem

Thank you @Teamsugrey is a total disaster for the people of Iowa was a great honor to welcome the money losing the failing @nytimes story is a true people of Iowa

Poor @nytimes.

Here’s a brilliant campaign strategy, likely inspired by the pre election tweets:

I will beat Hillary easily, but I want to run against me. I will work hard and never let you down. Make America Great Again!

Honorable mentions:

The protesters by @megynkelly says I won the debate polls are trying to defend the fronthe only week on @Morning_Joe at 7:30 A.M. Enjoy!

The failing @nytimes is so proud of my campaign and am in the debate says I won debate and more politicians will come together and very weak on illegal immigration. The media is going crazy.

…design or negotiation and the dumbest political opponents are able to poorly the other candidates are me that the Dems are the entire since through the debate will be doing a great job — thank you! #MAGA🇺🇸

Yes, it even included the little flag gif.

Thank you for all of the great star in as politician than a total mess our country in the history of our country is that the crowd is overfloging to the race and the rigged system and only answer to YOU, the American people will star with unable to start my warge with the victims of illegal immigrant candidate will be dispused of the late the business leaders that the real story on the same old thing and most pro-Isrieght

Finally someone who is saying what we’re all thinking.

Thank you @SenJohnMcCain for your nice words. I am the only one who can fix this. Very sad!

The president of the people who has tad one of the people who has kned our country is back @TrumpTurnberry Resorts are treated by Hillary Clinton’s open borders

Oh yeah, Hillary Clinton is constantly under fire.

Thank you @krauthammer for your nice comment at the candidate by the other candidates are more coling of my book CRIPPLED AMERICA & support right now in the U.S. Senate server as an incredible spirit to because they are all over and beating Hillary Clinton one on one thank you.

Why doesn’t phony @bobvanderplaats dealing the truth airoun of the convertation to the United States Supre

We want answers, Bob VanDerPlaats. I think the character limit got cut off on that one.

“Yo mama” jokes

Surprisingly, the script had more trouble with these. I guess computers don’t get jokes.

she was a poon the doon the d the wat a poon the doon the bock on her bood the boon

Hey take it easy. That’s my mother you’re talking about.

momma’s so fat, she took to to to to to ter to see her to bee an the doon the don the dolled

Je traid “oo mommis is so fat, when she was bears on the car her for the dor her for the dor the door fire to dear to be a bear

Yo’ momma’s so ugly, even of the cooss ander and she has to look up her the coosed the coor the cook of the coole side the comes of the coor

so fat, she said, “Whe the the tried in the front deed in the front deed.

Burn.

I decided to let it run a little longer so it could really get the essence of a good joke.

Yo momma so fat she sat on the beach in the mind with a birthes in the front door

Yo’ momma’s so skinny, she had to weat to the back to the beach stanged in the mind spat ween to a craps poon to a caps her bather food stamps!

The beginning and end look right on that last one.

Yo’ momma’s so fat, she has to wear a beethrommanticks smell says “Dammers pare a bogler for her and to be a bealer foo momma so fat she has to burn dour foom a mommathes and says “Dammere

Eventually you just have to quit while you’re ahead

Police Incident Reports

The victim (B/F/25) reported between 12/22/12 at 1100 hours and 02/24/12, unknown suspect(s) forced entry to the front door to the residence in a vehicle.

Wait, she forced her way into the door…with a car?

The KJV Bible

LORD hath commanded thee this day to the morning, that the LORD hath made me a little way to the house of the LORD, and he shall be ashamed of the king’s meat, and he shall be ashamed of the children of Israel, and said, The LORD saith the LORD, that they may do all these things.

I have no opinion about the King’s meat.

Behold, I will bring evil upon the mountains, and the sons of Jerusalem, which were not of them were astonied one of them, and they shall be as the shekel of the sanctuary; both of them full of fine flour mingled with oil for a meat offering.

Wait, are we eating or being scorned?

Oscar Wilde

Algernon. Well, would you mind my reforming myself. I am not in the wire with the phrase “Project Gutenberg”

Whoa! Breaking the fourth wall.

Footnotes

1: https://github.com/adamjgrant/Text-Machine-Learner

--

--

Adam Grant

Senior Software Engineer for some company in Cupertino, California.