Assignment 8: javaKARMA
Assigned Wednesday, April 12th
Due Wednesday, April 19th, by 11:59pm - submit electronically.


This assignment involves the use of Srini Narayanan's model for metaphoric interpretation. Please read O6 in your reader before starting this assignment. You should also allow yourself plenty of time in the lab to complete the assignment.


Part I: Metaphor alternatives

    The system outlined in class and the paper and the program you will be running for this assignment have x-schema executions setting source domain feature values, which then get projected via metaphors onto the target domain. An alternative design would be to have separate entries corresponding to each domain in which a lexical item can be used. In the case of stumble, for instance, you could have one entry in the domain of spatial motion and another in the domain of abstract actions (such as economic policies). Then the program could just check to see which domain applies and retrieve the appropriate meaning. This would avoid the need to represent and use metaphors in language understanding.

    Problem 1

    Briefly (~1-2 paragraphs) give the pros and cons of such a scheme. In particular, when will such a design be better than the system described in class? Be as specific as you can in your answer. Extra credit will be given for concrete examples to support your case (either way).


Part 2: Getting Started
To get started on the assignment, you will need to get and install a copy of the program in your directory. To do this you should:
  1. Log in to a PC machine running Solaris in Room 275 or 277 Soda. (See the note above about running the system elsewhere.)
  2. At this point you may need to open a terminal window if there isn't one already there. If you don't know how to do this, ask someone for help. (A command like "xterm" or "terminal window" may be available in a menu that appears when you click on the desktop with one of the mouse buttons.)
  3. Copy the file met.tar.gz to your directory:
    cp ~cs182/programs/met.tar.gz . (don't forget the period at the end)

You may also download met.tar.gz here. (This is the same as the version available on the EECS instructional system.)

Note: if at some point in the process you get a message saying that you are over the disk quota, you should erase some of your previous files from the account, such as the .netscape/cache files.

  1. Uncompress and install the program: (the tar command must be run in your home directory. Not a subdirectory because of java issues)
    gunzip met.tar.gz
    tar -xvf met.tar (be patient -- this may take a little while)
  2. Type cd met to get to the right directory (met needs to be a subdirectory off of your home directory).
  3. Type javaKARMA to start the program. (If you get a Command not found error, you might try ./javaKARMA.)

Part 3: Basic operation
Sometimes the javabayes window doesn't update after you issue a command through the console, so just minimize and then restore the window to see the updates (especially important if you don't see anything happening after you run the inference).

If you survived the installation, you will see two windows, one that displays the net you will be using (labeled "JavaBayes Editor") and the other that is a console for interaction and help (labeled "KARMA Console"). The network window will henceforth be referred to as the Network and the text window as the Console.

You will be mainly working in the Console window and observing color changes in the Network window. You are of course welcome to play in the Network window, with the understanding that if you modify the network, you will be responsible for recreating the original; make sure you copy the network file to a backup if you decide to play around with the network. See here for some other options.

Network window

In the Network window, you will notice a bunch of columns of nodes:

If you know the POLICY (Liberalization) of a Government, you know the GOAL (Unregulated_freetrade) of the policy.

is represented as the link between the POLICY and GOAL variables in the target domain network. Note that there are links between nodes in different time slices of the target domain network. Many of these correspond to temporal persistence links. All links are quantified by conditional probabilities as explained in class.

For details of the variables and constraints see Description of Network Features. Note that you can also click on the "Observe" bar at the top of the screen and then click on any node to see its possible values (including whether the value has been known or inferred); initially no values will be known or inferred.

Console window

In the Console window, you will need to use only two of the menus shown across the top:

The main point of interaction will be the Input F-struct menu. The Input F-structmenu has options that correspond to the semantic features and values of the linguistic input. For instance, the input sentence (or headline) Indian government stumbling in liberalization plan has features and values:

Actor -> Indian Government
Source Domain Schema Name and Parameters -> Event = Stumble -> Stumble Aspect -> Progressive (be + Stumbling)
Source Domain Schema Name and Parameters -> Event = Stumble -> Stumble Path -> in Liberalization Plan

Similarly the input sentence US Economy Crawling has features and values:

Actor -> US Economy
Source Domain Schema Name and Parameters -> Event = Self Propelled Motion -> Motion Type/Manner -> Motion = Crawl
Source Domain Schema Name and Parameters -> Event = Self Propelled Motion -> Motion Aspect -> Progressive

While you input this information, you may notice some text on the Console that informs you of the program's response to your input. You will also notice that some of the nodes in the Network have changed color from their rather staid yellow to a bright blue or green, and yet others have turned completely red! Not to worry. This is the result of x-schema executions and metaphor projections to the belief network.

The conventions on node color are as follows:

After staring at the colors for a suitable length of time, you can go to the Console and select "Inference -> Do Inference" from the menu bar. This will print the direct input (blue node) values and direct metaphoric projections (green node) values to the Console, along with the best estimates of indirect inference values (red nodes). If you want to save your session at any time to a file, just use the "Saving the Session -> Save Console to File" option.

If you want to examine the probability of a node not in the above set (not required for the assignment), just select Options -> Individual Node Probabilities from the Console menu and then select Query in the Network window. Click on any node from the Network window to get the posterior probability distribution for this specific variable. 


Questions
Each of the following problems involves experimentation with some example inputs. In each case, you should:

Problem 2: Aspectual inferences

  1. What is the (linguistic) difference between Germany is on the verge of stumbling into recession and Germany is stumbling into recession?
    How does the KARMA program capture this difference?
  2. What is the (linguistic) difference between France started to fall into recession and France has fallen into recession? How does the KARMA program capture this difference?

Problem 3: X-schema parameters

  1. The following sentences differ only in the manner of motion expressed:

What feature in the target domain is most affected by the specific manner of motion involved? How do the metaphoric inferences differ for these sentences? How does the KARMA program capture this difference?

  1. What is the (linguistic) difference between France fell into recession and France walked into recession? How does the KARMA program capture this difference?

Problem 4: Multiple events

For this problem, you will process multiple inputs (two of them *). The only change from the previous instructions is that you SHOULD NOT reset the network between the two inputs. After the two inputs have been entered you should do Inference -> Do Inference and save the session if you want as before. Then select Network Options -> Reset Network... to process the next sequence of events.

For each sentence, briefly describe the metaphoric inferences made by the system.

Problem 5: Novel Input

Find a headline/blurb from a recent newspaper article that you think can be interpreted by the system. Enter the appropriate f-struct for your input and observe the behavior of the system for your input. Describe and analyze the system's behavior, noting especially whether it performed as expected.

Problem 6: New metaphors

Consider the following :

These sentences all involve extending the KARMA system.

  1. Identify the metaphor used in these sentences, and give a systematic list of the mappings in terms of frame semantics.
  2. Suppose you wanted to modify the KARMA system to handle these sentences and make inferences about them.  What X-Schema's would have to be added?
  3. Give an example of a Bayes net that could be used to reason about this domain.
  4. What would be the mappings between the X-Schema's from part 2) and the Bayes net from part 3)?

Extra sentences

This section is not part of the assignment; some additional input sentences/headlines you may wish to explore are included here.  


Readings:
Reader: O6 


Reloading the network

To reload the network from scratch for any reason (without quitting the program), click on the "Network Options -> Open ..." option, and this will open up a file dialog box. Select (or type) the filename "met-rep" into the dialog, and this will reload the original network. The menu item entitled "Options" allows you to play with various options. You can look at an individual node and its probability distribution, or find the best posterior explanation for all the nodes. For the assignment, you will probably not need this menu at all. However, you are welcome to experiment with it and may in fact find some of the other inference options helpful for understanding how the system works. You can save your entire session to a file by selecting "Saving The Session -> Save Console to file", which opens up a file dialog box and sends the contents of the console to the selected/typed file.

*Note: Unfortuantely, memory and class-specific constraints allow for only two inputs, but you should be able to visualize how a larger sequence can be handled. Potentially a fairly long dependency chain can be established during the course of a narrative, and such an ability to use the current state as context for the next input turns out to be vital.