Ling 571 - Deep Processing Techniques for NLP
Winter 2015
Homework #6: Due 11:59 February 18, 2015


Goals

Through this assignment you will:

Background

Please review the class slides and readings in the textbook on meaning representation and semantic analysis. Also, review Chapter 10 of the NLTK book for additional detailed examples of logical structures in semantics and the implementation of semantic attachments for some common phenomena in natural language.

Creating Target Semantic Representations

Based on the examples in the text, class slides, and NLTK Chapter 10, manually create representations in first-order logic for each of the example sentences in the file (see the files section below). Your representations should employ the event-style semantics presented in class. These forms constitute the semantic representations that your grammar and parsing process below should derive.

Building a Grammar with Semantic Attachments

Based on the materials above, create a set of context-free grammar rules augmented with semantic attachments that are adequate to analyze a small set of English natural language sentences and produce appropriate semantic analyses.

Your grammar should be able to produce an appropriate semantic analysis for each sentence in the file.

Semantic analysis

Create a program to perform semantic analysis on the test sentences based on your grammar and output the results. Specifically, your program should: Note: You only need to print a single representation if the sentence is ambiguous.

Files

Test and Example Data Files

All files related to this assignment may be found on patas in /dropbox/14-15/571/hw6/, as below:

Your semantics representation file

hw6_sentence_semantics.{txt|pdf}: This file should hold your manually created semantic representations. If you want to use "fancy" symbols, please use a PDF file. You may also choose to use the NLTK-style formatting instead; that can be stored in a .txt file if you wish.

Your grammar file

hw6_semantic_grammar.fcfg: This file should store the grammar you develop for the "rule-to-rule" semantic analysis model and should cover the test sentences. It should be written in a format that can be read in by nltk.data.load(). Sample grammars made be found in NLTK book Chapter 10, the online grammars in /corpora/nltk/nltk-data/grammars/, and in the examples referenced above.

Automatic Semantic Analysis

Create a program hw6_semantic_analysis.py that reads in your grammar with semantic attachments, analyses test sentences, and produces results as outlined above. It should take the parameters as specified below: