Downloading novels/books that will be used as input text
In this recipe, we will go the steps that we need to download the novels/books which we will use as input text for the execution of this recipe.
Getting ready
- Place the input data in the form of a
.txt
file in the working directory. - The input may be any kind of text, such as song lyrics, novels, magazine articles, and source code.
- Most of the classical texts are no longer protected by copyright and may be downloaded for free and used in experiments. The best place to get access to free books is Project Gutenberg.
- In this chapter, we will be using The Jungle book by Rudyard Kipling as the input to train our model and generate statistically similar text as output. The following screenshot shows you how to download the necessary file in
.txt
format:
- After visiting the website and searching for the required book, click on
Plain Text UTF-8
and download it. UTF-8 basically specifies the type of encoding. The text may be copied and pasted or saved...