Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Generating inspirational quotes with Markov chains (ramtin.xyz)
160 points by ramtinalami on Jan 1, 2018 | hide | past | favorite | 32 comments


In a similar vein, this is one of the most amusing use of Markov chains IMO: It is trained on the King James Bible and several Computer science textbooks:

http://kingjamesprogramming.tumblr.com/

So you get some gold like:

"And this I pray, that your love may abound yet more and more like a controlled use of shared memory."


I can't stop laughing at:

> they smote the city with the edge of the sword. 22:20 And one of his main motivations was the high cost of proprietary software houses.


More gold:

"I am Alpha and Omega, the beginning and the end, the first and third arguments"


More gems:

"8:29 And king Joram went back to the compiler."

"Using Lisp we restrict or limit not what we should pray for as we ought: but the Spirit itself maketh intercession for us."

And the not so politically correct: "Tools like pic2graph(1) can bundle together all the Jews that were in the uttermost part of heaven."


My favorite is this twitter account of titles for imaginary articles constructed from titles submitted to Hacker News.

https://twitter.com/HNTitles


I wonder if it knocks out exact matches to previous HN titles or if it could generate one eventually


I built a few generative Twitter bots with character level language models[1] (@steam_gaems for instance) and one problem is that they spit out phrases from the source text relatively frequently. So I included a function to re-generate the output if it matched any input phrases. Brute-force but effective.

[1] http://karpathy.github.io/2015/05/21/rnn-effectiveness/


lol, that's awesome. now we just need to train it to write the articles.


"‘mode lines’ — program status summaries carried on a highlighted screen line, often near the bottom or at the mouth of the LORD"

This is hilarious


This is a great article from a young person who is clearly learning by writing. Having good communication skills along with technical skills will make you invaluable in the workforce. We need this kind of popular science writing for computer science. Keep up the great work!


In the same spirit, I find http://inspirobot.me to be quite funny. Click "generate ".

A collection: https://www.instagram.com/inspirobotquotes/


"All that is needed to start a movement is sexuality and a fiddle."

Sounds legit to me. :)


"Nobody can jeopardize heroes."


I would like to introduce you to the world of computer generated content and commentary:

https://www.reddit.com/r/SubredditSimulator/


This is pretty amazing, thanks for the share


In our research group we mixed our PhD theses with Lovecraft fiction. While sometimes fun, it usually does not mix well, because Lovecraft writes in past tense and theses are in present tense.

Choose your sources wisely


My biggest problem with Markov chain generated text is the amount of simply grammatically nonsense output. For example “Grew up your bliss and the world.” as far as I can tell just doesn't parse


markov chain text generator + grammar checker = problem solved


Not necessarily true, for example: "Colorless green ideas sleep furiously"

https://en.wikipedia.org/wiki/Colorless_green_ideas_sleep_fu...


There is a slight issue with the provided code: if one sentence ends with a given word, then this word will always "terminate" any sentence, even if it is almost always inside a sentence.

Ex: "I like the letter i" will put "i" in the END dictionary, and as soon as this "word" gets picked up the sentence will be terminated, leading to incomplete / low-quality results :/

I like the trick of not using a weight or probability but just the number of occurrences of the world for in-sentences words (that don't scale well but are totally useful with small size training sets), maybe there is a way to reuse the same trick to not always terminate on such END words.

Good article :)


Considering the inanity of inspirational quotes, a Markov chain is the perfect generator for them.


We made something like this for a hackathon a year ago.

http://quoteraptor.herokuapp.com/WICSApp/


Recently on a slow Friday we trained Markov chains with our Slack history. We generated a separate chain for each Slack member. It culminated with a Slack channel emulator generating full chat logs of what members would typically say.

The programming in Python was suprisingly quick and easy, but we ended up wasting more time then expected by amusing ourselves with the results.

So if anyone’s thinking to try out Markov chains for text, I recommend taking Slack logs for training.


I actually made a slack bot to do this exact thing: https://github.com/ridhoq/ditto. It was a quick side project to learn Elixir so it’s a bit rough around the edge. I'm actually in the process of refactoring to use the new Events API. But it’s been pretty hilarious to see the responses get better and better over time. If anybody is interested and wants to put it on their Slack, I may try to put it in the Slack App directory thing.


These sorts of results are so easy to generate using simple ngrams. No machine learning necessary:

the best revenge is showing up.

hope is showing up with what you decide to plant.

live what you live

you cannot do what you miss when you are no one.

plant a journey not a worry

fill every beat with the edge.

the heartbeat of imagination makes us infinite

feel inferior without limits

the grass is a beginning

hope is a beginning. a fresh beginning. the best way. there. may you do

find your mind controls your mind controls your own sunshine

feel inferior without fear

conquer from within

go to bed with determination

turn your wounds into wisdom

the heartbeat of beautiful destinations

every day is always under construction


would be nice to use it in combination with fortune or if I could use it as login greeting. Load it up with the best quotes from the stoics, psalms, jesus sirach, the gospels, pauls letters and ecclesiastes and all the existing library. Put a good RND in front of it and you have a real Oracle greeting you whenever you want!


This is similar to my site http://www.poemgenerator.com. Not using markov chains but concept is similar.


I didn't get Markov chains until now. Thanks OP!


Link is auto-blocked by security software. Is this a known-misbehaving domain?


Probably the .xyz tld which a lot of software just straight up blocks


The results are not very convincing.


Not all of them, but:

    Someone must try to live forever.
    What are you waiting for?
is a doozy!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: