MUSIC AS INFORMATION

PTYHON DATA ANALYSIS: Sentiment and Success

Taylor Swift's music career spans more than 15 years, covering a vast array of genres and sentiments.

This project explores how sentiment variety in Taylor Swift’s music correlates with the commercial success of her albums. Using data analysis techniques, I gathered, cleaned, and processed lyrics and sentiment data, applying sentiment analysis tools to evaluate the emotional range of each song.

DATA AQUISITION

The project used Taylor Swift's discography, focusing on a large dataset including her songs, albums, and the corresponding listener and play data. Data was gathered from multiple APIs such as Spotify’s API (via spotiPY) and LastFM, which provided track popularity, listener counts, and play counts. Sentiment analysis was conducted on lyrics obtained through LyricsGenius and analyzed using the VADER sentiment analysis tool from the Natural Language Toolkit (NLTK)​.

CODING: PIVOTS AND PLANS

A significant challenge I encountered during the project was with retrieving and processing song lyrics through azAPI, which was unreliable for large requests.This forced a pivot to LyricsGenius, which had its own issues, such as including non-English lyrics for featured artists, and being very crufty in general. I handled it with robust cleaning and use of LangDetect to handled by filtering out non-English songs. Once I had the lyrics, I was able to remove redundant tracks and non-essential album versions were removed to maintain dataset integrity​ ).

CONCLUSIONs & WRITEUP

The project concluded that while sentiment variety exists in Taylor Swift's albums, it does not significantly correlate with the popularity of individual tracks. However, at the album level, there was a slight indication that albums with greater sentiment variety tended to attract more listeners. The project also hypothesized that a wider emotional range in an album might appeal to a broader audience, though it could not definitively determine sentiment's impact on success​.

DATA ANALYSIS & VISUALIZATION

The actual analysis was performed at both the track and album levels. I used VADER was to compute positive, negative, neutral, and compound sentiments for each song. I then visualized the relationship between sentiment scores and track popularity through ALTAIR. Contrary to my assumptions, the data showed a weak negative correlation between sentiment and popularity at the track level, with more complex analysis revealing no strong predictive power for sentiment on song success​.

Next
Next

Buff Techs: Info Works Consulting