

Show HN: MrMarkov (Markov Text Generator as an API) - binalpatel

http:&#x2F;&#x2F;mrmarkov.herokuapp.com&#x2F;text<p>Hi all, this is a personal project I&#x27;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 = {&#x27;original_text&#x27;:&#x27;&#x27;&#x27;This is a test. This is only a test. This is my test.&#x27;&#x27;&#x27;}<p>requests.post(&quot;http:&#x2F;&#x2F;mrmarkov.herokuapp.com&#x2F;text&quot;,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 &quot;sentence&quot;, which will contain the generated text. Try it out! Let me know what you think!
======
binalpatel
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.

