My Authors
Read all threads
I’m finally ready to release my neural net based lyrics parody generation system…

Introducing: Weird A.I. Yankovic!

Runs on Google Colab: colab.research.google.com/drive/12g07FS2…
You can provide the rhyme scheme and syllables per line for an existing song, and it will write new lyrics to match.

In the true spirit of parody, here is a Michael Jackson song (“Beat It”) rewritten to be about food.

Then you can sing the song yourself to the horror of others
With a little bit of extra work (you provide a mp3 or mp4), the system will produce a karaoke video to make it easier to sing along
Importantly, we did not do any training. Weird A.I. Yankovic uses GPT-2 and XLNET off-the-shelf.

That means that if you want to use it, you don’t have to find and prepare a specialized dataset to try a particular song, or worry about it not learning.
How does it work? There were 2 parts to this project:

1) writing a near-rhyme detector. Turns out there is no set definition for near-rhymes. Work by @gh_marjan was instrumental

2) Controlling neural language models.
It would be pretty difficult to train a neural language model to meet a given number of syllables per line and also match a rhyme scheme.

But I could pick the rhyme for the next line. The problem then became how to continue from the previous line but end in a chosen word...
XLNet can be made to generate the missing middle of a text span, attending to text before and text after.

And it also has to generate a line with a given number of syllables. Well that just requires a lot of sampling...
The dirty secret of neural language models is that the model itself just produces a distribution over words. The “generator”, which is not part of the model is /code/ that wraps the model and samples from the distribution in some particular way...
Most common are greedy sampling and sampling by logit weight to get beams...

I wrote a sampler that combines logit sampling (beams), heuristics, & custom scoring functions.

Most folks focus on the encoder & decoder that make up the model but forget the importance of the sampler
First try rewriting Hamilton lyrics came out quite well
Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with Mark Riedl wears pants during video calls

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!