Assignment 8: javaKARMA
Assigned Thursday, April 17th
Due Thursday, April 24th, 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.

  • You may work together with a partner for this assignment to use the KARMA program, but you should answer questions separately and submit individual assignments. (Please be sure to indicate your partner's name on your assignment.)
  • This assignment should run on your home computer (it is written in Java, so it should be portable), but we know that it works in the Soda Hall labs.
  • Please check back to this page periodically for possible updates to the assignment.
  • See here for some basic UNIX commands.


1. Frame semantics and Metaphor

 Frame Semantics

Briefly describe the frame semantics of the concept Journey:

    • List the semantic roles, and any constraints on or properties of those roles.
    • Describe the basic scenario structure.
    • List any relationships that hold among the semantic roles.
    • List any presuppositions.

Additional tip: see here for an example frame.
 


Event Structure Metaphor

 

Here is the locative version of the basic event structure metaphor (ESM):

 

Target Domain (event structure)

Source Domain (physical space)

States

Locations (interiors of bounded regions in space)

Changes

Movements (into or out of bounded regions)

Causes

Forces

Causation

Forced Movement (from one location to another)

Actions

Self-propelled Movements

Purposes

Destinations

Means

Paths

Difficulties

Impediments to Motion

Freedom of Action

Lack of Impediments to Motion

External Events

Large, Moving Objects (that exert force)

Long-term Purposeful Activities

Journeys

  1. Show how the ESM maps the Journey frame onto the domain of events: take the Journey frame you described for Part I and show the target domain frame that results from applying the Event Structure Metaphor. (That is, the frame of Events as structured by the ESM.)

 2. Running the KARMA demo

 

Getting Started

    1. 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 download the "met" program: met.tar.gz or met.zip.
    2. Unpack the program: gtar xzf met.tar.gz or unzip met.zip
    3. Type cd met to get to the right directory.
    4. Type java -jar met.jar met-rep to start the program. (met-rep is the network we will be working on)

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.


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:

    1. The rightmost column (entitled SOURCE F-STRUCT) contains nodes that correspond to features of the source domain (there are actually two: spatial motion and health). These features are set by x-schema executions for a specific input sentence.
    2. The next column to the left is entitled METAPHOR MAPS. Most of the nodes in this column correspond to a part of the Event Structure Metaphor we studied in class. They project source domain feature values to the target domain.
    3. The three leftmost columns in the Network window correspond to three time slices of the target domain f-struct, where the target domain is the domain of international economic policies. Arrows between nodes within a time slice of the target domain correspond to dependencies between features in the domain. For instance, the following economic fact:

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

This knowledge 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.

Console window

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

    1. Using the Input F-struct menu at the top left, you will enter f-structs (feature-value pairs) corresponding to input sentences.
    2. Using the Network Options menu, you will use the Reset Network... item to reinitialize the network for new input.

The main point of interaction will be the Input F-struct menu. The Input F-struct menu 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:

·         Nodes that are not affected in the current context are shown in Yellow.

·         Direct input (such as Actor = Indian Government, or Event = Fall) are shown in Blue.

·         Active metaphors (such as FALL_IS_FAIL) are shown in Cyan.

·         Metaphoric inferences (such as "stumble" implying the presence of an obstacle that is projected to a target domain difficulty) are shown in Green.

·         Target domain nodes whose probability changes as a result of metaphoric inference are shown in red. For example, the inference corresponding to the Outcome at time 2 (OUTCOME(2), when a difficulty is asserted at time 1 (DIFF(1)) is shown in red.

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. 


3.  Questions on the demo

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

·         For most questions, you must reset the network after every example using Network Options -> Reset Network. For problem 3.3, you will not reset the network.

·         Enter the F-struct by selecting appropriate items from the Input F-struct menu. You must use your understanding of the sentence to derive the correct F-struct, as we did above in the examples about the Indian government and the US economy.

·         Examine the Network window to see what nodes have been affected (noting in particular any green nodes indicating metaphoric inferences; you can check these values by clicking on the appropriate node while in the "Observe" mode in that window.

·         Run the inference query (Inference -> Do Inference) and note any additional inferences that have been made (these correspond to values of the red nodes and are displayed in the Console).

·         Answer the corresponding questions. Try to give explanations in terms of the model, making use of the results of your experimentation as appropriate.

3.1 Aspectual inferences

a.       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?

b.      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?

3.2 X-schema parameters

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

o        The U.S. economy is crawling.

o        The U.S. economy is at a standstill.

o        The U.S. economy is sprinting.

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?

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

3.3 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.

·         US Economy was at a standstill, but it is now sprinting.

·         France fell into recession, but has now recovered.

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

3.4 New metaphors

Consider the following :

·         U.S. economic ills cured.

·         The Economy is healthy again.

·         Free trade is the best therapy.

These sentences all involve extending the KARMA demo 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.      Show how you would extend the Bayes net for the target domain (i.e. economics) to add any variables needed for reasoning about the "health" of an economy. You do not need to give the actual probability tables, but you should show the structure of the network, and the possible values that the variables take.

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. 

·         German economy continues to crawl.

·         U.S. economy moving at the pace of a Clinton jog

·         Indian government making giant strides toward liberalization


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.