Coder Social home page Coder Social logo

pratiksaha198 / lyrics-generation-using-rnns Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 5.0 172 KB

Coherent / Meaningful lyrics generation using RNNs , with a dataset created by web-scraping the GENIUS website using its API.

Jupyter Notebook 71.45% Python 28.55%
rnn-lstm genius-api text-generation webscraping vae char-embedding tokenization

lyrics-generation-using-rnns's Introduction

Lyrics-Generation-using-RNNs

This project generates new lyrics which did'nt exist before of your favourite artists , using Recurrent-Neural-Networks (RNNs) from a data-set created by web scrapping The GENIUS website using its API.

After vectorizing the text and creating training examples and targets , a four layer model was used. The Four layers used are :

1. Embedding layer -> The input layer. A trainable lookup table that will map the numbers of each character to a vector with embedding_dim dimensions

2. GRU layer -> A type of RNN with size units=rnn_units (Birectional-LSTM could also be used here.)

3. Dense layer -> The output layer, with vocab_size outputs and 'RELU' as the activation fuction

4. Dropout layer -> Benifits regularisation and prevents overfitting

The final prediction loop for text generation works as follows

Image of something

Steps to implement this project :

1. Fork the repository.

3. Head over to https://genius.com/api-clients/new , create your GENIUS account and then generate a client api and get your 'CLIENT ACCESS TOKEN'.

4. Install 'lyricsgenius' module in your local terminal. Execute lyrics_scrapper_from_GENIUS_website.py for each individual artist , to fetch their songs from The GENIUS website in a JSON file. (number of songs , title , popularity and be mentioned). Repeat execution for many artists.

5. Execute lyrics_dataset_creator.py to parse the JSON files which selects just the 'lyrics' key. It also creates the dataset named 'lyrics_dataset.txt' after doing some data-cleansing.

6. Run the Lyrics_Generation.ipynb notebook (preferably in Google Collab with GPU support for faster execution) , uploading the 'lyrics_dataset.txt' file , getting the new lyrics being generated.

7. Tweak the hyper-parameters according to "YOUR" best results

My dataset used to train and get the output is => lyrics_dataset.txt

Some lyrics generated :

Love in the world
Happens each time to keep me warm
Love in the rain
And we'll stop eating food and I'll say the words that I want in this cold
I don't have to think that I want to do
I can't think of anyone, anyone else
And we gotta save ourselves
If we want it to be
I'll be taking my time
As she looks lovely in the wood

This model can be used for any type of text prediction , not being limited to only lyrics.

Scope for improvements :

1. Using a LSTM-GAN based model, it has the best potential for most coherent output.

2. Adding another layer of Birectional-LSTM and lowering the EPOCHS keeping the loss within 1.5 to 1.1 , for most meaningful text generated.

lyrics-generation-using-rnns's People

Contributors

divinefool avatar pratiksaha198 avatar wilsonnagar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lyrics-generation-using-rnns's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.