A quick code snippet to find matching terms between song lyrics
I love BBC 6 Music. On my morning train rides into LA I like to listen to the Radcliffe and Maconie Show. The hosts play a game at the end of their show where they play three tracks and ask listeners to guess what connects all three tracks.
I have yet to win this game which has prompted me to try to see if I can gain an advantage by analyzing some data about the the themes submitted. I have noticed that since the start of 2018, the theme relies on an exact term or phrase match among the lyrics 17% of the time.
In these cases, these were the links.
Using what I have recently learned from the excellent Tidy Text Mining and really helpful package that pulls in lyrics from the site Genius, I was able to write a really quick script to get the lyrics for two songs and look for common terms between them. Here is an example to find one of the links above:
My next steps is to wrap this all in a function and add a check that first looks for matching trigrams and then finding none looks for bigrams and failing that lists all matching terms ommitting stop words. I will post that update soon.
As of this post, I still have yet to win Tea Time Theme Time (#TTTT)