Lab 3 (due 4/19 11:59 pm)
The goal of this lab is to take the starting point we got to last week and improve it for a handful of phenomena, building out a small testsuite as you go, and also incorporating improvements to the auto-generated choices files provided by the AGG project. You'll also be using [incr tsdb()] to test the resulting grammar and compare it to your starting point from last week.
This lab entails the following general steps (ordered to have you working on testsuites first, so that we have a little extra time to produce better auto-generated choices files):
- Choose 3 additional phenomena to work on, from the following list:
- Document those phenomena in a testsuite
- Process the test corpus and your test suite, using [incr tsdb()], the LKB, and the grammar based on your choices file as developed last week + any additions that come in from improved autogeneration by the end of Monday.
- Refine your choices file for the three phenomena you are working on.
- Process the test corpus and your testsuite using [incr tsdb()], the LKB, and the grammar resulting from your updated choices file.
- Examine the results of the second test run for coverage, accuracy and ambiguity, including as a diff to the original test run.
- 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
- Make a subdirectory called lab3 inside
tsdb/skeletons for your test suite.
- 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 Lab 2."))
)
- 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:
- This script is going to be pretty picky about the format
of your test suite. If you have questions, please post to Canvas (10 minute rule!).
- It requires python3, which is on the current version of the Ubuntu+LKB appliance.
- Alternatively, you can copy your testsuite and make_item over to patas and run there, or install python3 (from http://python.org/download) on your host OS (mac or windows), and run make_item outside VirtualBox.
- If the above command is successful,
testsuite.txt.item
would be created in the working directory. If the testsuite contains errors, it's possible that a lot of output will appear on stderr. It maybe useful to redirect this into a file that you can use to go through
and correct the errors one at a time. For example:
./make_item testsuite.txt item 2>errs
The command just above attempts to create 'item' in the working directory, and stderr messages are redirected to the file 'errs'.
make_item
contains a default mapping from testsuite line types into particular fields of the [incr_tsdb()]
item file. The default mapping puts 'orth' into 'i-input', the field which the is the input to the grammar. If your grammar targets a different testsuite line, override the default mapping with the -m
/--map
option.
./make_item --map orth-seg i-input testsuite.txt item
The invocation above maps the orth-seg
line into the input field.
You can run make_item
with -h
/--help
to see a summary of the options.
- Copy the .item file which is output by make_item
to tsdb/skeletons/lab3/item.
- Copy tsdb/skeletons/Relations to tsdb/skeletons/lab3/relations (notice the change from R to r).
Back to top
Initial grammar
Your initial grammar for this week should be the result of merging whatever changes you made last week into the new choices file that will be avialable by the end of the day on Monday. You can achieve this in at least one of two ways, the first probably being easiest.
- Diff the previous auto-generated choices file with this one, merge diffs into your current (lab 2) edited choices file.
- Diff your current (lab 2) edited choices file with the previous auto-generated one, merge diffs into the new auto-generated choices file.
Use that choices file to customize a grammar, which will be your initial grammar for this week.
Back to top
Initial testsuite run
- Create and run initial testsuite instances for both the linguist-provided data and your small testsuite, using the initial grammar.
Note If your tsdb/ directory is inside a shared folder on VirtualBox, it will not work.
- For each of these, explore the results, collect the following information to provide in your write up:
- How many items parsed?
- What is the average number of parses per parsed item?
- How many parses did the most ambiguous item receive?
- What sources of ambiguity can you identify?
- 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.)
Back to top
Improve the choices file for three phenomena
For the three phenomena you chose above, refine the choices file by hand. Please be sure to post lots of questions on Canvas as you work on this!
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:
- Load the grammar into the LKB.
- 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.
- 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.
- 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:
- How many items parsed?
- What is the average number of parses per parsed item?
- How many parses did the most ambiguous item receive?
- What sources of ambiguity can you identify?
- 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.)
Back to top
Write up
NB: While the test suite and choices file creation
is joint work, the write up should be done by one partner (the
other will get a turn next week). The writing partner should
have the non-writing partner review the write up and make suggestions.
Your write up should be a plain text file (not .doc, .rtf or .pdf)
which includes the following:
- Description of any further steps you had to take to get from the automatically constructed choice file to one that would both (a) customize and (b) compile.
- Your answers to the questions about the initial and final [incr tsdb()] runs, for both test corpus and test suite, repeated here:
- How many items parsed?
- What is the average number of parses per parsed item?
- How many parses did the most ambiguous item receive?
- What sources of ambiguity can you identify?
- 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.)
- Documentation of the phenomena you have added to your testsuite,
illustrated with examples from the testsuite.
- Documentation of the choices you made in the customization
system, illustrated with examples from your test suite.
- This can be interleaved with the documentation of the phenomena
(so you describe each phenomenon and then the choices you used to add
an analysis of it to the grammar), but the documentation of the phenomenon and choices should be logically separate. Here's an example of what this should look like.
- Descriptions of any properties of your language illustrated
in your test suite but not covered by your starter grammar and/or
the customization system.
- If you have identified ways (other than those you reported last week) in which the automatically created choices file is particularly off-base, please report them here. If you can include IGT from the testsuite or your descriptive materials illustrating the problem, that is even better.
Back to top
Back to top
Back to course page
Last modified: