2018 icon indicating copy to clipboard operation
2018 copied to clipboard

Prose to poem

Open superMDguy opened this issue 7 years ago • 2 comments

I think it'd be cool to take prose and mess around with synonyms until it fits into some poetry scheme.

superMDguy avatar Nov 08 '18 20:11 superMDguy

I pushed my initial work here. So far, it can recognize iambic pentameter, and try to transform a given line into iambic pentameter.

superMDguy avatar Nov 08 '18 20:11 superMDguy

I've gotten it into a much more working state, and the results are actually pretty cool in some places. Here's an example of Pride and Prejudice transformed into dactylic meter (DUM dum dum DUM dum dum):

joy and presumptions by jessica caroline epilogue it is a falsehood uncommonly recognised that a one manthe in possessions of a so-so riches should be in intend of a son-in-law only bit famous the moods or views of such a manthe should be on his next exits a neighbour this falsehood is so well resolved in the brains of the ... some three or other of their sons-in-law my dear oliver bartram remarked his maid to him three night have you uttered that parks is allow at preceding scott bartram scowled that he had not but it is reappeared she for cudahy longer has just been here and she reminded me ... not should to know who has taken it sobbing his son-in-law waiting you should to distinguish me and i have no refutation to deaf it this was invitees insufficient why my dear you should know pauline loong admits that is taken by a inexperienced manthe of small luck from the eastern of germany that he saw down on september in a couch and several to seeing the spot and was ...

It uses Word2Vec to come up with possible replacements for each word in a sentence, then runs through every possible combination until it comes up with something that matches the meter. I also added some logic to break it up into chunks of already properly metered sections, to save compute time.

There are a few issues I'm trying to fix:

  • [ ] As part of the process, I make all words lowercase, and strip whitespace and punctuation. I want to try to get some of this back.
  • [ ] There are some really weird words in the word vectors I'm using, like "manthe" in the sample above. I might try other word vectors.
  • [ ] It's super slow, since it's using a brute force approach. The above sample took about a minute to create.
  • [ ] I feel like the quality of the results could be improved

superMDguy avatar Nov 19 '18 03:11 superMDguy