@990000 @SmudgeTheInsultCat it's quite simple. You can build a simple version yourself. Take a bunch of text files, count how often each word pair occurs versus the total number of word pairs: that's your frequency table. Now start from a word (the input) and from there close the next one by random number generation and going over the frequency table of pairs where the first of your seed, until you find the matching pair: that gives you the next word, repeat with the second as seed, forever. To make it stop, also record in the frequency table how often a word is terminal (has no next word), and stop generating when your random generator hits the terminal “pair”.
Congratulations, you got yourself a simple Markov chain. The only difference is that when you throw resources at the problem you can have longer chains (“deep” learning), and train (build the frequency tables) on more texts.