How can I improve this word-prediction AI?
Seems like recurrent neural networks (RNN) should work for your use case. An excellent introduction is available at: The Unreasonable Effectiveness of Recurrent Neural Networks