incidentist / the_tuul

Make a decent karaoke video from any song in about 10 minutes.
https://the-tuul.com
17 stars 4 forks source link

Use GPT to add slashes to lyrics #19

Open incidentist opened 1 year ago

incidentist commented 1 year ago

ChatGPT does a great job of dividing up syllables into slashes. Integrate it.

incidentist commented 8 months ago

This works pretty well but definitely isn't perfect. I'm pretty sure that with prompt tweaks it could handle contractions and "doo-doo-dah" gibberish lyrics better. It has some copyright checking that causes it to bail on some lyrics (the one I found was Wheatus's "Teenage Dirtbag", weirdly), so that's a failure mode that needs to be dealt with gracefully.

The other way to do this is with SpaCY or one of the hyphenation libraries. This needs a lot of testing to see how flexible they are, but they would have the added advantage of not needing an API token. They would also have all the advantages of deterministic code, i.e. ease of testing. The SpaCY Syllables plugin uses a hyphenation library called Pyphen under the hood. Would we need to automatically detect the lyric language in order to load the correct hyphenation dictionary? GPT knows how to chop syllables even in gibberish songs like Prisencolinensinainciusol, which is a pretty high bar!