New Beatles Lyrics Generated with GPT-2 #GPT2 #Beatles #MachineLearning #ArtificialIntelligence #DeepLearning #OpenAI

“Photograph of The Beatles as they arrive in New York City in 1964” from the Wikimedia Foundation and the United States Library of Congress‘s Prints and Photographs division. This work is in the public domain in the United States because it was published in the United States between 1924 and 1977 without a copyright notice.

 

There are a number of interesting examples of generating text with AI including sports stats and fun/ridiculous costume ideas. In a recent toward data science article Eugene Hotaj uses language models to predict new Beatles’ lyrics. Hotaj starts off with a simple bigrams approach which predicts the next word in a series based on probability. The resulting lyrics are pretty obtuse:

A never-before-seen Beatles’ song

Here’s a small snippet of one of the songs the bigram model generates:

 

She’s so I love her heart.

Well they are; they said I’m so many,

She no surprise

When you’re mine

Sad and the Amsterdam Hilton

they make my way,

Yes I wait a boy been born with a rich man,

all share

Hotaj discusses the limitations of bigrams, trigrams, and n-grams highlighting that this approach will eventually overfit returning actual Beatles’ songs. To create NEW Beatles’ lyrics, Hotaj decided to use OpenAI’s GPT-2 algorithm. The GPT-2 algorithm is a transformer model that can generate highly realistic text. Although the full-sized model was not released there are a number of smaller versions of the model available for use. Utilizing transfer methodology, Hotaj tuned the trained model to generate new lyrics from the Beatles lyric dataset. Hotaj gives an example of underfit lyrics, overfit lyrics and some that are just right (after fine-tuning for ~350 batches). The model learns pretty quickly that it needs to give the song a title and attribution (which is included in the data sets). Example lyrics below!:

Woman in Black

Lennon & McCartney

I’d make a scene

If you don’t want me to appear

You might as well leave me alone.

I’m near death and I’m in love

It’s not quite Lennon and McCartney but it’s a start! Take a look at the article on towardsdatascience.com if you’d like to see some more of the NEW GPT2 Beatles’ lyrics. If you’d like to take a look at the code, check out Eugene Hotaj on GitHub. If you’d like to learn how to use the GPT-2 model for your next language project check out this post.


Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7:30pm ET! To join, head over to YouTube and check out the show’s live chat and our Discord!

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Join over 38,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

CircuitPython – The easiest way to program microcontrollers – CircuitPython.org


New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — New Products 11/15/2024 Featuring Adafruit bq25185 USB / DC / Solar Charger with 3.3V Buck Board! (Video)

Python for Microcontrollers – Adafruit Daily — Python on Microcontrollers Newsletter: A New Arduino MicroPython Package Manager, How-Tos and Much More! #CircuitPython #Python #micropython @ThePSF @Raspberry_Pi

EYE on NPI – Adafruit Daily — EYE on NPI Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey

Adafruit IoT Monthly — The 2024 Recap Issue!

Maker Business – Adafruit Daily — Apple to build another chip at TSMC Arizona

Electronics – Adafruit Daily — SMT Tip – Stop moving around!

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !


No Comments

No comments yet.

Sorry, the comment form is closed at this time.