Skip to content

What sings to your heart, country or hip hop? Python, NLTK, NLP, applied to analyzing lyrics.

Notifications You must be signed in to change notification settings

sherirosalia/cupid_shuffle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Cupid Shuffle:

Can music "play cupid"?

When it comes to compiling the ultimate playlist of the heart, the question arises: Are some music genres more romantic than others?

Sussing out the answer, the data recipe:

  • Romance song lyrics retrieved using the genius api from country and hip hop compared using machine learning techniques.
  • Music lyric extraction with Python, courtesy of the GENIUS Developer API
  • Songs were randomly selected uing the Spotify Developer API, the code for which is housed in a separate repository: sound_effects
  • Machine learning processing with the NLTK library to count word frequencies.

Country Music Top Words

Hip Hop Words

Folder structure in root

  • README.md
  • data_files houses country and hip hop JSON from Spotify
  • website files and images in docs
  • screenshots are in images
  • python folder holds code for genius api which is complete in app.py. There are also two jupyter notebook files which analyze the lyrics with PySpark, NLTK and Python Pandas, Spotify API

"We've only just begun."

There are so many avenues to take music analysis using natural language libraries (NLP). Thank you for reading this far and I hope you find the scripts helpful. If you do, please feel free to clone or fork the project and take it to the next level. I would love to hear what you do with it. An explanation of the project is here: Cupid Shuffle

Related article from OkCupid

For more on this topic, check out this article: Understanding Deal Breakers: The Psychology of Music and Romance"