You only need to do this problem set if you wish to obtain VG (excellent) for the course. These are exactly the same problems as in Resit 1.
In this problem set we will experiment with DRT and discourse reasoning.
1. We will work with the grammar grammars/book_grammars/drt.fcfg
a. Create a new version of the grammar which is able to parse discourses. Do this by adding a rule which says that a discourse can consist of a discourse followed by a sentence and another rule which says that a discourse can consist of a single sentence. You will also need to change the start symbol of your grammar.
b. Show that your grammar can parse the following discourses represented as strings:
(i) 'Angus owns a dog he barks' (equivalently ('Angus owns a dog ' + 'he barks') if you prefer)
(ii) 'A student owns a dog he barks'
(iii) 'Every student owns a dog he barks'
Do the parsing in the way that is given in the NLTK book as we have gone through in class.
c. Show the DRS's that result from (i)-(iii)
d. Show the result of applying resolve_anaphora to these DRS's. In the case of (iii) resolve_anaphora should raise an error. Explain why you get these results in terms of the availability of antecedents in the DRSs.
2. Use DiscourseTester and the Malt parser in the way described in the book and discussed in class.
a. Show that (iii) (represented as ['Every student owns a dog', 'He barks']) now yields a result with anaphora. (If you're wondering about tags try nltk.help.upenn_tagset('.*') .) Why is this?
b. Unfortunately the discourses (i) and (ii) cause an error due to a bug...
3. This is based on the FraCaS test suite example 038.
a. Extend grammars/book_grammars/discourse.fcfg so that it covers the following sentences:
(iv) No delegate finished the report
(v) Some delegate finished the report on time
b. Show the reading(s) you get for (iv). Add (v) to the discourse using add_sentence to check for consistency or informativity. Which is the relevant check for this example?
c. Add appropriate (an) appropriate formula(e) to grammars/book_grammars/background.fol so that anybody who finished a report wrote that report. Add to your grammar so that you can parse (vi)
(vi) Some delegate wrote a report
Create a discourse tester object for (v) and add this background to it in the way specified in the NLTK book and discussed in class. (There is an alternative specified on http://nltk.googlecode.com/svn/trunk/doc/howto/discourse.html at the end of section 5, which may or may not be useful.) Now add the sentence (vi) checking for consistency or informativity as appropriate and show that you have obtained the correct results.