February 14, 2026
Part 10.3: Text Generation with LSTM
The text is read into the variable processed_text.
an array of sequences and and an array of next_chars are generated.
The sequences array contains 40 characters of processed_text, where each successive element is adavanced by 4
characters.
The next_chars array contains the subsequent character for each of the sequences.
Example:
| sequences |
next_chars |
| 'the project gutenberg ebook of treasure ' |
i |
| ' project gutenberg ebook of treasure isl' |
a |
| 'oject gutenberg ebook of treasure island' |
, |
| 'ct gutenberg ebook of treasure island, b' |
y |
| 'gutenberg ebook of treasure island, by r' |
o |