Tuesday, October 4, 2011

How does a Talking Owl reply to a query?

After much consideration, I've re-thought the basic top-level steps involved when a Talking Owl chatterbot has to respond to a query. I've outlined the basic steps, with my basic top-level PHP code, using this nifty Visio chart. What can I say? I'm an artist at heart. Talking Owl Project Process Map The columns on the right side represent which components of a Talking Owl brain are involved in that particular step. I think this sequence of events is much simpler than the one I had previously conceived of. It just goes to show how important it is to choose the correct top-level object model. It can make a huge difference in the ultimate complexity of the code. As you can see, in this version, apart from basic "code infrastructure" steps (e.g. creating objects, logging events), understanding a query takes place in five very straight-forward and intuitive steps:
  • Determine the structure of the sentence
  • Use your knowledge to understand what that structure means
  • Use your background knowledge to make inferences
  • Learn new facts based on what was said
  • Generate a reply
The first step involves your knowledge of what words means (Synsets) and your knowledge of how to break sentences into pieces (Parser). The second step uses your representation of the syntax of the sentence and combines it with your knowledge of "semantic frames" to generate the meaning of the sentence. In the third step you combine the meaning of the sentence with other world knowledge to come to conclusions, and in the fourth step you store some of that new knowledge in long-term memory for later. Finally, based on your complete representation in memory, you generate an appropriate response. Of course, the devil is in the details, eh? Still, it's a good start.

No comments:

Post a Comment