Contents Domain Illustration Methods Conclusions
|
Domain
My agent is a storyteller. Its domain is that of words, as they fit together to form sentences. The storyteller has a very simple view of grammar. It sees sentences as consisting of three pieces that fit together: subject, verb and object. It has a small vocabulary, and it has some knowledge of which words make sense together. The stories this agent tells all have a similar form: They are funny tales with a moral. For example, the subject of the story never does something she is supposed to do, such as clean her plate at dinner, or take the garbage out. The storyteller starts with this premise, and builds a list of silly consequences to the character's actions. By the end of the story, the child has decided she will always do what she was supposed to, from now on. Why would you want to have an AI storyteller? A parent could use this as an alternative way of telling his or her child a bedtime story. A child could also use it on his own for entertainment. With a larger database of words, because of the random factors involved in building the stories, a wide, funny variety of stories is possible.
This is a prototype model, and I had some technical difficulties. The examples below are just a taste of the kind of thing the final version of my storyteller will be able to come up with.
Here are some examples of the "list of consequences" the storyteller builds. (Please excuse the unfinished format - in the final version, the display will be neater.) Consequences = [[[her,clothes],[wrinkled],[up]],[[her,sneakers],[twitched], [around,on,the,floor]],[[her,shirts],[twitched],[under,the,bed]], [[her,sneakers],[wrinkled],[up]],[[her,clothes],[twitched],[in,the,closet]], [[her,room],[grew],[hair]]] ? ; Consequences = [[[her,clothes],[wrinkled],[up]],[[her,sneakers],[twitched], [around,on,the,floor]],[[her,shirts],[twitched],[under,the,bed]], [[her,sneakers],[wrinkled],[up]],[[her,clothes],[twitched],[in,the,closet]], [[her,clothes],[grew],[mold]],[[her,clothes],[smelled],[like,feet]]] ? ; Here are some examples of what I call the "front half" of the story, which is basically the action plus the consequences. The complete story will be the front half plus a concluding sentence about how the subject of the story will always do whatever it was she was supposed to, from now on. Putting the whole thing together is what's causing problems right now, so that example will have to wait.
Front_Half = [[the,girl],[never,cleaned],[her,room],[[her,shirts],[smelled],
[like,feet]],[[her,shirts],[twitched],[under,the,bed]]],
My storyteller works by using a combination of random and non-random choices to build its sentences. Since it has rules for the allowed settings verbs can appear in, its main method is to choose a verb at random, then try to find a subject and object to suit the verb. One interesting thing about the random function is that it makes it even more important to order rules carefully. For example, when the storyteller is building a consequence sentence, it has to choose the verb first. The way my database is set up, if it tried to choose the subject first, it would then pick a verb at random, but if the subject it already chose happened not to suit the verb, it would fail, since the random function doesn't backtrack.
I started out with the grand idea to build a storyteller that would not only form a coherent and relatively complex story, but would also build grammatical sentences out of an accurate knowledge of English grammar. English grammar is immense and complicated all by itself, though. Needing to worry about a combination of grammar rules and the deeper semantic rules for when a sentence makes sense was overwhelming. When I got to thinking about what the difference is between a story and a string of sentences on a related subject, I started to see that just creating a story that made sense and had a plot was another huge task. The alternative I chose actually ended up being a simplified attack on both those fields, which was still tough, as you can see. One thing I started to have a better feeling for, though trial and error, was the way prolog actually works. I started out by writing rules prolog could never solve, sending it off to think forever or run out of memory. When I started ordering rules more intelligently, I began to actually get answers to my queries, which was somewhat of a relief. My relatively profound thought for the end of this project, then, is that in order to get a computer to do what a person wants it to do, the person has to think clearly (and think like the computer). I'm still working on that part... |