News for hackers. Stuff that matters.
Re:Generating inspirational quotes with Markov chains by suixo on Monday January 01, 2018 @05:28PM (#16048392)
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 :)

There are no comments on this comment yet.