GithubHelp home page GithubHelp logo

robbiebarrat / rapping-neural-network Goto Github PK

View Code? Open in Web Editor NEW
1.0K 1.0K 168.0 18.44 MB

Rap song writing recurrent neural network trained on Kanye West's entire discography

Python 100.00%
generative-art learning lyrics machine mp3 neural-network rap rap-songs rhymes songs songwriting

rapping-neural-network's People

Contributors

jc1987 avatar robbiebarrat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rapping-neural-network's Issues

how do i run this program?

I would like to know how to run your program. i installed the latest python, i opened windows cmd, typed py but that's all i know how to do...Can you help me run your program?

Pybrain help

I'm having a problem running deeprap.py in terminal, I keep getting a "No module named 'structure'" error. And I have Pybrain version 0.3.3 installed on my mac.

Freezing on "word-by-word"

Using the following info I'm getting no progression (waited several hours) on a 300kb lyrics.txt file. Line by line works fine.

training = 0
epoch = 100
word_by_word = 1

Any suggestions on changes I could make?

anxcamera-permissions.xml

content://com.sec.android.app.myfiles.FileProvider/external/mnt/media_rw/420C-18FB/ANXCamera_v204R-2_alioth_fixed_portrait/system/etc/default-permissions/anxcamera-permissions.xml

Unique lyrics?

This script works well for reordering existing bars.

Does anyone know a way to generate unique lyrics?
Maybe by taking multiple lines and combining them, or using paraphrases?

max() arg is an empty sequence error when generating rap

Hi,
I got this error when I try to generate rap with my custom training data.

Traceback (most recent call last): File "documented_model.py", line 412, in <module> main(depth, train_mode) File "documented_model.py", line 405, in main rap = vectors_into_song(vectors, bars, rhyme_list) File "documented_model.py", line 356, in vectors_into_song max_score = max(fixed_score_list) ValueError: max() arg is an empty sequence

Do you have an Idea of where it come from ?

Thanks in Advance.

rhmyeindex() and rhyme() questions

As per @robbiebarrat's request, I am posting some questions I have about the Rapping Neural Network code in model.py so that others who may have the same questions in the future can see this.

Original Email:
Hello Robbie,

I am analyzing your code for your Rapping Neural Network project and trying to figure out what each part of your program does. Currently, I am stuck on the rhymeindex() and rhyme() functions in model.py. Near the end of the rhymeindex() function, you reverse the 2-letter endings in rhyme_master_list and sort them, then reverse them. However, when I print the rhyme_master_list on line 75 and the reverselist on line 77, reverselist is not the reversed 2-letter endings from rhyme_master_list and I'm not sure why that is. Overall on this last part, would you be able to explain the reasoning behind having the reverselist and what you are meaning to do here?

For the rhyme() function, I am confused as to what the purpose of the float_rhyme is. I see it is being used in build_dataset() to construct the 2x2 input for the network. But how does the LSTM use this to help construct a rap?

If you have time to explain these to me, I would be very grateful.

.rhymes file not getting rhymes

I modified some of the code to work (as this repo hasn't been updated in a while), and the training/generating works, other than the fact that the rhymes aren't saved and therefore the final rap doesn't rhyme. Granted, I am using 16000 lines of Eminem's discography, so that may be the issue. Thanks in advance anyone who can help.
Zipped Files:
Diss-Track-Rapping-NeuralNet.zip

TypeError: Received unknown keyword arguments: {'epochs': 5}

Hello!
Thanks for you work, it's really nice (especcially a idea of generating kanye songs :) )

But i have a trouble,
I'm trying to training model (by python model ), and after Alright, building the list of all the rhymes and show all bigram, get this:

Traceback (most recent call last):
File "model.py", line 300, in
main(depth, train_mode)

File "model.py", line 290, in main
train(x_data, y_data, model)

File "model.py", line 273, in train
verbose=1)

File "/usr/local/lib/python2.7/dist-packages/keras/models.py", line 661, in fit
str(kwargs))

TypeError: Received unknown keyword arguments: {'epochs': 5}

My environment:
Ubuntu 64bit,
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4]

Cannot generate new lyrics

I'd love to test the program but unfortunately I'm getting errors when I try to generate a new lyrics even with the default settings (as in without training it with new lyrics).

File "model.py", line 300, in <module> main(depth, train_mode) File "model.py", line 277, in main model = create_network(depth) File "model.py", line 29, in create_network model.load_weights(str(artist + ".rap")) File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 2701, in load_weights import h5py

I have tested it on a virtual environment and native, on a mac and on a linux (Ubuntu) but I'm getting the same error.
I'm using:
Python 2.7
Tensorflow 1.4.1
Keras 1.2.2
numpy 1.12.1

Any idea of what could be the cause of that?

OSX: No module named scipy

I got the following error when trying to run python deeprap.py on OSX.

I fixed the error by executing the following command: pip install scipy.

Maybe we can add scipy to the requirements.txt file.

Thanks for your work.

Freezing on word by word

I have edited my lyrics file so that when training the error message:
("Hm, for some reason we couldn't do anything with this line - remove symbols from it and try again: ")
doesnt show but when generating mode is on word by word still freezes
line by line works though

problem with model.py on python 3

So it didn't work at all on python 2 so i changed the code a little to make sure it runs on python 3 and after fixing some issues the train mode worked, but when i tried to generate lyrics i ran into a problem
File "model3f.py", line 219, in calculate_score
score = 1.0 - (abs((float(desired_syllables) - float(syllables))) + abs((float(desired_rhyme) - float(rhyme)))) - penalty
TypeError: float() argument must be a string or a number, not 'NoneType'

i guess the issue is in rhyme function, it runs into an exception and returns None, not float needed and that causes the problem, but i dont know how to fix it.
Any suggestions? here are model files i use (t is for train and f is for generation mode)
I also changed artist name and all "rap" words to "lyrics" , i guess it doesen't affect anything
neural network.zip

Unicode decode error

Hi,
Great job, i am trying to generate raps with default kanye lines but i have the following error:
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 42992: character maps to

thanks for your help

If epochs are defined, folder names stay default

First off, very nifty script and it's easy to work with. Maybe I'm misunderstanding something but when I define a specific epoch count

training = 1 #training of 0 means you just want to have it write a rap - training of 1 will train the network on the contents of lyrics.txt
epoch = 105 #this is just the number of the folder you would like to load (folder contains the trained net and rhymes)

I still get folders 100, 200, etc. (e.g., "just wrote 100/...").

Another question is when the training concludes? I'm up to epoch 400 now.

String index out of range

Hello,
I saw the #21 issue and I'm experiencing the same problem:
When i try to work with my lyrics (which are in french, for information), I've got this message:

Traceback (most recent call last):
  File "model.py", line 300, in <module>
    main(depth, train_mode)
  File "model.py", line 289, in main
    x_data, y_data = build_dataset(bars, rhyme_list)
  File "model.py", line 144, in build_dataset
    line_list = [line, syllables(line), rhyme(line, rhyme_list)]
  File "model.py", line 43, in syllables
    if word[0] in vowels:
IndexError: string index out of range

I tried to remove double spaces and I replaced "-" by "โ€”" but it still not work.

Rhyme with last 3 characters

Hi,
I wanted to use the rhyme for German Lyrics. Therefore it would make sense to use the last 3 characters of the last word for rhyming.
What do I need to change?
I changed two functions, rhymeindex:
rhymeslistends.append(i[-3:])
rhymescheme = word[-3:]
and rhyme:
rhymeslistends.append(i[-3:])
rhymescheme = word[-3:]
When I train the model the file .rhymes has a list of 3 characters. When I run the script for generating the rap it is just empty.
The function score returns nan as desired_syllables and desired_rhyme are nan. Could you give me an advice what to change as well?
Thanks!

Non-Rap

Could this be made to make non rap style lyrics? like say every rage against the machine lyrics were put in, would it turn into rap style lyrics?

Model Architecture ?

Hello, first of all, this work is cool ! Nice job !
I would like to ask what model is used by this project ?

String index out of range?

Hello! This may be a silly question, as I am indeed a fresh newbie. Sorry for the inconvenience!

I've been trying to train a new set of lyrics, but I get the error described below. I figured I must have done something wrong with my lyrics file, despite having checked for weird punctuation and symbols and anything else that stood out. But I can't find out what it is - I even tried adding lyrics to the original Kanye lyrics file and it will take some new lyrics and train fine but eventually I'll add one that makes it break. What could I possibly be doing wrong?

Traceback (most recent call last):
File "model.py", line 300, in
main(depth, train_mode)
File "model.py", line 289, in main
x_data, y_data = build_dataset(bars, rhyme_list)
File "model.py", line 144, in build_dataset
line_list = [line, syllables(line), rhyme(line, rhyme_list)]
File "model.py", line 43, in syllables
if word[0] in vowels:
IndexError: string index out of range

Congratulations on your work, thank you for your attention and again - sorry if this is too pedestrian! I'm still learning. :)

Error in running model.py

When I try to generate the lyrics, I get the error:

ValueError: Layer #0 (named "lstm_1" in the current model) was found to correspond to layer lstm_1 in the save file. However the new layer lstm_1 expects 12 weights, but the saved weights have 3 elements.

How can I correct this?

privapp-permissions-anxcamera.xml

content://com.sec.android.app.myfiles.FileProvider/external/mnt/media_rw/420C-18FB/ANXCamera_v204R-2_alioth_fixed_portrait/system/etc/permissions/privapp-permissions-anxcamera.xml

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.