Lab 3 (due 1/22 11:59 pm)

Overview

The primary goal of this lab is to take the grammar from last week and improve it, primarily by improving the morphological component (reducing ambiguity, streamlining the position classes, and possibly improving coverage). We will also extend testsuites to illustrate a few more phenomena. You'll be using [incr tsdb()] to test the resulting grammar and compare it to your the grammar you built by the end of Lab 2.

This lab entails the following general steps:

  1. Testsuite extension: Choose 3 additional phenomena to work on (we'll try to come up with ones that make sense across many of the languages in class).
  2. Document those phenomena in a testsuite
  3. Process the extended testsuite with your lab 2 grammar.
  4. Morphological clean-up
  5. Process the test corpus and your testsuite using [incr tsdb()], the LKB, and the grammar resulting from your updated choices file.
  6. Examine the results of the second test run for coverage, accuracy and ambiguity, including as a diff to the final test run from last week.
  7. Write it all up :)

Back to top

Create a small testsuite for three phenomena

Choose 3 phenomena to work on, from the following list:

Create a small testsuite of examples, according to the general instructions for testsuites and the formatting instructions, illustrating the phenomena you worked on above. The testsuite should have both positive and negative examples, but doesn't need to be exhaustive (since we're working with test corpora this year), but you'll want both positive and negative examples for each of the phenomena you work on in this section. I expect these testsuites to have about 20-30 examples total by the end of this week, though you can do more if you find that useful. All examples should be simple enough that your grammar can parse them or fails to parse them because of the one thing that's wrong with them.

Create a test suite skeleton

  1. Make a subdirectory called lab3 inside tsdb/skeletons for your test suite.
  2. Edit tsdb/skeletons/Index.lisp to include a line for this directory, e.g.:
    (
    ((:path . "matrix") (:content . "matrix: A test suite created automatically from the test sentences given in the Grammar Matrix questionnaire."))
    ((:path . "corpus") (:content . "IGT provided by the linguist"))
    ((:path . "lab3") (:content . "Test suite collected for Labs 2-3."))
    )
    
  3. Download the python script make_item, make sure it is executable, and run it on your test suite:

    make_item testsuite.txt

    Notes on make_item:

  4. Copy the .item file which is output by make_item to tsdb/skeletons/lab3/item.
  5. Copy tsdb/skeletons/Relations to tsdb/skeletons/lab3/relations (notice the change from R to r).

Back to top

Initial testsuite run

Back to top

Improve the morphotactics in the choices file

The kinds of improvements that might be required here depend on the choices files, but could be things like:

It may be tempting to rip the whole thing out and start from scratch, but doing so will lead to drastic reductions in coverage. If possible, it's better to improve on what's there.

Depending on the size of the choices file, the customization page might be really slow and you may find it more convenient to edit the choices file directly. This is okay, but proceed with caution: if you remove position classes that other position classes take as input, you'll need to update those other position classes as well.

This task could take up unlimited amounts of time, and we'd like to avoid that! You can get full credit for this part of the lab so long as:

  1. You have made changes to the choices file involving at least three position classes.
  2. Your write up clearly describes the changes you made and why.
  3. The resulting choices file can produce a customized grammar that loads and clearly improves on the previous grammar (more coverage or lower ambiguity without drastic reduction in coverage).

Make sure you can parse individual sentences

Once you have created your starter grammar (or each time you create one, as you should iterate through grammar creation and testing a few times as you refine your choices), try it out on a couple of sentences interactively to see if it works:

  1. Load the grammar into the LKB.
  2. Using the parse dialog box (or 'C-c p' in emacs to get the parse command inserted at your prompt), enter a sentence to parse. Alternatively, you can use Browse | Test items in [incr tsdb()] and just double click the item you want to parse. This sends the item to the LKB for interactive processing, but doesn't store the result in the test suite profile.
  3. Examine the results. If it does parse, check out the semantics (pop-up menu on the little trees). If it doesn't look at the parse chart to see why not.
  4. Problems with lexical rules and lexical entries often become apparent here, too: If the LKB can't find an analysis for one of your words, it will say so, and (obviously) fail to parse the sentence.

Note that the questionnaire has a section for test sentences. If you use this, then the parse dialog will be pre-filled with your test sentences.

Back to top

Run both the test corpus and the testsuite

Following the same procedure as the first time you ran your test corpus, do test runs over both the testsuite and the test corpus.

Again, collect the following information to provide in your write up:

  1. How many items parsed?
  2. What is the average number of parses per parsed item?
  3. How many parses did the most ambiguous item receive?
  4. What sources of ambiguity can you identify?
  5. For 10 items (if you have at least that many parsing), do any of the parses look reasonable in the semantics?

Back to top

Write up

Your write up should be a plain text file (not .doc, .rtf or .pdf) which includes the following:

  1. Your answers to the questions about the initial and final [incr tsdb()] runs, for both test corpus and test suite, repeated here:
    1. How many items parsed?
    2. What is the average number of parses per parsed item?
    3. How many parses did the most ambiguous item receive?
    4. What sources of ambiguity can you identify?
    5. For 10 items (if you have at least that many parsing), do any of the parses look reasonable in the semantics? (Emily will demo in class on Tuesday.)
  2. Documentation of the phenomena you have added to your testsuite, illustrated with examples from the testsuite.
  3. Documentation of the improvements you made the morphotactic choices. What did you change and why? Please include IGT that illustrate the effects of the changes so I can test them out.

Back to top

Submit your assignment

Back to top

Back to course page


Last modified: