110 likes | 210 Views
Just-in-time Subgrammar Extraction for HPSG. Vlado Keselj Graduate Student Conference Faculty of Mathematics University of Waterloo June 26, 2001. NL text =========== =========== ===========. NL grammar. subgrammar extraction. parser. subgrammar. parsing results.
E N D
Just-in-time Subgrammar Extraction for HPSG • Vlado Keselj • Graduate Student Conference • Faculty of Mathematics • University of Waterloo • June 26, 2001
NL text =========== =========== =========== NL grammar subgrammar extraction parser subgrammar parsing results What is "just-in-time subgrammar extraction”
Motivation • Subgrammar extraction is defined within the framework of grammar modularity. • managing complexity • parsing efficiency • context-based disambiguation
Subgrammar Definition Sentence: s * G(s)={(s,p1),…,(s,pn)} Grammar: Subgrammar: any partial order: G1G2 implies such that: G1G2 s* G1(s) G2 (s)
Subgrammar Extraction Problem Given a grammar G and a set of words W Í S, find a minimal grammar G1 with the respect to a subgrammar relation £ such that: "sÎW* G(s) = G1(s) There can be no minimal grammars, or more than one.
Subgrammar Extraction for CFGs Context-Free Grammar: (V, S, P, S) Subgrammar definition: G1£ G2 iff V1 Í V2, S1 Í S2, P1Í P2, S1=S2 Recipe for CFGs: 1. S ¬ S Ç W 2. Apply the algorithm for removing useless symbols* ( O(n3) time) *E.g., Aho Ullman 1979
sentence noun verb 2 H: H: H: 2 P: 3 P: 3 AGR: 1 1 AGR: AGR: 1 P: 3 N: sg N: sg N: sg G: m G: m G: m noun H: verb AGR: P: 3 H: AGR: N: sg P: 3 G: m N: sg He writes. HPSG Grammars
3-SAT problem: (p Ú q ÚØr) Ù (ØqÚ rÚØs) Ù (ØpÚ qÚ s) t1 t2 (p Ú q ÚØr) (Øq Ú r Ú Øs) p: t q: f ASGN: ASGN: t1 t2 (p Ú q ÚØr) (Øq Úr Ú Øs) q: t r: t ASGN: ASGN: t1 t2 (p Ú q ÚØr) (Øq Ú r Ú Øs) r: f s: f ASGN: ASGN: start t1 t2 t3 Ù Ù 1 1 1 1 ASGN: ASGN: ASGN: ASGN: NP Completeness for HPSGs
satisfied for: p=true q=false s=true (pÚ q ÚØr) Ù (ØqÚ r ÚØs) Ù (Øp Ú q Ús) t1 t2 (p Ú q ÚØr) (Øq Ú r Ú Øs) p: t q: f ASGN: ASGN: t1 t2 (p Ú q ÚØr) (Øq Ú r Ú Øs) q: t r: t ASGN: ASGN: t1 t2 (p Ú q ÚØr) (Øq Ú r Ú Øs) r: f s: f ASGN: ASGN: start t1 t1 t1 1 1 1 1 ASGN: p: t ASGN: p: t ASGN: p: t ASGN: p: t Ù Ù q: f q: f q: f q: f s: t s: t s: t s: t NP Completeness for HPSG (continued)
typeX typeY1 typeY2 ... ... ... ... typeX typeY1 typeY2 ... An Approximate Efficient Solution for HPSGs 1. remove all features from G and obtain G1 E.g., a rule: is mapped to: 2. apply subgrammar extraction to G1 and obtain G2 3. recover features in G2 and obtain the solution G3 Running time complexity: O(size(G) . |Rule|)
Overview • notion of subgrammar • notion of subgrammar extraction • efficient algorithm for CFGs • NP completeness for HPSGs • an approximate solution for HPSGs