• Stars
    star
    146
  • Rank 252,769 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created about 8 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Lyrics Generator aka Character-level Language Modeling with Multi-layer LSTM Recurrent Neural Network

Deep-Lyrics

Lyrics Generator aka Character-level Language Modeling with Multi-layer LSTM Recurrent Neural Network

The goal of this project is to generate completely new original lyrics inspired by the work of an arbitrary number of artists.

Description

This repository contains 4 main components:

  • A web parser to gather lyrics online
  • A preprocessing program to transform the lyrics into a computation-friendly format
  • A program to train a LSTM model to fit the data
  • A sampling program to generate new lyrics based on the learned data

The Deep Learning algorithm is implemented and tested with TensorFlow version 0.10.0rc0.
The parser is gathering lyrics from songmeanings.com which does not provide any API to request data. Therefore, it is needed to manually find the IDs of the artists you want to get inspired from and pass them to the script. The fun thing is that it does not matter if the artists you pick are related in style or not, the algorithm will learn from all of them; which can obviously lead to some cool results!

Usage

Try it yourself by running example.sh with your own data.

# parse web pages to retrieve lyrics, concatenate them and save them locally in a single file
./gather.py --output_file data.txt --artists "artist_ID_1, artist_ID_2, artist_ID_3, artist_ID_4, artist_ID_5"

# create a vocabulary file containing a binary representation for each character
./preprocess.py --input_file data.txt

# train the LSTM model to fit the lyrics data
./train.py --training_file data.txt --vocabulary_file data.vocab --model_name lstm_regression_model

# generate new lyrics and save them in a file
./sample.py --model_name lstm_regression_model --vocabulary_file data.vocab --output_file sample.txt --seed "Oh yeah"

Note

I highly recommend these two great articles to anyone willing to understand how Recurrent Neural Networks works and particularly LSTM:

Example

Example of lyrics generated with this code (slightly edited to fix typos). The resulting text is understandable but does not make any sense at all, which is quite funny!

Oh yeah, you made my clung,
When you wan't see there love what's gone on the back falling

These spired on the light for seeing

Whatever you say, whatever you do, you're the one the different that feel
You're gonna take it
And you wanna feel right

The baby gone far, kiss in the rain, but you, back home
They'll never get back when you've go

So you have been work

They come back home
But hidden I can't be there
The baby give is all the give

There is no on the way mind
We clink to go do the back and long, come

Have fun!

More Repositories

1

pix2code

pix2code: Generating Code from a Graphical User Interface Screenshot
Python
11,927
star
2

Deep-Spying

Spying using Smartwatch and Deep Learning
Python
186
star
3

Air-Kinect-Gesture-Lib

Air Kinect Gesture Library
ActionScript
53
star
4

Cocos2D-Mask-Shader

Mask sprites with OpenGL ES 2.0 shader in Cocos2D
Objective-C
27
star
5

Supervised-End-to-end-Weight-sharing-for-StarCraft-II

StarCraft 2 AI Workshop
Python
21
star
6

Android-NFC-P2P-Communication

Android P2P communication over NFC
Java
16
star
7

Graphics-And-Vision

Computer graphics and computer vision (eye tracking, projective geometry, stereo vision)
Python
13
star
8

ExportSQLite

A plugin for MySQLWorkbench to export SQLite files
Lua
8
star
9

Cocos2D-Chipmunk-Scaffold

A scaffold project for Cocos2D iPhone Framework and Chipmunk physics engine.
Objective-C
6
star
10

The-Web-Copter-Experiment

Hardware-accelerated 3D graphics web experiment - Chrome Experiment
JavaScript
5
star
11

Custom-Simple-Captcha

Simple and flexible captcha system against dumb automated spambots
HTML
5
star
12

Connected-Mind-Neural-Network

Neuroevolution project implementing Evolutionary Algorithm and Genetic Algorithm
Java
4
star
13

Information-Retrieval-System

Information retrieval system, search engine, document classification, machine learning
Scala
4
star
14

Arduino-Remote-Controlled-Glass-Drum

Remote-controlled Servo motor and LED through Web Server using AJAX asynchronous request
Arduino
3
star
15

Android-Wear-Permissions-Bug

Permissions granted without being explicitely defined in the manifest file.
Java
3
star
16

BlackOutGobelins

Student project - iOS game that brings user's Facebook data to life
Objective-C
2
star
17

TMXResolutionTool

Command line tool to convert .tmx tile map files and images into different resolutions, Apple Retina display notation support
Objective-C
2
star
18

Ubiquitous-Media-Sharing-Surface

Exchanging images between smartphones on a shared surface
Java
1
star
19

Taco-DSL

The Taco domain specific language to generate surveys
Java
1
star
20

BlorkTheShmurph-GameCore

AIR game - 35h student project at Les Gobelins school
ActionScript
1
star