Member-only story
Generating song lyrics using neural network
The idea here is to generate song lyrics using Long short-term memory (LSTM) RNN (Recurrent Neural network). RNN is used to predict likelihood of next word, given a sequence of word. LSTM is kind of Recurrent Neural Network capable of learning order dependence in sequence predictions. Refer below Wikipedia link for more details on RNN. https://en.wikipedia.org/wiki/Recurrent_neural_network
I downloaded song lyrics dataset from kaggle competition, that have more than 55000 song lyrics. I filtered songs of few artists of my choice to avoid long training period and memory issues.
Total 753 songs of below artists.
Algorithm:
I am using here word level neural language model, that can predict the probability of the next word in the sequence, based on the words already observed in the sequence.
The idea here is to train the RNN with many sequences of words and predict the Next Word.
For example if every sentence of 4 words.
Sentence 0 : [‘I’, am’, ‘in’, ‘love’] → Next predicted word: [‘with’]
Next feed Sentence: [‘am’, ‘in’, ‘love’, ‘with’] → Next predicted word: [‘you’]
Prepare dataset & train model:
- first, load dataset into file.