The word language modeling link 100 is a relevant example to predict next work.
To build vocab on multiple books, yes, you are right to put the sentences together in corpus. If you like, you could also use the vocab class in torchtext. An example to build vocab based on wikipedia is here 9