-
Notifications
You must be signed in to change notification settings - Fork 7
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
Prophet's Paradise #37
Comments
When humans craft prose (and especially poetry), they often use repetition to construct meaning. A classic example is the last two lines of Robert Frost's "Stopping By the Woods On a Snowy Evening." In "The Prophets' Paradise," the repetition (which almost always introduces some variation, either a reordering of phrases, dropping, adding, or changing an adjective or adverb, et cetera) is a lot of what adds a ritualistic and mystical quality to the writing. On the other hand, repetition is a common undesirable artifact of machine-generated work. So for me, I think the central problem I'm trying to address is creating a repetitious machine that doesn't seem mechanically repetitive -- the repetition should seem meaningful, and invite the reader to play off the repeated (and varied) elements to try to construct additional meaning in their mind. |
Last night I wrote a replacement grammar engine for Java (similar to Tracery), and a little L-System processor. I'm seeing that the biggest impact on this project is going to be developing and tuning good, large grammars and corpora, so I'm trying to build as much tooling around this as early as possible. The syntax for the replacement grammar is very natural (at least to me). It's basically a properties file (newline-delimited key-value pairs in the form key=value), where the key is a symbol, and the value is the replacement rule. Inside the rule, additional symbols can be inserted by name wrapped in square brackets. Any text or symbols inside parens are optional (50-50 chance of appearing). Segments inside parens divided by bars ("|") will be selected from (even chance for each option). In this sense, parens with no bar is really shorthand for "(optional text|)" Here's a sample grammar:
Piggybacking of the Java properties file format gets me proper trimming of leading and trailing whitespace (incl. whitespace around the first equal sign) and comments (demarcated with a "#") for free. The L-system processor is what I'm planning on using to define the form of my stanzas. It's syntax is much similar, also based on properties file.
Again, the bars are dividing different potential selections (so this is a stochastic system). It doesn't really have a concept of terminal vs. non-terminal symbols (I don't really need that for my purposes), you just feed it an iteration count. If a symbol in the input doesn't have a rule in the grammar, it just gets copied to the output. So with a properly designed grammar and sufficient iterations, you could end up with all terminal symbols, but the engine won't detect that for you. |
Things are beginning to come together. I combined together a grammar and an L-system to compose a stanza generator. Right now I have it generating boring little prose poems about nature. Here's an example:
The title and each line are generated by a replacement grammar, and the order of the lines and their repetition is generated by an L-system. The end goal is to produce output like this where when each line repeats it mutates in some way (reorganization of clauses, changing a word, lobbing off a clause, et cetera). This will require retaining some of the structural information about how the line is created, not just the string, so that individual elements can be tweaked. Yesterday I also wrote an algorithm for selecting from corpora without replacement, and a system for inflecting terms (e.g. for case, tense, number, et cetera). Need to combine that together with a big to-do item which is a reference system (for symbolism, imagery, character, time and place, et cetera). |
I really like that output! Is that example representative?
…On Fri, Nov 3, 2017 at 12:36 PM dougvalenta ***@***.***> wrote:
Things are beginning to come together. I combined together a grammar and
an L-system to compose a stanza generator. Right now I have it generating
boring little prose poems about nature. Here's an example:
"Ode to a Pond"
O, twisting boughs.
Worried reeds tangling wildly.
Softly, needles.
Worried reeds tangling wildly.
O, twisting boughs.
Eerily, green boughs bobbing.
The title and each line are generated by a replacement grammar, and the
order of the lines and their repetition is generated by an L-system.
The end goal is to produce output like this where when each line repeats
it mutates in some way (reorganization of clauses, changing a word, lobbing
off a clause, et cetera). This will require retaining some of the
structural information about how the line is created, not just the string,
so that individual elements can be tweaked.
Yesterday I also wrote an algorithm for selecting from corpora without
replacement, and a system for inflecting terms (e.g. for case, tense,
number, et cetera). Need to combine that together with a big to-do item
which is a reference system (for symbolism, imagery, character, time and
place, et cetera).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#37 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAd6GUNKzqHr28UYGvJ_KKJOMY3fd-L0ks5sy0DzgaJpZM4QMHRB>
.
|
It's a fairly representative example of what I'm outputting right now, but not at all of what my end goal is. (Not sure which you meant.) Here's the grammar I'm working with (syntax explained above):
Some of the poems generated by this grammar are a little boring, but this isn't the grammar (or even the full line generation method, just one of the technologies) I'll be using for my final product, so I'm ready to move on. |
Okay, getting somewhere. Now on each appearance, each repeated line chooses a new "template," which determines phrase order and inclusion and punctuation, but the phrases themselves are retained from appearance to appearance. Still not where I want to be, but a functioning technique:
The pattern of lines is ABABA, but each time a line repeats it is rephrased. |
Took the day off, but was getting some interesting output last night, now aping the symbolist mood of Chambers:
|
Inspired by "The Prophet's Paradise" from The King in Yellow. I'm interested in creating a machine that can output an enigmatic, repetitious prose poem in response to a prompt. At the end I'll compile 50k words of whatever it spits out.
The text was updated successfully, but these errors were encountered: