Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prose to poem #55

Open
superMDguy opened this issue Nov 8, 2018 · 2 comments
Open

Prose to poem #55

superMDguy opened this issue Nov 8, 2018 · 2 comments
Labels

Comments

@superMDguy
Copy link

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

@superMDguy
Copy link
Author

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

@superMDguy
Copy link
Author

superMDguy commented Nov 19, 2018

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

@hugovk hugovk added the preview label Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants