Which algorithm for predicting the next word(s) based on previous words, given a sentence?
You can use anything you like.  Right now neural networks are the state of the art: they produce the best predictions.  But you could also use HMMs, or n-grams, or other methods; they just will be lower quality than a state-of-the-art neural network.