robbiebarrat / rapping-neural-network Goto Github PK
View Code? Open in Web Editor NEWRap song writing recurrent neural network trained on Kanye West's entire discography
Rap song writing recurrent neural network trained on Kanye West's entire discography
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?
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.
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?
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
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?
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.
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.
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
I got my terminal to play it, how did u save that file?
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]
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?
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.
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
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
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
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.
What could be a good rapper name for the ANN?
Deep Flow?
Fuzzy Logik?
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.
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!
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?
Hello, first of all, this work is cool ! Nice job !
I would like to ask what model is used by this project ?
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. :)
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?
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
Congrats on the great project and nice work.
Here is a nice dataset of Kanye lyrics which may help you
https://www.kaggle.com/viccalexander/kanyewestverses
Fantastic work so far, and looking forward to seeing how this progresses.
You should let people know that this package is required: https://pypi.python.org/pypi/pronouncing
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.