Share your repls and programming experiences

← Back to all posts
LyricMood - Lyric Sentiment Analysis
jonlau (4)

Introducing LyricMood, a solo project that analyzes the sentiment of lyrics based of the positivity and negativity of the words. Using PHP, LyricMind is able to dynamically generate all of the content by leveraging the library simple_html_dom to scrap for lyrics and then using Finn Aarup Nielsen's research on lexicon to analyze text sentiment. LyricMood uses Nielsen's AFINN dictionary key pairings that rank words from a score of -5 to +5 to determine their positive or negative valence. Then taking the difference between the positive and negative words, we generalize the song's sentiment.

While there are some critical flaws with using this approach, it can also provide powerful insight into songs. Take a look at Perfect Duet (with Beyoncé) by Ed Sheeran. Immediately, the sea of green reveals the overwhelming positive sentiment. Thanks for stopping by and please enjoy experimenting with different songs. If you aren't sure what songs to look up, you can check out some of the popular artists or see if you're feeling lucky!

Gabby8C0des8 (26)

hey ik this is so late, but every time i click on a song it show this:

i keep trying diffrent songs, but its not working

ebest (664)


"I'm feeling lucky"

Sounds familiar.


jonlau (4)

@ebest Homage to one of the greats :)

ebest (664)

@jonlau Do you have a "rights reserved" thing?

jonlau (4)

@ebest Oh wow. I didn't realize Google had a trademark on it. I'll change it to something generic when I can!

ebest (664)

@jonlau I don't know if there's a trademark