It is a neural network trained, in part, against the text in the game manual.
Of course, it's considerably more complex than that in the theory and implementation. :D