When Trump tweets, this bot finds the Trump tweet it most closely resembles from before he was president.
This project relies heavily on tweet2vec, which is described in this research paper by Bhuwan Dhingra, Zhong Zhou, Dylan Fitzpatrick, Michael Muehl, and William W. Cohen. "Tweet2Vec: Character-Based Distributed Representations for Social Media." ACL (2016). We highly recommend you start with their original code, as we've made a bunch of changes here and have probably broken something.
The project also includes archived tweets by @realDonaldTrump from the Trump Twitter Archive. Check out the site, the code and the data.
The code also uses the Python packages conda, theano, lasagne, numpy, scikit-learn, boto3 and tweepy.
Cobbled together by John Keefe in the Quartz Bot Studio. Read about how and why in this Bot Studio blog post.
This was a quick-turnaround experiment and could contain errors, mistakes and sloppy code. Use at your own risk! :-)
The notes I took along the way are in NOTES.md.
That said, feel free to reach out to us at bots@qz.com if you have questions or thoughts.