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

Slides:



Advertisements
Similar presentations
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
Advertisements

Semantics Static semantics Dynamic semantics attribute grammars
Feature Structures and Parsing Unification Grammars Algorithms for NLP 18 November 2014.
- Vasvi Kakkad.  Formal -  Tool for mathematical analysis of language  Method for precisely designing language  Well formed model for describing and.
ICE1341 Programming Languages Spring 2005 Lecture #6 Lecture #6 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
CSA4050: Advanced Topics in NLP Semantics IV Partial Execution Proper Noun Adjective.
BİL711 Natural Language Processing1 Problems with CFGs We know that CFGs cannot handle certain things which are available in natural languages. In particular,
Type checking © Marcelo d’Amorim 2010.
Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara
ICE1341 Programming Languages Spring 2005 Lecture #5 Lecture #5 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
CS 355 – Programming Languages
Natural Language Processing - Feature Structures - Feature Structures and Unification.
NLP and Speech Course Review. Morphological Analyzer Lexicon Part-of-Speech (POS) Tagging Grammar Rules Parser thethe – determiner Det NP → Det.
NLP and Speech 2004 Feature Structures Feature Structures and Unification.
Features & Unification Ling 571 Deep Processing Techniques for NLP January 26, 2011.
Features & Unification Ling 571 Deep Processing Techniques for NLP January 31, 2011.
C. Varela; Adapted w/permission from S. Haridi and P. Van Roy1 Declarative Computation Model Defining practical programming languages Carlos Varela RPI.
176 Formal Languages and Applications: We know that Pascal programming language is defined in terms of a CFG. All the other programming languages are context-free.
Syllabus Text Books Classes Reading Material Assignments Grades Links Forum Text Books עיבוד שפות טבעיות - שיעור עשר Chart Parsing (cont) Features.
Artificial Intelligence 2005/06 From Syntax to Semantics.
Earley’s algorithm Earley’s algorithm employs the dynamic programming technique to address the weaknesses of general top-down parsing. Dynamic programming.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
Features and Unification
Chapter 3 Describing Syntax and Semantics Sections 1-3.
Chapter 3 Describing Syntax and Semantics Sections 1-3.
Lexical Ambiguity ! Definition: a word belongs to two or more word (“part of speech”) classes Example: the round table (adjective), to round the corner.
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Fundamentals (Chapter 4) Compilers and Syntax.
Context-Free Parsing Part 2 Features and Unification.
PPL Syntax & Formal Semantics Lecture Notes: Chapter 2.
1 Features and Unification Chapter 15 October 2012 Lecture #10.
Chpater 3. Outline The definition of Syntax The Definition of Semantic Most Common Methods of Describing Syntax.
Tree-adjoining grammar (TAG) is a grammar formalism defined by Aravind Joshi and introduced in Tree-adjoining grammars are somewhat similar to context-free.
What it’s ? “parsing” Parsing or syntactic analysis is the process of analysing a string of symbols, either in natural language or in computer languages,
Partial Parsing CSCI-GA.2590 – Lecture 5A Ralph Grishman NYU.
Natural Language Processing Lecture 6 : Revision.
Syntax Specification and BNF © Allan C. Milne Abertay University v
Introduction to AgentSpeak and Jason for Programming Multi-agent Systems (1) Dr Fuhua (Oscar) Lin SCIS Athabasca University June 19, 2009.
SYNTAX Lecture -1 SMRITI SINGH.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Chapter 2. C++ Program Structure C++ program is a collection of subprograms Subprograms in C++ are called FUNCTIONS Each function performs a specific.
TextBook Concepts of Programming Languages, Robert W. Sebesta, (10th edition), Addison-Wesley Publishing Company CSCI18 - Concepts of Programming languages.
CS 363 Comparative Programming Languages Semantics.
March 5, ICE 1341 – Programming Languages (Lecture #4) In-Young Ko Programming Languages (ICE 1341) Lecture #4 Programming Languages (ICE 1341)
2007CLINT-LIN-FEATSTR1 Computational Linguistics for Linguists Feature Structures.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Fall 2005-Lecture 4.
Head-driven Phrase Structure Grammar (HPSG)
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
ISBN Chapter 3 Describing Semantics.
Chapter 3 Part II Describing Syntax and Semantics.
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
Rules, Movement, Ambiguity
D Goforth COSC Translating High Level Languages Note error in assignment 1: #4 - refer to Example grammar 3.4, p. 126.
NLP. Introduction to NLP Background –Developed by Jay Earley in 1970 –No need to convert the grammar to CNF –Left to right Complexity –Faster than O(n.
Basic Parsing Algorithms: Earley Parser and Left Corner Parsing
Section 11.3 Features structures in the Grammar ─ Jin Wang.
1 / 48 Formal a Language Theory and Describing Semantics Principles of Programming Languages 4.
Artificial Intelligence 2004
NLP. Introduction to NLP (U)nderstanding and (G)eneration Language Computer (U) Language (G)
Semantic Analysis II Type Checking EECS 483 – Lecture 12 University of Michigan Wednesday, October 18, 2006.
CSC312 Automata Theory Lecture # 26 Chapter # 12 by Cohen Context Free Grammars.
Programming Languages and Design Lecture 2 Syntax Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Chapter 11: Parsing with Unification Grammars Heshaam Faili University of Tehran.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Syntax.
PPL Syntax & Formal Semantics Lecture Notes: Chapter 2.
King Faisal University جامعة الملك فيصل Deanship of E-Learning and Distance Education عمادة التعلم الإلكتروني والتعليم عن بعد [ ] 1 جامعة الملك فيصل عمادة.
10/31/00 1 Introduction to Cognitive Science Linguistics Component Topic: Formal Grammars: Generating and Parsing Lecturer: Dr Bodomo.
Natural Language Processing Vasile Rus
Describing Syntax and Semantics
Lecture – VIII Monojit Choudhury RS, CSE, IIT Kharagpur
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
Presentation transcript:

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

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

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

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

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

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}

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”

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”

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...

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.)

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].

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}

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

Center for PersonKommunikation P.14 CPK NLP Suite

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 -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.).