A Twitter bot that posts AI-generated musical artists
Python program to generate “new” musical artist names.
Drug names based on a finetuning of OpenAI’s GPT-2, fed by a list of the top 10,000ish artists culled from LastFM’s API.
This is where the real guts of the project live. First, there’s the dataset notebook, which documents how I used the Last.fm API to create our dataset.
Then, there’s our GPT-2 Colab notebook (edit: this is a link to the Colab itself, which is a bit more convenient to view than the notebook embedded in this repo), which walks through finetuning OpenAI’s GPT-2 on the dataset to create our new artists.
Finally, there’s our cleaner, which (really inefficiently) cleans our ‘new artist names’ and prevents them from containing duplicate items from our original dataset.
set up your preferred virtualenv with Python 3
install the requirements
$ pip install -r requirements.txt
You can use the get_tweet()
function in the generate_artist.py module to generate the binary ‘real or fake’ questions that the bot tweets.
The twitterbot is currently deployed with Heroku, though that might change in the future. I’ll include updates here.
Don’t forget to check out the official new_ai_rtists twitterbot!
Like this twitterbot? Learn to set up your own here.. This tutorial was hugely important and helpful in creating this project.
You can run any of the files containing if name == ‘main‘, including:
from the command line to print the results.