Photo by Thomas Lefebvre on Unsplash
Making computer generated text mimic human speech using Markov Chain is a fascinating and actually not that difficult for an effect that is sometimes convincing, but certainly entertaining. Markov Chains work by generating sentences based on recombination of elements of history of known sentences to generate meaningful sentences.
What’s really interesting, is that you can combine texts from two different people and get a mixed “voice”.
I played around this with texts of speeches from two great presidents:
Image of courtesy of screentv.com
What my text generator came up with from Obama speeches and Bartlet scripts, is as follows:
You can find a detailed explanation of how it works and also how to create one yourself at DrMysterian.com site: How to code a Markov Text Generator.
Otherwise, you can find the source code here.
Thanks for reading! If you like what you read, give a clap below so that others may find this (you can also find me on Twitter )