Hostname: page-component-74656f9884-npj9w Total loading time: 0 Render date: 2026-11-06T22:24:31.870Z Has data issue: false hasContentIssue false

From UBGs to CFGs A practical corpus-driven approach

Published online by Cambridge University Press:  01 December 2007

HANS-ULRICH KRIEGER*
Affiliation:
German Research Center for Artificial Intelligence (DFKI), Stuhlsatzenhausweg 3, D-66123 Saarbriicken, Germany e-mail: krieger@dfki.de
Rights & Permissions [Opens in a new window]

Abstract

We present a simple and intuitive unsound corpus-driven approximation method for turning unification-based grammars, such as HPSG, CLE, or PATR-II into context-free grammars (CFGs). Our research is motivated by the idea that we can exploit (large-scale), hand-written unification grammars not only for the purpose of describing natural language and obtaining a syntactic structure (and perhaps a semantic form), but also to address several other very practical topics. Firstly, to speed up deep parsing by having a cheap recognition pre-flter (the approximated CFG). Secondly, to obtain an indirect stochastic parsing model for the unification grammar through a trained PCFG, obtained from the approximated CFG. This gives us an efficient disambiguation model for the unification-based grammar. Thirdly, to generate domain-specific subgrammars for application areas such as information extraction or question answering. And finally, to compile context-free language models which assist the acoustic model of a speech recognizer. The approximation method is unsound in that it does not generate a CFG whose language is a true superset of the language accepted by the original unification-based grammar. It is a corpus-driven method in that it relies on a corpus of parsed sentences and generates broader CFGs when given more input samples. Our open approach can be fine-tuned in different directions, allowing us to monotonically come close to the original parse trees by shifting more information into the context-free symbols. The approach has been fully implemented in JAVA.

Information

Type
Papers
Copyright
Copyright © Cambridge University Press 2007
Figure 0

Fig. 1. The external exchange format of a chart as delivered by a modifbd version of the PET system. The meta characters and express optionality, | enforces the choice of exactly one alternative, and * and + refer to Kleene star and Kleene plus, resp. integer denotes the set of all integers, i.e., sequences of numeric decimal characters, string denotes the set of all strings, i.e., sequences of plain text characters, enclosed by double quotes. Note that each chart edge must be separated by the newline character at the end. At the moment, we do not benefit from the start and end position of an edge, rulename serves as the main category symbol, imdtrs refers to the immediate daughters of an edge. Since the delivered passive edges are topologically sorted, it is not necessary to reencode an edge that has already been introduced earlier. Thus the immediate daughters imdtrs of an edge are referred to by integer numbers id. The only exception are terminal symbols (the surface form) which are written as pure strings.

Figure 1

Fig. 2. Parts of the chart for the sentence Kim loves Sandy. Note that the chart is topologically sorted, i.e., it is guaranteed that edge ids are introduced before they are referred to in the immediate daughters list. For instance, edge 13 refers to edge 11 (i.e., originating from a unary rule), edge 30 to edges 17 and 28 (a binary rule), etc. The edges 1–11 can be thought of as realizing the lexicon lookup. Notice that loves is assigned nine readings (different senses & morphosyntactic variations). The unary rules 12, 13, 15, 19, and 22 are morpholexical rules. The unary rule proper_np (17, 18) raises a noun to an NP. Some passive edges (40–42) result in useless CF rules for this sentence, since they represent dead branches in the search space.

Figure 2

Fig. 3. The ten most prominent failure points for the English HPSG grammar (June 2002) in decreasing order.

Figure 3

Fig. 4. The overall structure of the extraction algorithm.

Figure 4

Fig. 5. The correlation between the language accepted by the HPSG (HPSG) and the approximated context-free language (CFG, C, A), given a corpus C and a set of annotation paths A. The approximated language (CFG, C′,A) monotonically grows when given a larger corpus C′ ⊇ C. The language (CFG, C, A’) usually shrinks when given a larger set of annotation paths A’ ⊇ A (but the number of rules grows).

Figure 5

Fig. 6. Total number of rules for the aged test suite, obtained under both equivalence (E-rules) and subsumption (S-rules). The explosion in the number of rules from 5 to 6 is due to the path SYHSEMI|LOCAL|KEYS|KEY.

Figure 6

Fig. 7. Useful and useless rules for aged, obtained under rule equivalence (without lexicon lookup rules). All measurements were conducted on a 833 MHz Linux workstation under Allegro Common Lisp 6.0.1. ppedges refers to packed passive edges.

Figure 7

Fig. 8. Useful and useless rules for aged, obtained under rule subsumption (without lexicon lookup rules). The runtime is measured for the first stage of two-step parsing, i.e., for the CF stage.

Figure 8

Fig. 9. Fig. 9. Plot of the number of all rules obtained under rule equivalence against the number of samples from aged. Note that we depict the sum of useful and useless rules without start productions here. The table clearly shows that, at least for 226 symbol annotations, the training corpus is too small.

Figure 9

Fig. 10. Number of rules (including start productions and lexicon lookup rules) and nonterminals for the csli test suite, obtained both under equivalence (E-rules, E-nonterms) and subsumption (S-rules, S-nonterms). The rule set both contains useful and useless rules.

Figure 10

Fig. 11. Useful and useless rules for csli, obtained under rule equivalence (without lexicon ‘lookup” rules). Less than a fourth of all rules are useful under the most specifb CFG. Note the decrease of useful rules when moving from 10 to 18 annotations, although the total number of rules increases. Note also the increase of readings from 110 to 226 annotations, even though the recognized language gets smaller (cf. number of errors). Overgeneration against the UBG (7,981 readings) w.r.t. training corpus was between 2.29 and 2.82 for the two largest grammars. Recall that the original HPSG produces 3,246 errors which are properly approximated by the most specifb CFG above (viz., 3,065). The runtime is measured for the first stage of two-step parsing, i.e., for the CF stage.

Figure 11

Fig. 12. Plot of the number of all rules obtained under rule equivalence against the number of samples for csli. Note that we depict the sum of useful and useless rules without start productions here. Again, the table clearly shows that, at least for 226 symbol annotations, the training corpus is too small.

Figure 12

Fig. 13. Useful and useless rules for the 90% training corpus from csli, obtained under rule equivalence (without lexicon ‘lookup” rules). Runtime measurements (#ppedges, readings, errors, runtime[s]) are performed against the 10% test corpus (572 sentences) for full two-stage parsing (sum of both stages). Row 3 and 4 presents the results for the two grammars after deleting the main category symbols in CF rules (-CAT). Speedup is more than 100 here (compare this with the results from last subsection), since failed CF parses are, of course, not replayed by the second HPSG stage.