Playing with Markov chains;
sentences generated from journal entries :)
@joshavanier ghosts are indeed the fluffiest
haha I love markov-chain-based texts. the algorithm is simple and the results are usually amazing.
do you mind telling us more or less how do you build the chain?
(I did one a while ago with some texts of Roberto Arlt here http://say-something-arlt.herokuapp.com/ but I remember I struggled a bit to not make it enter in endless loops, and to control the amount of possible variations (I remember that I used a config parameter that makes it aware of the n previous words, but having it higher than 2 was just extracting literal phrases from the book most of the time :( )
@f3r This is cool. How big is your dataset?
I parsed the first 3 chapters from "Los siete locos" from here: http://biblioteca.derechoaleer.org/biblioteca/roberto-arlt/los-siete-locos/capitulo-primero.html
I have the chain dumped to a file, I can take some numbers out if you are interested
@f3r Sure, that'd be wonderful. Thanks :)
@joshavanier Ok, I took a look. The structure is very similar to what you have, pair of words associated to possible next words.
It has 47905 pairs.
40442 of those pairs have a single option as next word (I guess that's why it generates almost always textual extracts)
There's one entry that has 4127 possibilities. When I took a look, I found out it was a triple space 🤷♂️
looks like if I do a more intelligent parsing and some cleanup of the model it might return more interesting results :)
@joshavanier I can upload the code somewhere if you are interested (CW: is quite hacky and zero-polished :P)
@f3r That's a lot of pairs. Sounds like there's more to your implementation than what I have; I'd love to look at it
It's nothing fancy
@f3r I just split my journal entries into word pairs + an ending word so that sentence like "W X Y Z" would be:
Then it's just a little recursion:
- Choose a word
- Filter the model; you only want phrases that start with the chosen word
- Choose a random phrase from that and use that phrase's 2nd word as the new chosen word and repeat
The recursion ends if the randomly chosen phrase is just a single word.
Revel in the marvels of the universe. We are a collective of forward-thinking individuals who strive to better ourselves and our surroundings through constant creation. We express ourselves through music, art, games, and writing. We also put great value in play. A warm welcome to any like-minded people who feel these ideals resonate with them. Check out our Patreon to see our donations.