http://mrmarkov.herokuapp.com/text<p>Hi all, this is a personal project I've been working on for two weeks or so. I was interested in Markov Chains, and came across their use to generate text, and also wanted to learn how to create an API. So, I combined the two to make an API that generates random text based on text you submit to it.<p>To generate your own text with this, just submit a POST request to the above URL with the original text you want to use as the base text to generate new text. For example (using Requests from Python):<p>import requests<p>payload = {'original_text':'''This is a test. This is only a test. This is my test.'''}<p>requests.post("http://mrmarkov.herokuapp.com/text",data=payload)<p>Longer pieces of text, such as paragraphs from Shakespeare or Wikipedia generate more realistic sentences.<p>The response will have a field called "sentence", which will contain the generated text. Try it out! Let me know what you think!
Hi all! I changed the return field's name to 'generated_text' for clarity! I can't edit the original post, sorry for the confusion.