Recommended Reading Combinatory Categorial • Michael White. 2006. Grammar Efficient Realization of Coordinate Structures in Combinatory Categorial Grammar. Research on Language and Computation, 4(1):39–75. Constraining surface realisation in • Mark Steedman and Jason Baldridge. Combinatory OpenCCG Categorial Grammar. To appear in Robert Borsley and Kersti Borjars (eds.) Constraint-based approaches to grammar: alternatives to transformational syntax. Oxford: Blackwell. PDF (Will appear in February 2011.)
OpenCCG surface realisation Categorial Grammar
Categorial grammars are lexicalised grammars sentence plan Sentence plans are • a grammar is just a “dictionary” hybrid logic • there are no language-specific grammar rules Lexicon dependency structures OpenCCG • a grammar is a mapping from words to structures realiser Grammar What do the grammar and lexicon look like? restaurant Mapping not food one-to-one! surface text serves
the Lexicalised grammars Categorial grammars (CGs)
Many kinds of lexicalised grammar A CG is a mapping from words to categories • Categorial grammars (including CCGs) • i.e. a set of word-category pairs • Lexicalised Tree Adjoining Grammars (LTAGs) • CFGs in Greibach Normal Form What do categories look like?
Lexicalised grammars are more efficient than restaurant arbitrary CFGs for NLG food • search space is simpler (Koller & Striegnitz, 2002) serves
the
Atomic categories Categories Each CG is built around a finite set of atomic Two kinds of category categories • simple, non-composite, atomic symbols • “atomic” categories • similar to the symbols of a CFG • “complex” categories Examples:
• S – sentence/clause • NP – noun phrase • N - noun • PP – preposition phrase Complex categories Atomic categories in XML • Complex categories are built up from atomic Use atomcat elements with a type attribute category symbols • From any finite set of atomic categories, can construct an infinite set of complex categories
– directional slash operators: / and \
Traditional arithmetic notation is a useful analogy
Arithmetic notation Recursive definition
Arithmetic notation gives us a finite set of digits Categories are defined recursively • 0, 1, 2, . . ., 9 Atomic categories constitute the “base” And a small set of operators for describing an infinite • every atomic category is also a category set of numbers: e.g., • concatenation: 23, 456, 92789 The recursion involves the slash operators • addition: 2+7, 7+23, 456+65 • if X and Y are both categories, then so is (X/Y) • subtraction: 45 - 6, (2+6) - (67- 34) • if X and Y are both categories, then so is (X\Y) Simple examples Embedded examples
category meaning category meaning (S\NP) verb phrase, intransitive verb ((S\NP)/NP) transitive verb (NP/N) determiner ((S\NP)/NP)/NP ditransitive verb (N\N) noun post-modifier, relative clause ((N\N)/NP) post-nominal preposition (PP/NP) preposition ((S\NP)\(S\NP)) adverb (PP\NP) postposition ((S\NP)\((S\NP)/NP)) reflexive pronoun ((N\N)/(S\NP)) relative pronoun
Notational conveniences Complex categories in XML
Drop outermost parentheses How to represent S\NP: • (S\NP) ⇒ S\NP • ((N\N)/(S\NP)) ⇒ (N\N)/(S\NP)
Categories - summary What does X/Y mean?
The kind of word or phrase that combines with a following Y to form an X.
X/Y Y atomic slash operators complex categories categories X
This rule is called forward application. Determiners Prepositions
argument result the restaurant in the restaurant NP / N N PP/NP NP
NP PP
Determiner: word that combines with a Preposition: word that combines with a following N to give an NP, i.e., an NP/N. following NP to give a PP, i.e., a PP/NP.
Derivations Attributive adjectives
in the restaurant great food PP/NP NP/N N N/N N
NP N PP Attributive adjective: word that combines with a following N to give another N, i.e., an N/N. Adjective stacking What does X\Y mean?
The kind of word or phrase that combines with great Italian restaurant a preceding Y to form an X. N/N N/N N Y X\Y N X N
This rule is called backward application.
Intransitive verbs Postpositions
Giovanni’s rocks one floor above NP S\NP NP PP\NP
S PP
Intransitive verb: word that combines with Postposition: word that combines with a a preceding NP to give an S, i.e., an S\NP. preceding NP to give a PP, i.e., a PP\NP. Transitive verbs Relative pronouns
Giovanni’s serves pasta restaurant that rocks NP S\NP/NP NP N N\N/(S\NP) S\NP S\NP N\N S N
Transitive verb: word that combines with a Relative pronoun: word that combines following NP to give an intransitive verb, S\NP. with a following intransitive verb S\NP to give a noun postmodifier N\N.
Adverbs The story so far
• A categorial grammar is a mapping from Giovanni’s totally rocks words to categories NP S\NP/(S\NP) S\NP • Categories can be atomic or complex S\NP • Words are combined into phrases by forward S and backward application
Adverb: word that combines with a following intransitive verb S\NP to give another intransitive verb S\NP. Our lexicon What does our grammar do? Giovanni’s :- NP pasta :- NP • It tells us which strings of words are serves :- S\NP/NP grammatical and which are not. rocks :- S\NP restaurant :- N • It assigns derivational structure to the great :- N/N grammatical strings. a : NP/N that :- N\N/(S\NP) • But what about semantics?
Remember HLDS? Adding HLDS to our lexicon • The input to the OpenCCG realiser is a hybrid logic dependency structure Two steps:
• So our categorial lexicon needs to include 1. Add a nominal to each atomic category symbol HLDS in some way • We need to be able to relate the grammatical 2. Add a set of elementary predications of hybrid sentences with their HLDS (interpretation) logic to each lexical category • And also to relate HLDSs to the grammatical sentences that can realise them (generation) Then relax and let forward and backward application (i.e. unification) take care of the rest! Our lexicon again 1. Adding nominals to categories
Giovanni’s :- NP Giovanni’s :- NPx • Subscripts to atomic category symbols pasta :- NP pasta :- NP • Referential indices: unique labels for x object or event evoked by the word serves :- S\NP/NP serves :- Se\NPx/NPy • By convention, use x, y, z for objects, and e, f, g for events rocks :- S\NP rocks :- Se\NPx • Coindexed nominals indicate the restaurant :- N restaurant :- Nx referent of the argument is the same as referent of result, e.g., “great” great :- N/N great :- Nx/Nx a : NP/N a : NPx/Nx that :- N\N/(S\NP) that :- Nx\Nx/(Se\NPx)
Adding nominals in XML Nominal coindexation in XML
2. Adding EPs to categories Intransitive verbs
Giovanni’s :- NPx : @x Giovanni’s
pasta :- NPx : @x pasta
serves :- Se\NPx/NPy : @e serve, @e
restaurant :- Nx : @e restaurant, @e
great :- Nx/Nx : @e great, @e
Transitive verbs Attributive adjectives
Giovanni’s serves pasta great Italian restaurant NP Se\NPx/NPy w NPv @w Giovanni’s @e serve Nz/Nz Ny/Ny Nx @e
Se\NPx Nx @e serve, @e
N : @e restaurant, @e
So where are we? From CG to CCG
• We ve seen how to define a lexicon in CG CCG is an “extension” of CG. • We ve learned about two important operators in CG, i.e., forward and backward application CCG has more rules: • We ve seen how to combine words both • forward and backward type raising – Syntactically (derivations, unification), and • forward and backward composition – Semantically (set union of elementary predications) • But, Combinatory Categorial Grammar gives us Everything else remains the same - much more • in particular the HLDS representations.
Type Raising
Forward type raising • CCG includes type-raising rules, which turn arguments into functions over functions over such arguments X • Forward type raising T X Y/(Y\X) T Y/(Y\X) • Example: John John NP NP T T S/(S\NP)
S/(S\NP) • The rules are order preserving. Here we turn an NP into a rightward looking function over leftward functions, preserving the linear order of constituents Multiple derivations Q1: I know what restaurant serves French food, but what Forward composition restaurant serves Italian food? A1: Babbo serves Italian food. X/Y Y/Z NP S\NP/NP NP B S\NP X/Z Q2: I know what kind of food Pierre s serves, but what kind of food does Babbo serve? John likes A2: Babbo serves Italian food. S/(S\NP) (S\NP)/NP NP S\NP/NP NP B T S/(S\NP) S/NP
S/NP
CCG is more flexible CCG is more flexible
CCG generates more sentences: CCG allows one sentence to be derived in many ways - • object relative clauses –
“a restaurant that [John likes]S/NP” • reflecting different intonation patterns
• right node raising – • allowing incremental (i.e. left-branching) “[John likes]S/NP but [Charles hates]S/NP derivations from a right-branching lexicon Giovanni’s” Further Reading
• Jason Baldridge and Geert-Jan Kruijff. 2003. “Multi-Modal Combinatory Categorial Grammar”. In Proceedings of EACL 2003. • Mike White and Jason Baldridge. 2003. “Adapting Chart Realization to CCG”. In Proceedings of ENLG 2003. • Jason Baldridge and Geert-Jan Kruijff. 2002. “Coupling CCG with Hybrid Logic Dependency Semantics”. In Proceedings of ACL 2002.