robbiebarrat / rapping-neural-network

Rap song writing recurrent neural network trained on Kanye West's entire discography
1.04k stars 167 forks source link

String index out of range #23

Open Conobi opened 6 years ago

Conobi commented 6 years ago

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.

Hunterwolf88 commented 5 years ago

same issue here, I tried to fix everything, from double spaces to ".." or other uncommon characters, but can't find any solution. I tried to:

remove any non-ascii character remove all double non alphabetical characters convert all numbers in words remove punctuation remove spaces before new lines " /n"

Basically now I have only letters and '

joeycurnutt commented 2 years ago

No luck? Same issue here and got frustrated so I just tossed in a try: except: