DOC PREVIEW
MIT 6 863J - Semantics: word semantics & sentence semantics

This preview shows page 1-2-3-4 out of 11 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.863J/9.611J Natural Language Processing, Spring, 2004 Laboratory 4 Semantics: word semantics & sentence semantics Handed Out: April 21 Due: April 30 1. Introduction: Goals of the Laboratory In this laboratory you will investigate two aspects of assigning meaning to sentences and how to use that information: (1) word meaning, as illustrated by the hand-constructed ontology, Wordnet; and (2) sentence meaning, as illustrated by a very simple lambda-calculus interpreter. For the first part, you will see how to use Wordnet to examine the relationships amongst word meanings, as might be used in a hypothetical word reasoning system. For the second part, you will be asked to extend. When you have completed the assignment, you should understand the principle of compositionality in semantics and how that relates to syntactic analysis. You will also know how to ‘put it all together’: you will have extended an English interface to a simple database. 2. Word semantics 2.1 The WordNet database (version 2.0) is available online via the following link. (You may also download it to a windows or linux machine for local use – just follow the instructions there, but this isn’t necessary for the exercise.) The second link is the online browser, which is all that you need here. http://www.cogsci.princeton.edu/~wn/ http://www.cogsci.princeton.edu/cgi-bin/webwn Wordnet is a hand-built directed graph of linked synonym sets or synsets. If you click on the second link, you’ll pull up a web browser window that allows you to explore them. Typing ‘pentagon’ into the search window, Wordnet will display 3 meaning senses for ‘pentagon’: (1) a government building; (2) the US military establishment; and (3) a five-sided figure:Below these three word senses is a new search box with pull down menu items. We have selected a ‘hypernym’ search. This is a class hierarchy description based on a “this is a kind of…” relation. For example, a pentagon in the third sense is “a kind of polygon”. We have also typed in ‘3’ into the ‘senses’ box, meaning that we’ll look for hypernyms only for the third sense of pentagon. We have also checked ‘contextual help’ which will explain the format and definitions of the terms used in the display. The pentagon hypernym search returns the following screen:The word “line” has 29 senses (!!) as a noun, and 6 as a verb. In its sense as a moving point in geometry, its hypernyms are: The lowest common ancestor for these two senses is the hypernym shape, form. A hypernym path goes up the hypernym hierarchy from the first word to a common ancestor and then down to the second word. Note that a hypernym path from a node other than the lowest common ancestor will always be equal to or longer than the hypernym path provided by the lowest common ancestor. For the example above, the hypernym path is pentagon to polygon, polygonal shape, to plane figure, two-dimensional figure, to figure to shape to line. Question 1: Find the lowest common ancestor across all senses for each of the following word pairs. Provide the hypernym path through the lowest common ancestor in each case. 1. English and Tagalog 2. United States and Cambridge 2.2 Consider the following text: The pilots screamed as the airplane skidded along the runway. The surface was covered with ice and the vehicle was slowly getting out of control. Finally the crew managed to stop. We use the term coreference (verb, corefer) to specify a pair of items that denote the same object or event in a text or dialog. If coreference does not hold between an item pair, we say they are non-coreferent Noun phrases and pronouns most often corefer, e.g., Vincent drank. He coughed on the water, but this is not always the case. For example, in the above text, runway and surface may be said to corefer. Question 2: Use WordNet’s hypernym function to find evidence for the following coreference or lack of coreference, and briefly explain your reasoning: 1. coreference between runway and surface 2. coreference between airplane and vehicle 3. non-coreference between vehicle and runway 4. crew and pilot (you decide from WordNet whether coreference or non-coreference should hold)3. Sentence semantics In this section, you will extend a very simple lambda-calculus based semantic interpreter that uses the notion of paired syntactic and semantic rules. Let’s first see what it can do. To run the semantic interpreter, add 6.863 as usual. Then, invoking semantic –h provides a list of command line options: athena% cd /mit/6.863/python-semantics athena% semantic –h usage: semantic.py [options] [rule_file] 6.863 Semantic Framework version 1.1 (April 14, 2004) by Rob Speer Distributed under the GPL. See LICENSE.TXT for information. options: -h, --help show this help message and exit -bFILE, --batch=FILE Batch test: interpret all the lines in a file -v, --verbose output lots of lambda applications [default] -q, --quiet output only the responses [default in batch mode] To enter a command loop that reads a sentence in turn, you specify a file of paired syntactic, semantic rules, and the program will respond with a prompt: athena% semantic lab_rules.py Loading semantics... Hello. > We can now type in sentences for the interpreter to process. The system will first attempt to parse the sentence, using the Lab 3 Earley parser (with a given grammar). It then applies the semantic rules associated with each context-free rule that applied to build a node of the parse tree, to yield a representation that can either add to a simple database of facts or query the database, and construct a response. You can then type in another sentence, and so forth. A carriage return terminates the session and returns to the shell prompt. A declarative sentence adds a statement to the database; the system responds with “OK”. A question can be one of three types: a yes-no question (“Did John see Mary”), in which case the system responds Yes or No; a wh-question (“Who did John see”), in which case the system responds with an answer retrieved from its database, possibly “I don’t know” ; or a wh-locative question (“Where did John see Mary”), in


View Full Document

MIT 6 863J - Semantics: word semantics & sentence semantics

Documents in this Course
N-grams

N-grams

42 pages

Semantics

Semantics

75 pages

Semantics

Semantics

82 pages

Semantics

Semantics

64 pages

Load more
Download Semantics: word semantics & sentence semantics
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Semantics: word semantics & sentence semantics and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Semantics: word semantics & sentence semantics 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?