Proponents of conceptual analysis argue that the goal of parsing is to extract meaning and that semantic expectations play the primary role in guiding parsing. This part of the assignment applies a knowledge representation that provides those expectations--Conceptual Dependency theory (CD)---to the parsing process.
Your first task involves practice at writing conceptual dependency and writing requests to extend the vocabulary of a conceptual analyzer. We provide a scheme version of the simple conceptual analyzer, MicroELI [Schank and Riesbeck, 81]. Its code has been annotated with numerous comments on the process and representations used. MicroELI is a "micro" version of Riesbeck's conceptual analyzer ELI (English Language Interpreter).
An important note about microprograms: "Microprograms" are distillations of landmark AI programs into very simple forms that illustrate key aspects of their processing. Working with them gives a a hands-on understanding of the basic framework without the overhead of building the system from scratch or analyzing a huge program. However, it is important to always keep in mind that they are only distillations, not the programs themselves---the original programs should not be judged by the microprograms. The original programs are tens of thousands of lines of code, with very subtle mechanisms and a lot of knowledge, involving many person-years of work. The microprograms are a few hundred lines with almost no knowledge. An interesting question to think about as you go over their code is what is missing: what would be needed to scale these up to full-fledged systems again, and how could it be done?
Trying out MicroELI: Load MicroELI and test it by typing (PROCESS-TEXT KITE-TEXT). KITE-TEXT contains the CD equivalent of the story:
Jack went to the store.In the output trace, observe how expectations drive parsing. Note also that the parse is successful despite the program's lack of definitions for some of the words in the story (e.g., for the word ``to'').
He got a kite.
He went home.
In a conceptual analyzer, the dictionary of requests is the main source of knowledge. In this assignment we will study that knowledge and how it is used:
Jack went to a restaurant.
He ordered a lobster.
He left.
Add to MicroELI's dictionary the definition for the verb HAD so that ``Jack had a kite.'' becomes
(POSSESS (ACTOR (PERSON (NAME (JACK)))) (OBJECT (KITE)))
But ``Jack had a lobster.'' becomes
(INGEST (ACTOR (PERSON (NAME (JACK))))
(OBJECT (LOBSTER)))
Also define requests so that ``had'' is interpreted as ``ingest'' for the sentences ``Jack had beef'' and ``Jack had steak.'' In a full-scale conceptual analyzer, this information would be stored at the appropriate level of generality in an abstraction hierarchy. However, you may simply use an association list pairing classes (e.g., "food") with lists of instances.
Note: McELI doesn't support variables in the headers of CD forms. Consequently, your requests can't change the primitive act by using a variable to be assigned later. Instead, your solution will have to replace the entire CD form if a different meaning applies, reusing accumulated information.
Micro-SAM processes Conceptual Dependency input and stores a CD representation of its understanding in its memory. We have prepared a scheme version of micro-SAM to use as the starting point for your work in this part.
You will first write a simple script for micro-SAM, then combine micro-SAM with micro-ELI to form a script-based story understander that can understand simple stories in English, and finally give it a simple facility for generating natural language summarizies of stories. You will also examine the relationship of this small model to some of the hard problems for natual language processing, and how to apply knowledge to address them.
The script should have the roles RESTAURANT, DINER, WAITER, and MEAL (and any other roles you consider necessary). Add the restaurant script to micro-SAM's script library.
Jack went to a restaurant.Write a top-level function PROCESS-ENGLISH-STORY that takes list of English sentences as input, runs micro-ELI on those sentences to produce a CD representation, and then runs micro-SAM on the CD representation to understand the story.
He ordered a lobster.
He left.
Process the story of Jack's dinner. Afterwards, the memory should contain
instantiations of all the CDs in your restaurant script.
Thinking
critically about the system: (Not to be handed in) At this point you
have a skeletal story understander. What is missing? What doesn't work the way
it should? Experiment with it to see what you can find out before proceeding
to the next questions, which identifies one problem and has you suggest
approaches to repair it.