I am trying to code a text char-rnn
in keras for that purpose I have to first convert text to sequence and then pad the sequence. But I am having a lot of trouble in implementing this step itself. I believe its because of my skewed or lack of understanding of this function (pad_sequence
) itself. I tried to google it and didnt find any good tutorial and their is not much explained in the keras docs also.
Can any one tell me how and what is pad_sequence
? Why we should pad the sequence (here character level) before feeding to.
Please consider this text as an example?
Take the 50-year-old man diagnosed with prostate cancer in my clinic at Brigham and Women's Hospital in Boston. He received a novel procedure to remove his prostate, and later received focused radiation to try to eradicate any remaining cancer. Unfortunately, his disease returned a year later. But after two new therapies, his cancer now appears in check. And if his cancer does spread, a host of other treatments — including many not even on the market yet — may put his cancer back in remission.