Introduction Essay Dashboard Spotify About

Evaluating NLTK's Assessment of Rap

By: Nikhil Chinchalkar



The graph below depicts a 5-year rolling average of the percentage of positive and negative songs within the end-of-year Billboard Top 100. It should be noted that certain songs were excluded from the data since they could not be matched to lyrics and thus could not be scored, which explains why some years might not have a percentage of positive and negative songs that add up to 100. Songs were classified as being positive or negative based on the score they recieved from NLTK's sentiment analysis, which provides a number between -1 (more negative) and 1 (more positive) to each song.


image_year

Hover over the above image to play the animation.
Or use the slider below to adjust the year more precisely.



While there are certainly fluctuations in sentiment over time, there is a general trend of negativity being more commonly found in top songs, with a visible shift being apparent at the turn of the century. This trend of negativity has continued into the songs themselves, that is, just as the makeup of Billboard songs have become more negative, the songs that are classified as negative have been more extreme. For instance, in 1960, the average negative song had a score of -0.77, a much less negative sentiment than the 2015 -0.92.

There are a number of reasons for such a drastic increase in negativity, one of which being the introduction of rap into mainstream culture. Since 2000, there has been an average of more than 12 songs classified as “rap” by Spotify featured on the Top-100 list, a stark increase from the mere three Top-100 placements the genre averaged before the 21st century.

Here's a visual of that change, where each section of the pie chart represents that genre's makeup of songs on that year's Billboard Hot 100:

image_year
Hover over the above image to play the animation.
Or use the slider below to adjust the year more precisely.



As described above, the rap genre suddenly takes up a substantial section of the pie chart (and the Billboard 100) around the year 2000. This evidence of growth, combined with the fact that rap is an outlier for its much more negative sentiment score, as indicated by the graph below, backs up the notion that the trend in musical negativity might stem from the rap genre.



While the correlation between the two trends is certainly interesting, that is not to say that rap is inherently negative. Instead, looking at certain examples can help to paint a more clear picture of how rap has influenced total Billboard sentiment.

In the 335 rap songs featured in our dataset, two songs stick out for their sentiment scores in relation to their personally-derived messaging. These songs are “Lifestyle" by Rich Gang and "Forever" by Drake. Charting in 2014 and 2009, with sentiment scores of -0.9114 and -0.9992, respectively. From reading the scores, we would expect the songs to be undoubtedly negative, but having listened to them, they are certainly not as cynical as one would expect.

“Lifestyle” features multiple artists rapping about how they overcame certain struggles in their past lives, ultimately earning themselves a luxurious lifestyle:


“I done (Hey), did a lot of s**t just to live this here lifestyle (Oh, yeah, woo)
We came straight from the bottom to the top, my lifestyle (Lifestyle, ayy)”


“Forever” is a similar record, featuring artists like Lil Wayne, Kanye West, and Eminem orating their desire for eternal success as they previously had nothing:


“But understand, nothin' was done for me
So I don't plan on stoppin' at all
I want this s**t forever, mane”


Despite the seemingly obvious positive messages these songs depict, their scores indicate the exact opposite. One reason for this inaccuracy might be due to NLTK’s treatment of expletives. For experiment’s sake (as purposefully removing data is unethical), removing expletives from each of the songs, and feeding them back into NLTK’s library yields much more understandable scores of 0.9973 for “Lifestyle” and 0.9737 for “Forever”, indicating that there is a strong negative weightage that NLTK places on these types of words.

Whether or not this is a fair judgment is a personal question that depends on one’s own emotions towards strong language and whether or not they believe profanity can taint a positive message. For NLTK, it believes that profanity is always negative, and this understanding can help to clear up the scores for rap songs and the corresponding increase in negativity: rap is not inherently negative, but the positive messages it communicates are often accompanied by expletives, typically at a higher rate than other genres:



The word cloud below can help elucidate this notion; as the latter half of the 2010s approaches, expletives take up a larger section of the image, indicating higher usage stemming from the aforementioned rise of rap around this time.


image_year

Hover over the above image to play the animation.
Or use the slider below to adjust the year more precisely.



In regards to NLTK, the higher rate of profanity means that NLTK views rap as more negative than other types of music not for its message, but for its delivery. Thus, when rap is featured in the Billboard charts more frequently, the overall Billboard sentiment decreases. Once again, not inherently because of its genre, but because of NLTK’s “personal” opinion on word choice, which serves as a reminder that machine algorithms are very much separate from human comprehension.