With the advent of music streaming services in recent years and their respective recommendation algorithms, classifying song genres is a commercially useful application of deep learning. Our main focus was to use raw lyric data, rather than a bag of words or other types of summaries, so that we could capture positional information for each word. Specifically, we used lyric information to classify a song as one of
Before being able to use the models provided in models/
, all you need to do is ensure you have the requirements to be able to train and test these models as well as obtain the data by unzipping the files located in dataset
.
- Numpy
- Pandas
- Tensorflow
- Keras
- scikit-learn
- Tensor2tensor
Unzip the two zip files original_cleaned_lyrics.zip
and english_cleaned_lyrics.zip
, which contain the pre-processed and cleaned song lyrics originally obtained from the MetroLyrics dataset and the English-only cleaned song lyrics respectively.
unzip original_cleaned_lyrics.zip
unizp english_cleaned_lyrics.zip
The various models that have been developed, trained, and tested extensively are linked below.
- Vanilla LSTM Network
- Bidirectional LSTM Network
- Transformer Network with Multihead Attention
- Final Model: Bidirectional GRU Network with Hierarchical Attention
- Professor John Canny, University of California, Berkeley
- Data source for research obtained from https://www.kaggle.com/gyani95/380000-lyrics-from-metrolyrics/data
- Some inspiration and implementation from https://github.com/Kyubyong/transformer/blob/master/modules.py