Modeladvanced
Combinatory categorial grammar
Also called CCG.
A lexicalized grammar whose words have functor categories such as (S\NP)/NP, combined by application, composition and type raising.
Combinatory categorial grammar (CCG) puts almost all of the grammar in the lexicon: each word gets a category such as , which says "give me a noun phrase on the right, then a noun phrase on the left, and I make a sentence". A small fixed set of rules then combines neighboring categories by function application, function composition and type raising. The rules are the combinators B, T and S of combinatory logic, and each rule builds a term of the lambda calculus for the meaning in step with the syntax: the lambda calculus is the language of the meanings, while CCG is the grammar that decides which terms to build and in what order, without variables of its own. CCG is the formalism behind many supertagging parsers and semantic parsers, and it is weakly equivalent to tree-adjoining grammar.
The machine
Categories. Fix a finite set of atomic categories, such as , , and . Every atomic category is a category, and if and are categories then so are and . The category is a function that takes an argument on its right and gives ; takes on its left. Slashes associate to the left, so is a transitive verb: it takes the object on the right first, then the subject on the left.
Grammar. We write the grammar as , where is the set of words, is the lexicon, a finite set of pairs of a word and a category, together with the rule schemata the grammar allows, and is the start category. The size is the total length of the lexical entries. Each lexical entry also carries a lambda term for its meaning.
Rules. The common schemata, with the meaning each one builds:
| rule | name | syntax | meaning |
|---|---|---|---|
| forward application | |||
| backward application | |||
| forward composition | |||
| backward composition | |||
| forward crossed composition | |||
| forward type raising | |||
| backward type raising | |||
| forward substitution |
Generalized composition lets the second category have arguments, , for up to a fixed bound. Coordination uses the category for "and", with the meaning of a conjunction at the type of . Composition is Curry's combinator , type raising is and substitution is , which gives the grammar its name. A string of words is in the language if some choice of lexical categories, combined by the rules, gives .
An example. Take the lexicon Kim, Sandy, broccoli , likes , hates the same with , and and . The sentence "Kim likes and Sandy hates broccoli" coordinates two strings that are not constituents in a context-free grammar:
Kimby .Kim likesby .Sandy hatesin the same way.and Sandy hatesby , and thenKim likes and Sandy hatesby .- Adding
broccoliby gives .
The meaning comes out by beta reduction of the terms the rules build. The same rules give extraction, as in "the broccoli that Kim likes", where Kim likes is again .
What it counts
Recognition and parsing time. A chart parser fills items , which say that the category derives the words of the span . Spans are fenceposts: covers the words to of a sentence of words. If the categories that can appear in a derivation form a finite set, which holds when composition and type raising are bounded so that no category grows with , the grammar is context-free in effect and the CKY algorithm recognizes it in time for a fixed grammar (theorem). With generalized composition the categories in a derivation can grow with , and Vijay-Shanker and Weir (1993) gave a polynomial algorithm that shares the stack-like tails of categories, with the same time as for tree-adjoining grammar (theorem).
Grammar size. When the grammar is part of the input, the problem is much harder. Kuhlmann, Satta and Jonsson (2018) showed that universal recognition for CCG in the Vijay-Shanker and Weir style is EXPTIME-complete, and NP-complete when lexical entries for the empty string are not allowed (theorem). So the polynomial bounds above hide a factor that is exponential in .
Spurious ambiguity. One reading can have many derivations. "Kim likes broccoli" can be derived by then , or by , and ; composition is associative, so both give the same term (theorem). A parser that does not restrict derivations spends time on these copies. Eisner (1996) gave a normal form that keeps one derivation for each reading in a restricted CCG, by forbidding the output of a composition to be the function of a later composition or application (theorem).
Ambiguity in practice. With a wide-coverage lexicon each word has many categories; in Clark and Curran's tag dictionary the word "is" has 45. The number of lexical choices is the main cost of parsing, which is why parsers first prune the categories with a supertagger (heuristic, with the measurements below).
Relation to other models
- Context-free grammar. Categorial grammar with only application, the AB grammar of Ajdukiewicz and Bar-Hillel, is weakly equivalent to context-free grammar (theorem, Bar-Hillel, Gaifman and Shamir 1960). Composition and type raising are what take CCG beyond it.
- Tree-adjoining grammar. CCG, tree-adjoining grammar, linear indexed grammar and head grammar generate the same class of string languages (theorem, Vijay-Shanker and Weir 1994). All four are mildly context-sensitive: they generate and cross-serial dependencies, yet parse in polynomial time. The structures they assign differ: TAG builds trees by adjunction, CCG builds derivations of categories.
- Lambda calculus and combinatory logic. Each rule is a combinator, and a derivation builds a term of the simply typed lambda calculus whose types follow the categories, for example and . The lambda calculus has variables and abstraction; CCG has neither in its syntax, and builds the same terms by combinators.
- Dependency grammar. The function-argument pairs of a derivation give word-to-word dependencies, which is how CCG parsers are often evaluated.
- Feature structures. Atomic categories often carry features such as or , which match by a light form of feature structure unification.
Known results in the model
- CCGbank. Hockenmaier and Steedman converted the Penn Treebank into CCG derivations, which gave a corpus for training wide-coverage CCG parsers.
- Wide-coverage parsing (measurement). Clark and Curran (2007) kept the 425 categories that occur at least 10 times in sections 02 to 21 of CCGbank. Their log-linear supertagger reached 92.6% per-word accuracy on section 00 with gold part-of-speech tags, and 91.5% with automatic tags. Their CKY parser over the pruned categories reached more than 81% F-score on the DepBank evaluation.
- Semantic parsing (measurement and method). Zettlemoyer and Collins (2005) learned a CCG lexicon with lambda-calculus meanings from sentences labeled only with logical forms, and trained a log-linear model over derivations. Many later semantic parsers use CCG in the same way.
- A* parsing. Because a supertag-factored model scores a derivation by its lexical categories, A* parsing with an estimate built from the supertag scores finds the best derivation while building few chart items (heuristic, with measurements in the work of Lewis and Steedman).
References
- Mark Steedman, The Syntactic Process, MIT Press, 2000, the combinatory rules of application, composition, type raising and substitution, and their use for coordination and extraction
- K. Vijay-Shanker and David J. Weir, The equivalence of four extensions of context-free grammars, the weak equivalence of CCG, tree-adjoining grammar, linear indexed grammar and head grammar
- K. Vijay-Shanker and David J. Weir, Parsing some constrained grammar formalisms, the polynomial recognition algorithm for CCG
- Marco Kuhlmann, Giorgio Satta and Peter Jonsson, On the complexity of CCG parsing, Computational Linguistics 44(3), 447-482, 2018, the universal recognition problem for CCG: EXPTIME-complete in general and NP-complete without empty categories
- Stephen Clark and James R. Curran, Wide-coverage efficient statistical parsing with CCG and log-linear models, Section 8 (the supertagger and its 425 categories), Section 9 (adaptive supertagging and CKY parsing) and the evaluation on DepBank
- Luke S. Zettlemoyer and Michael Collins, Learning to map sentences to logical form, the CCG lexicon with lambda-calculus semantics and the log-linear model over derivations
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag BT4KA7 Edit this page History Report an error Markdown