Member-only story
Data Science & Pop Music
Determining Song Sentiment with Text Mining
Do you ever feel “happy, free, confused, and lonely at the same time?” Well, Taylor Swift does. (Or she did, at 22.)
There’s a lot of emotion in this song-some positive, some negative, and some neutral. And this got me thinking: can I determine the overall mood of her albums with data? With text mining and sentiment analysis, it turns out I can. And since Taylor Swift has written songs since she was 16, I can also look at how her songwriting sentiment has changed.
…Are you ready for it?
Data Pre-processing
I downloaded the lyrics data from Github. The data was structured with one record per lyric, labeled with the song and album. Additionally, each record has the previous and next lyrics in…

