Zen Markov Machine

Today I used the requests and BeautifulSoup Python libraries to harvest 101 Zen koans.  Next I used the NLTK and markovify libraries to generate random statements:

This code lives on my machine and assumes a directory of text files to process (and Star-Trek is one!)  Anyway, here are some Markov generated Zen statements:

Pretty vague/schizophrenic…  Here are a couple choice ones though:

  • “Study Zen in that instant.”
  • “When witnessing the good action of another, advise yourself.”

Anyway, after studying the output of this over different groups of documents, I have found that the works of Shakespeare offer the best simulated sentences:

Haha :-)

What about the Meditations by Marcus Aurelius?

Hmmm.