Train a neural network optimized for generating tweets based off of any number of Twitter users! Blend wildly different Twitter users together for hilarity!
Tweet Generator is based off of textgenrnn, and trains the network using context labels for better tweet synthesis.
config.yml and at the top, add the Twitter API keys from a Twitter App you own. Then configure the list of
twitter_users you wish to train the network on. You can also configure the
num_epochs and whether to use the pretrained model or train a
new_model. Then simply run:
The script will automatically save the weights (+ config and vocab for if
new_model) for the trained model, which can then be loaded into textgenrnn and used anywhere.
from textgenrnn import textgenrnn textgen=textgenrnn('realDonaldTrump_dril_twitter_weights.hdf5') textgen.generate_samples()
- tensorflow (either CPU or GPU flavors)
Max Woolf (@minimaxir)
Max's open-source projects are supported by his Patreon. If you found this project helpful, any monetary contributions to the Patreon are appreciated and will be put to good creative use.