-
Notifications
You must be signed in to change notification settings - Fork 5
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
Random walk through syntax tree space #139
Comments
First step is getting pytracery to assign a unique path to each choice made in expanding the grammar. This is mostly done, but some assignment syntaxes produce an empty path for some reason. The code's jumping around in one file a lot, so I'm going to have to debug this in pycharm. |
Fixed! I wasn't passing path information through |
I've got a basic version working! Due to laptop issues I'm coding on an offline device, so no preview for now. To-do list:
|
Preview after the easier tasks above are completed, using the grammar from https://twitter.com/BokuWaKinoDesu :
I think this is a reasonably-themed grammar to use for this concept, but I have some different plans (and this grammar has some bugs and other undesirable qualities because I was still learning tracery). |
I've got a grammar written and it's looking good! Preview without weird punctuation:
with weird punctuation:
|
I think I prefer the weird punctuation one, but there's no reason not to generate both. They need a bit of capitalisation. |
It's done! Before the deadline! Just gotta get it uploaded :) |
Grammar: https://github.com/serin-delaunay/mutatery-nngm-2019/blob/master/definite_actual_grammar.json It's a bit weird for a Tracery grammar - It generates sentences from the inside out, starting with a basic SP VP phrase and wrapping layers around it. Ordinarily this wouldn't be necessary, but doing this affects the structure of the syntax tree space that this generator randomly walks in, allowing the inner words to be preserved when the surrounding phrase elements are mutated. |
Being in a rush, I forgot to use the nice capitaliser on the unpunctuated version or add full stops. Whoops! |
I like the way https://www.naturalreaders.com/online/ attempts to interpret the punctuated version! Might work for other NNGM entries as well. |
I don't know if I'll have time to finish this during the 11 hours remaining (it has been a busy November), but I plan to modify https://github.com/aparrish/pytracery so that I can save a tracery-generated syntax tree and randomly modify a single node (and generate any necessary descendants). Then I'll generate a sequence of phrases randomly walking around the state space of a tracery grammar. Not sure which grammar, probably something recursive!
I might also generate an independent random sequence of punctuation and intersperse that to break up the sentences and exploit any ambiguities in the text.
No repo yet!
=====================
Repository: https://github.com/serin-delaunay/mutatery-nngm-2019
Plain: https://github.com/serin-delaunay/mutatery-nngm-2019/blob/master/story.txt
Punctuated: https://github.com/serin-delaunay/mutatery-nngm-2019/blob/master/story_punctuated.txt
The text was updated successfully, but these errors were encountered: