Computational Linguistics (INF2820 TFSs)

Similar documents
Computational Linguistics (INF2820 TFSs)

Algorithms for AI and NLP (INF4820 TFSs)

LKB User Manual. (excerpted from Implementing Typed Feature Structure Grammars) Ann Copestake ISBN:

Wh-questions. Ling 567 May 9, 2017

Ling/CSE 472: Introduction to Computational Linguistics. 5/9/17 Feature structures and unification

Ling 571: Deep Processing for Natural Language Processing

Ling/CSE 472: Introduction to Computational Linguistics. 5/21/12 Unification, parsing with unification Meaning representation

Grammar Engineering for Deep Linguistic Processing SS2012

11-682: Introduction to IR, NLP, MT and Speech. Parsing with Unification Grammars. Reading: Jurafsky and Martin, Speech and Language Processing

Computational Linguistics: Feature Agreement

Indexing Methods for Efficient Parsing with Typed Feature Structure Grammars

Einführung in die Computerlinguistik

Dependency and (R)MRS

Algorithms for AI and NLP (INF4820 Lisp & FSAs)

1 Informal Motivation

Context-Free Grammars

Dependent Object Types - A foundation for Scala s type system

Grammar Development with LFG and XLE. Miriam Butt University of Konstanz

Principles of Programming Languages COMP251: Syntax and Grammars

Knowledge Engineering for NLP May 1, 2005 Clausal semantics

CS 842 Ben Cassell University of Waterloo

CSI33 Data Structures

2.2 Syntax Definition

AVM Description Compilation using Types as Modes

User-Defined Nonmonotonicity in Unification-Based Formalisms

Context-Free Grammars. Carl Pollard Ohio State University. Linguistics 680 Formal Foundations Tuesday, November 10, 2009

Systems Analysis and Design Methods Chapter 7: Data Modeling and Analysis

October 19, 2004 Chapter Parsing

Ling/CSE 472: Introduction to Computational Linguistics. 5/4/17 Parsing

Optimizing Typed Feature Structure Grammar Parsing through Non-Statistical Indexing

Grammar Development with LFG and XLE. Miriam Butt University of Konstanz

The Earley Parser

Prolog-embedding typed feature structure grammar and grammar tool. Version 4.

SEMANTIC ANALYSIS TYPES AND DECLARATIONS

More Theories, Formal semantics

Languages and Compilers

Unification encodings of grammatical notations 1

An Efficient Implementation of PATR for Categorial Unification Grammar

Database Design. 4-1 Supertypes and Subtypes. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

CSI33 Data Structures

This book is licensed under a Creative Commons Attribution 3.0 License

Compilers and Interpreters

Homework & NLTK. CS 181: Natural Language Processing Lecture 9: Context Free Grammars. Motivation. Formal Def of CFG. Uses of CFG.

L322 Syntax. Chapter 3: Structural Relations. Linguistics 322 D E F G H. Another representation is in the form of labelled brackets:

Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques. Fundamentals, Design, and Implementation, 9/e

Related Course Objec6ves

Context-Free Grammars

Syntax and Grammars 1 / 21

Specifying Syntax. An English Grammar. Components of a Grammar. Language Specification. Types of Grammars. 1. Terminal symbols or terminals, Σ

Introduction to Lexical Functional Grammar. Wellformedness conditions on f- structures. Constraints on f-structures

INF4820: Algorithms for Artificial Intelligence and Natural Language Processing. Common Lisp Fundamentals

CSE450 Translation of Programming Languages. Lecture 4: Syntax Analysis

A Short Summary of Javali

Open and Closed World Types in NLP Systems. Dale Gerdemann. Seminar fur Sprachwissenschaft, Universitat Tubingen. Kl. Wilhelmstr.

Unification in Unification-based Grammar

Well-formed Default Unification in Non-deterministic Multiple Inheritance Hierarchies

Theory and Compiling COMP360

Lecture 4: Syntax Specification

11. a b c d e. 12. a b c d e. 13. a b c d e. 14. a b c d e. 15. a b c d e

Why Types Matter. Zheng Gao CREST, UCL

Fundamentals, Design, and Implementation, 9/e Copyright 2004 Database Processing: Fundamentals, Design, and Implementation, 9/e by David M.

A programming language requires two major definitions A simple one pass compiler

1 Lexical Considerations

2 Ambiguity in Analyses of Idiomatic Phrases

TDL A Type Description Language for HPSG Part 2: User Guide

Theoretical Part. Chapter one:- - What are the Phases of compiler? Answer:

Text Mining for Software Engineering

Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques. Fundamentals, Design, and Implementation, 9/e

Dependency grammar and dependency parsing

Dependency grammar and dependency parsing

XML Support for Annotated Language Resources

2.1 Sets 2.2 Set Operations

Dependency grammar and dependency parsing

TDL Grammars in C Sharp

Object-Oriented Programming More Inheritance

Algorithms for NLP. Chart Parsing. Reading: James Allen, Natural Language Understanding. Section 3.4, pp

Computational Linguistics

Methods for Lexicon Maintenance

Lexical and Syntax Analysis. Top-Down Parsing

Defining Program Syntax. Chapter Two Modern Programming Languages, 2nd ed. 1

A Bag of Useful Techniques for Unification-Based Finite-State Transducers

Dependent Object Types - A foundation for Scala's type system

Lexing, Parsing. Laure Gonnord sept Master 1, ENS de Lyon

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger

STRUCTURES AND STRATEGIES FOR STATE SPACE SEARCH

SMURF Language Reference Manual Serial MUsic Represented as Functions

RSL Reference Manual

SDC Design patterns GoF

Data Structure. IBPS SO (IT- Officer) Exam 2017

Programming Languages 3. Definition and Proof by Induction

The CKY algorithm part 2: Probabilistic parsing

Regular Expressions. Agenda for Today. Grammar for a Tiny Language. Programming Language Specifications

Introduction to Automata Theory. BİL405 - Automata Theory and Formal Languages 1

CS 164 Programming Languages and Compilers Handout 8. Midterm I

Assignment 4 CSE 517: Natural Language Processing

Question Bank. 10CS63:Compiler Design

ADTS, GRAMMARS, PARSING, TREE TRAVERSALS

Algorithms for NLP. Chart Parsing. Reading: James Allen, Natural Language Understanding. Section 3.4, pp

Chapter 4. Lexical and Syntax Analysis. Topics. Compilation. Language Implementation. Issues in Lexical and Syntax Analysis.

Principles of Programming Languages, Spring 2016 Assignment 5 Logic Programming

Transcription:

S NP Det N VP V The dog barked LTOP h 1 INDEX e 2 def q rel bark v rel prpstn m rel LBL h 4 dog n rel LBL h RELS LBL h 1 ARG0 x 5 LBL h 9 8 ARG0 e MARG h 3 RSTR h 6 ARG0 x 2 5 ARG1 x BODY h 5 7 HCONS h 3 = q h 9, h 6 = q h 8 Computational Linguistics (INF2820 TFSs) HEAD 1 SPR 2 SPR, COMPS COMPS 3 phrase phrase HEAD 1 SPR 2 COMPS 3 phrase Wilhelm Stephan Oepen & Jan Tore Lønning Universitetet i Oslo oe@ifi.uio.no

An Ambiguous Example Those dogs chased that cat near the aardvark. Typed Feature Structures (Essentials) (2)

More Terminology: Grammatical Functions Licensing Government Agreement The dog barks. The dog a cat barks The dog barks a cat. Kim depends on Sandy Kim depends in Sandy The class meets on Thursday in 508 at 12:15. Constituent node in analysis tree (terminal or instantiation of rule); Head licenses additional constituents and can govern their form; Specifier precedes head, singleton, nominative case, agreement; Complement post-head, licensed and governed, order constraints; Adjunct free modifier, optional, may iterate, designated position; Government directed: a property of c 1 determines the form of c 2 ; Agreement bi-directional: co-occurence of properties on c 1 and c 2. Typed Feature Structures (Essentials) (3)

A More Complicated Example Kim reported on my desk on Monday. Typed Feature Structures (Essentials) (4)

Structured Categories in a Unification Grammar All (constituent) categories in the grammar are typed feature structures; specific TFS configurations may correspond to traditional categories; labels like S or NP are mere abbreviations, not elements of the theory. word HEAD noun [ SPR HEAD det COMPS ] phrase HEAD verb SPR COMPS phrase HEAD verb [ SPR HEAD noun COMPS ] N S VP lexical maximal intermediate Typed Feature Structures (Essentials) (5)

Interaction of Lexicon and Phrase Structure Schemata HEAD 1 SPR COMPS 3 2 SPR COMPS, HEAD 1 SPR 2 COMPS 3 ORTH Kim HEAD noun SPR COMPS ORTH sleeps HEAD verb SPR HEAD noun SPR COMPS COMPS Typed Feature Structures (Essentials) (6)

The Type Hierarchy: Fundamentals Types represent groups of entities with similar properties ( classes ); types ordered by specificity: subtypes inherit properties of (all) parents; type hierarchy determines which types are compatible (and which not). *top* *list* *string* feat-struc *ne-list* *null* expression pos word phrase noun verb det Typed Feature Structures (Essentials) (7)

Multiple Inheritance flyer and swimmer no common descendants: they are incompatible; flyer and bee stand in hierarchical relationship: they unify to subtype; flyer and invertebrate have a unique greatest common descendant. *top* animal flyer swimmer invertebrate vertebrate bee fish cod guppy Typed Feature Structures (Essentials) (8)

The Type Hierarchy Appropriate Features Features record properties of entities; in turn, feature values are TFSs; features are defined by a unique most general type: appropriateness; feature values constrained to a specific type monotonic inheritance. *top* *list* *string* feat-struc *ne-list* *null* expression pos word phrase noun verb det Typed Feature Structures (Essentials) (9)

Typed Feature Structure Subsumption Typed feature structures can be partially ordered by information content; a more general structure is said to subsume a more specific one; *top* is the most general feature structure (while is inconsistent); ( square subset or equal ) conventionally used to depict subsumption. Feature structure F subsumes feature structure G (F G) iff: (1) if path p is defined in F then p is also defined in G and the type of the value of p in F is a supertype or equal to the type of the value of p in G, and (2) all paths that are reentrant in F are also reentrant in G. Typed Feature Structures (Essentials) (10)

Feature Structure Subsumption: Examples TFS 1 : TFS 3 : a b FOO x BAR x FOO y BAR x BAZ x TFS 2 : TFS 4 : a a FOO x BAR y FOO 1 x BAR 1 Hierarchy a FOO BAR b BAZ x y Feature structure F subsumes feature structure G (F G) iff: (1) if path p is defined in F then p is also defined in G and the type of the value of p in F is a supertype or equal to the type of the value of p in G, and (2) all paths that are reentrant in F are also reentrant in G. Typed Feature Structures (Essentials) (11)

Typed Feature Structure Unification Decide whether two typed feature structures are mutually compatible; determine combination of two TFSs to give the most general feature structure which retains all information which they individually contain; if there is no such feature structure, unification fails (depicted as ); unification monotonically combines information from both input TFSs; relation to subsumption the unification of two structures F and G is the most general TFS which is subsumed by both F and G (if it exists). ( square set intersection ) conventionally used to depict unification. Typed Feature Structures (Essentials) (12)

Typed Feature Structure Unification: Examples TFS 1 : TFS 3 : a b FOO x BAR x FOO y BAR x BAZ x TFS 2 : TFS 4 : a a FOO x BAR y FOO 1 x BAR 1 Hierarchy a FOO BAR b BAZ x y TFS 1 TFS 2 TFS 2 TFS 1 TFS 3 TFS 3 TFS 3 TFS 4 b FOO 1 y BAR 1 BAZ x Typed Feature Structures (Essentials) (13)

Type Constraints and Appropriate Features Well-formed TFSs satisfy all type constraints from the type hierarchy; type constraints are typed feature structures associated with a type; the top-level features of a type constraint are appropriate features; type constraints express generalizations over a class (set) of objects. type constraint appropriate features *ne-list* *ne-list* FIRST *top* REST *list* FIRST and REST Typed Feature Structures (Essentials) (14)

More Interesting Well-Formed Unification Type Constraints Associated to animal Hierarchy swimmer swimmer FINS bool mammal mammal FRIENDLY bool whale whale BALEEN bool FINS true FRIENDLY bool FRIENDLY true FINS bool mammal swimmer whale FRIENDLY true FINS false mammal swimmer BALEEN bool FINS true FRIENDLY true Typed Feature Structures (Essentials) (15)

Recursion in the Type Hierarchy Type hierarchy must be finite after type inference; illegal type constraint: *list* := *top* & [ FIRST *top*, REST *list* ]. needs additional provision for empty lists; indirect recursion: *list* := *top*. *ne-list* := *list* & [ FIRST *top*, REST *list* ]. *null* := *list*. recursive types allow for parameterized list types ( list of X ): *s-list* := *list*. *s-ne-list* := *ne-list* & *s-list & [ FIRST expression, REST *s-list* ]. *s-null* := *null* & *s-list*. Typed Feature Structures (Essentials) (16)

Notational Conventions lists not available as built-in data type; abbreviatory notation in TDL: < a, b > [ FIRST a, REST [ FIRST b, REST *null* ] ] underspecified (variable-length) list: < a,... > [ FIRST a, REST *list* ] difference (open-ended) lists; allow concatenation by unification: <! a!> [ LIST [ FIRST a, REST #tail ], LAST #tail ] built-in and non-linguistic types pre- and suffixed by asterisk (*top*); strings (e.g. chased ) need no declaration; always subtypes of *string*; strings cannot have subtypes and are (thus) mutually incompatible. Typed Feature Structures (Essentials) (17)

Properties of (Our) Type Hierarchies Unique Top No Cycles a single hierarchy of all types with a unique top node; no path through the hierarchy from one type to itself; Unique Greatest Lower Bounds Any two types in the hierarchy are either (a) incompatible (i.e. share no descendants) or (b) have a unique most general ( highest ) descendant (called their greatest lower bound); Closed World all types that exist have a known position in hierarchy; Compatibility type compatibility in the hierarchy determines feature structure unifiability: two types unify to their greatest lower bound. Typed Feature Structures (Essentials) (18)

Multiple Inheritance (Repeated for Convenience) flyer and swimmer no common descendants: they are incompatible; flyer and bee stand in hierarchical relationship: they unify to subtype; flyer and invertebrate have a unique greatest common descendant. *top* animal flyer swimmer invertebrate vertebrate bee fish cod guppy Typed Feature Structures (Essentials) (19)

An Invalid Type Hierarchy swimmer and vertebrate have two joint descendants: fish and whale; fish and whale are incomparable in the hierarchy: glb condition violated. *top* animal flyer swimmer invertebrate vertebrate bee fish mammal cod guppy whale dog Typed Feature Structures (Essentials) (20)

Fixing the Type Hierarchy LKB system introduces glb types as required: swimmer-vertebrate. *top* animal flyer swimmer invertebrate vertebrate bee glbtype42 mammal fish whale dog cod guppy Typed Feature Structures (Essentials) (21)

Properties of (Our) Typed Feature Structures Finiteness a typed feature structure has a finite number of nodes; Unique Root and Connectedness a typed feature structure has a unique root node; apart from the root, all nodes have at least one parent; No Cycles no node has an arc that points back to the root node or to another node that intervenes between the node itself and the root; Unique Features any node can have any (finite) number of outgoing arcs, but the arc labels (i.e. features) must be unique within each node; Typing each node has single type which is defined in the hierarchy. Typed Feature Structures (Essentials) (22)

Typed Feature Structure Example (as AVM) phrase HEAD verb ARGS *ne-list* FIRST word ORTH chased HEAD verb REST *ne-list* FIRST expression HEAD noun REST *null* Typed Feature Structures (Essentials) (23)

Typed Feature Structure Example (as Graph) phrase HEAD verb ARGS word ORTH chased *ne-list*first HEAD verb REST expression *ne-list*first HEAD noun REST *null* Typed Feature Structures (Essentials) (24)

Typed Feature Structure Example (in TDL) vp := phrase & [ HEAD verb, ARGS *ne-list* & [ FIRST word & [ ORTH "chased", HEAD verb ], REST *ne-list* & [ FIRST expression & [ HEAD noun ], REST *null* ]]]. Typed Feature Structures (Essentials) (25)

Reentrancy in a Typed Feature Structure (Graph) phrase HEAD verb ARGS HEAD *ne-list*first word ORTH chased REST *ne-list*first phrase HEAD noun REST *null* Typed Feature Structures (Essentials) (26)

Reentrancy in a Typed Feature Structure (AVM) phrase HEAD 1 verb ARGS *ne-list* FIRST word ORTH chased HEAD 1 REST *ne-list* FIRST phrase HEAD noun REST *null* Typed Feature Structures (Essentials) (27)

Reentrancy in a Typed Feature Structure (TDL) vp := phrase & [ HEAD #head & verb, ARGS *ne-list* & [ FIRST word & [ ORTH "chased", HEAD #head ], REST *ne-list* & [ FIRST phrase & [ HEAD noun ], REST *null* ]]]. Typed Feature Structures (Essentials) (28)

The Linguistic Knowledge Builder (LKB) Compiler and Interactive Debugger Grammar definition errors identified at load time by position in file; inheritance and appropriateness tracked by type and attributes; batch check, expansion, and indexing of full lexicon on demand; efficient parser and generator to map between strings and meaning; visualization of main data types; interactive stepping and unification. Main developers: Copestake (original), Carroll, Malouf, and Oepen; implementation: Allegro CL, Macintosh CL, (LispWorks, CMU CL); available in open-source and binary form for common platforms. Typed Feature Structures (Essentials) (29)

The Format of Grammar Rules in the LKB phrase HEAD 1 SPR COMPS 3 2 phrase SPR COMPS, phrase HEAD 1 SPR 2 COMPS 3 phrase HEAD 1 SPR COMPS 3 ARGS 2 phrase SPR COMPS, phrase HEAD 1 SPR 2 COMPS 3 Typed Feature Structures (Essentials) (30)