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

2d Markov #125

Open
enkiv2 opened this issue Nov 29, 2017 · 2 comments
Open

2d Markov #125

enkiv2 opened this issue Nov 29, 2017 · 2 comments
Labels
completed For completed novels!

Comments

@enkiv2
Copy link

enkiv2 commented Nov 29, 2017

I treat an input as a 2d array -- lines vs words -- and pad it so that all of the lines are of the maximum length. Then, I make a markov model wherein, for each word, I keep track of the words that occur above, below, before, and after.

To generate the output, I create a blank word array of equivalent size, seed exactly one cell from the input, and then fill in the rest of the document by cross formations -- starting from the seeded cell, I fill in all four adjacent sections (by randomly choosing from the markov model, with the existing item in that cell -- if any -- added as an option), and then proceed in all directions.

Code: https://github.com/enkiv2/misc/blob/master/nanogenmo-2017/2d-markov.py
Output: https://github.com/enkiv2/misc/blob/master/nanogenmo-2017/2dneuro.txt

Next steps: I would like to use word2vec to sum the existing word with the newly chosen option, rather than typically replacing it altogether.

@enkiv2
Copy link
Author

enkiv2 commented Nov 29, 2017

Added suport for word2vec interpolation.

Output: https://github.com/enkiv2/misc/blob/master/nanogenmo-2017/2dneuro-2.txt

@enkiv2
Copy link
Author

enkiv2 commented Nov 29, 2017

To make it a little clearer, I made a tabular version:

http://www.lord-enki.net/2dneuro.html

http://www.lord-enki.net/2dneuro-2.html

@hugovk hugovk added the completed For completed novels! label Dec 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed For completed novels!
Projects
None yet
Development

No branches or pull requests

2 participants