training a quick neural network to predict where to add poetic line breaks in text, based on a large corpus of public domain poetry and taking into account phonetics and semantics. the goal is to be able to enjamb prose passages in a somewhat principled way—after just a handful of epochs, here's what it does to a passage on hyacinths from wikipedia:
(there's a little bit of art in this—here I'm outputting a line break if the model's prediction was 0.25 or above. but I'm happy with the results so far!)
it *almost* gets "How Doth the Little Crocodile" right:
hmm, weirdly the more I push the accuracy on the training set, the less it produces the result I want on arbitrary prose. (bc there are stray prose snippets throughout the corpus, I think it might actually be learning the difference between prose and verse, whoops!) gonna try training again with *only* phonetic information about each word, maybe that will help
whoops I left the debug thing in where I printed out any words that weren't in the expected length limits
(and yes, I should probably train this on something other than my laptop but then I have to make the code pretty so I can copy it over and that takes more effort than just waiting. and it'll go faster once the results of finding the phonetic states is cached at the end of the first epoch)
Hometown is adapted from Mastodon, a decentralized social network with no ads, no corporate surveillance, and ethical design.