Presentation is loading. Please wait.

Presentation is loading. Please wait.

Center for PersonKommunikation P.1 UNIFICATION GRAMMAR  Forerunner: “Attribute Grammars” introduced by Donald E. Knuth: “Semantics of context-free Languages”.

Similar presentations


Presentation on theme: "Center for PersonKommunikation P.1 UNIFICATION GRAMMAR  Forerunner: “Attribute Grammars” introduced by Donald E. Knuth: “Semantics of context-free Languages”."— Presentation transcript:

1 Center for PersonKommunikation P.1 UNIFICATION GRAMMAR  Forerunner: “Attribute Grammars” introduced by Donald E. Knuth: “Semantics of context-free Languages”. Mathematical Systems Theory 2, 1968 Actual origin in unpublished documents by M. Kay in the seventies Classical presentations :  M. Kay: “Parsing in functional Unification Grammar”. In D.R. Dowty et al: “Natural Language Parsing”, Cambridge 1985  S. Shieber: “An Introduction to Unification based Approaches to Grammar”. CSLI Lecture Notes No 4. Stanford 1986

2 Center for PersonKommunikation P.2 UNIFICATION GRAMMAR PSG/BNF symbols parsing: symbols are string- compared comparison of two symbols returns TRUE or FALSE the set of symbols is static UNIFICATION GR./APSG feature sets parsing: feature sets are unified unification of two feature sets returns a new feature set or NULL the set of feature sets is dynamic

3 Center for PersonKommunikation P.3 UNIFICATION GRAMMAR {cat=s, stype=declarative} feature Feature set attribute value

4 Center for PersonKommunikation P.4 UNIFICATION GRAMMAR Terminology: –attribute: lex, cat –value:s, np, vp, fly … –feature: lex=fly … –feature set (compound feature): {lex=fly,cat=n} … –atomic feature: lex=fly –complex feature*: agreement={prs=third,nb=plur} –constant feature: prs=third –variable feature**: prs=$A * NOT supported by all unification grammars (e.g. by the CPK NLP Suite) ** I literature, often indicated by numbered boxes prs= 1

5 Center for PersonKommunikation P.5 UNIFICATION GRAMMAR Unification: the basic operation on compound features {cat=n}  {lex=flies,cat=n} = {lex=flies,cat=n} {cat=v}  {lex=flies,cat=n} = NULL {cat=pron,nb=plur}  {lex=you,cat=pron} = {lex=you,cat=pron,nb=plur} {cat=pron,nb=sing}  {lex=you,cat=pron} = {lex=you,cat=pron,nb=sing} {cat=pron,nb=plur}  {lex=I,cat=pron,nb=sing} = NULL

6 Center for PersonKommunikation P.6 UNIFICATION GRAMMAR Unification and variables 1): $N is instantiated: {cat=pron,nb=$N}  {lex=I,cat=pron,nb=sing} = {lex=I,cat=pron, nb=sing} $N remains uninstantiated: {cat=pron,nb=$N}  {lex=you,cat=pron} = {lex=you,cat=pron, nb=$N}

7 Center for PersonKommunikation P.7 UNIFICATION GRAMMAR Unification and variables 2): Scope of $N is the entire structure building rule (“shared structures”) (dotted rule chart parsing scheme indicated by  ): {cat=np,nb=$N} [  {cat=pron,nb=$N}].  {lex=I,cat=pron,nb=sing} = {cat=np,nb=sing} [{lex=I,cat=pron,nb=sing}  ].} np pron pron: “I”

8 Center for PersonKommunikation P.8 UNIFICATION GRAMMAR Unification and variables 3): Scope of $N is the entire structure building rule (dotted rule chart parsing scheme indicated by  ): {cat=s} [  {cat=np,nb=$N},{cat=vp,nb=$N}].  {cat=np,nb=sing} [{lex=I,cat=pron,nb=sing}  ].}= {cat=s} [{cat=np,nb=sing},  {cat=vp,nb=sing}]. s np vp np pron:”I”

9 Center for PersonKommunikation P.9 UNIFICATION GRAMMAR Unification and variables 4): Agreement: a variable occurs twice or more in the body of a rule : {cat=s,stype=decl} [ {cat=np,prs=$P,nb=$N}, {cat=vp, prs=$P,nb=$N ]. i.e.: subject - predicate agreement in person and number: I am, you are, the man is, the men are, *I is, *you am...

10 Center for PersonKommunikation P.10 UNIFICATION GRAMMAR Unification and variables 5): Percolation: a variable occurs once in the head and once (or more) in the body of a rule : {cat=np, prs=third,nb=$N,} [ ^{cat=det}, /* optional determiner “a”, “the” */ *{cat=adj}, /* zero or more adjectives */ {cat=n, nb=$N} /* obligatory noun */ ]. i.e.: the number of an NP (subject,object) is the number of the noun contained in the NP: the man (sing), the large tall man (sing), men (plur.), the men (plur.)

11 Center for PersonKommunikation P.11 UNIFICATION GRAMMAR The special “cat”-feature, obligatory in most formalisms: historical reasons: In the earliest approaches, features were introduced as additional “feature constraints” to the PSG: Parsing: many efficient parsing algorithm developed for normal context-free grammars (like Earley) can only be applied on feature-based grammars with at least one obligatory feature Prevents unification from “exploding” s->np vp s.stype=decl np.prs=vp.prs np.nb=vp.nb {cat=s,stype=decl} [{cat=np,prs=$P,nb=$N}, {cat=vp, prs=$P,nb=$N].

12 Center for PersonKommunikation P.12 UNIFICATION GRAMMAR Another special feature: “lex” In some formalisms, lexical rules consists of identifier+feature set: “man”: {cat=noun, number=sing,case=non_genitive} In other formalisms, the identifier is a feature, bound to the attribute “lex”, that can participate in unification the normal way: {lex=man,cat=noun, number=sing,case=non_genitive}

13 Center for PersonKommunikation P.13 UNIFICATION GRAMMAR Shieber 1986:  General demands on grammar formalisms  Linguistic felicity  Expressiveness  Computational effectiveness  Characteristics of Unification Grammars  Surface-based  Informational  Inductive  Declarative

14 Center for PersonKommunikation P.14 CPK NLP Suite

15 Center for PersonKommunikation P.15 exercise Implement a small person-subgrammar in the APSG format which for each member in your group returns his/her email-id (or some other unique id). The grammar must only accept right combinations of first names and last names ("agreement"... use variables!). You may use "semantic" (application specific) categories (person, firstname, lastname etc.) in stead of general syntactic ones (np, proper, nominative etc.).


Download ppt "Center for PersonKommunikation P.1 UNIFICATION GRAMMAR  Forerunner: “Attribute Grammars” introduced by Donald E. Knuth: “Semantics of context-free Languages”."

Similar presentations


Ads by Google