Linguistics 567: Grammar Engineering
Lab 1: Getting familiar with the LKB
Due 4/1/05
Getting Started
Run a testsuite with the LKB batch parse utility
- In the LKB Top Menu, select Parse > Batch Parse
- In the file selection dialogue, select grammar1/test.items
- In the next file selection dialogue, select grammar1/test.results
- Say yes to overwriting it.
- Switch to the *common-lisp* buffer in emacs to and wait for
the "Finished test file message".
- Examine test.results. The first number after each sentence
is the number of parses. Ungrammatical (starred) sentences, should
have 0 parses, grammatical ones 1 or more. The other number is the
number of edges found.
Feature Structure Re-entrancies in Agreement
Phrase Structure Rules
Your answers to the questions below should be
included in your write-up.
- Find a sentence that parses with the verb give.
- How does the parse assigned by this grammar differ from the
one you would expect from the grammar in SWB 2003?
- Examine the head-complement rule in rules.tdl. What
about this rule is behind the difference noted above? How does it
ensure that heads only get the complements they're looking for, and
that the order on the COMPS list is obeyed?
Modification
This grammar does not yet have any account of modification. In
this part, you'll add PP modifiers and the types and rules that support
them.
- Add a feature MOD to pos. Constrain each subtype of pos to have an appropriate value for MOD. Notes:
- The value of MOD should be a list.
- When the list is non-empty, it should contain one item of type
expression.
- PPs can modify both nouns and verbs. To capture this, consider
modifying the hierarchy under pos to give noun and
verb a common supertype.
- Add a head-modifier rule to rules.tdl. Refer to the
head-specifier rule that's there and SWB 2003.
- Add an appropriate lexical entry for near to the lexicon.
- Test your grammar with the testsuite in mod.items.
- In your write-up, describe what you have
done for this part. What changes did you have to make?
The Head Feature Principle
Looking at the various rules, you'll notice that the HEAD value
of the whole phrase is always identified with the HEAD value of
one of the ARGS, sometimes the first and sometimes the second. In
this part, you'll modify the grammar to reflect this distinction
between head-initial and head-final phrases.
- In types.tdl, add three new types:
head-initial := phrase &
[ HEAD #head,
ARGS [ FIRST.HEAD #head ] ].
head-final := phrase &
[ HEAD #head,
ARGS < expression, [ HEAD #head ] > ].
root-head-final := root & head-final.
- Modify rules.tdl so that each rule inherits
from one of these types. Remove any now redundant constraints
from those rules.
- Test your changes with test.items and mod.items.
- In your write-up, describe what you have
done for this part. What changes did you have to make?
- What happens if you remove the type root-head-final.
Explore why this might be (hint: use grep in your linux
terminal to see what other files mention root. In your write-up, describe what you think is going
on.
Eliminating Redundancy in the Lexicon
The grammar so far lacks any lexical type hierarchy. We'll
fix that now.
- In types.tdl create types for noun-word,
verb-word, det-word, and prep-word.
These types should state what is is common across all the nouns,
etc. in the lexicon.
- Create subtypes of noun-word for singular and plural
nouns (note that this grammar is treating these as separate lexical
entries, not related to each other by lexical rule). Update the
lexicon so that the nouns inherit from these types.
- Create subtypes of verb-word for (present tense) verbs
that take 3sg and non-3sg subjects. Update the lexicon so that
the verbs inherit from these types.
- Update the lexicon so that the determiners and prepositions
inherit from det-word and prep-word.
- Test your grammar against test.items, mod.items,
and agr.items.
- Create subtypes of verb-word for intransitive,
transitive, ditransitive, and prepositional transitive verbs.
- Take advantage of multiple inheritance to cross-classify the
valence pattern subtypes with the agreement subtypes. Hints:
- tdl notation for multiple inheritance:
x := y & z & [A b].
- Lexical entries (instances) should only belong to one type.
Create the `marriage' types in types.tdl (3sg-intransitive,
etc).
- Update the lexicon file so that the verbs inherit from the
new types.
- Test your grammar against test.items, mod.items,
and agr.items.
- In your write-up, describe what you have
done for this part. What changes did you have to make?
Save your work in progress
cd ~/username
tar czf grammar1.tgz grammar1
scp grammar1.tgz username@dante.u.washington.edu:~/
To download your work in progress and start up again:
cd ~/username
scp username@dante.u.washington.edu:~/grammar1.tgz
tar xzf grammar1.tgz
Submit to E-Submit
This lab is notionally due Friday evening. Catalyst will
close the assignment at midnight Sunday night.
Create one compressed file (preferably with tar, as above),
including both your grammar and your write up. Write ups can
be plain text or pdf.
The link for our E-Submit site can be found on the course
web page.
Return to main course page