lyrics analysis

Two weeks after I began learning Python, I came up with this idea to analyze artists' lyrics. I spend a lot of time listening to music, and I wanted to see which words the interprets use the most or which words they repeat a lot. Since it was the first tougher thing I wrote in Python with close to zero experience, the code is very messy but surprisingly absolutely functional. The first version only allowed me to analyze lyrics that I had downloaded beforehand and which I manually put in the program, but I wanted to improve its abilities. The goal was to enter the name of any artist and let the computer do the download part. I found a code on GitHub which I could use and which did a lot for me. It used Genius' API, so it's needed to get your own API key to make this work. It connected me to Genius, and I edited it just a little bit so that I could enter the name of any artist and the number of songs. It would download the lyrics considering the input. I then coded the rest - counting the severity of each word and then sorting and reworking the data for output.

Go Up

how it works

  1. The user chooses to either upload his pre-downloaded lyrics or to use Genius' lyrics database
  2. Based on the previous choice, he writes the names of the files or enters the name of an artist
  3. If he chose to use Genius services, he has to enter from how many songs to draw data from
  4. Lyrics are being downloaded to a text file which is created automatically
  5. Lyrics are reworked - section headers (such as 'Chorus' or 'Verse X') are removed, so only raw lyrics remain in the document
  6. It finally counts the frequency of each word and adds zeros, so it's always a four-digit number and can be later sorted
  7. Words are sorted in descending order and saved to a new file
  8. The conclusion is printed in the command line

Contact

Leave a message:

Prague, Czech Republic

Copyright © 2021 Adam Tran