Fooling around with APIs to analyse sentiments of popular music lyrics over time
charts.py
gets the top-10 charts for every month for the last 20 years from billboard.comlyrics.py
uses these charts and adds lyrics to every song. Uses the Mixmatcher API (needs an API key)speech-analysis.py
uses the data fromlyrics.py
and runs every song through the Google Natural Language API to do a sentiment analysis. It awards a score from -1.0 (negative) to +1.0 (positive)- Uses the Google Cloud Natural Language Client
- Google Cloud SDK must be installed and set-up
- Every script outputs the data to a JSON-File in the same directory. Subsequent parts use these files if they exist
- Billboard Charts: https://github.com/guoguo12/billboard-charts
- Lyrics: https://developer.musixmatch.com/
- Speech Analysis: https://cloud.google.com/natural-language/