Dependency Parsing CMSC 723 / LING 723 / INST 725. Marine Carpuat. Fig credits: Joakim Nivre, Dan Jurafsky & James Martin

Similar documents
Dependency Parsing 2 CMSC 723 / LING 723 / INST 725. Marine Carpuat. Fig credits: Joakim Nivre, Dan Jurafsky & James Martin

CS224n: Natural Language Processing with Deep Learning 1 Lecture Notes: Part IV Dependency Parsing 2 Winter 2019

Transition-Based Dependency Parsing with Stack Long Short-Term Memory

Introduction to Data-Driven Dependency Parsing

Transition-based dependency parsing

Refresher on Dependency Syntax and the Nivre Algorithm

Basic Parsing with Context-Free Grammars. Some slides adapted from Karl Stratos and from Chris Manning

Let s get parsing! Each component processes the Doc object, then passes it on. doc.is_parsed attribute checks whether a Doc object has been parsed

Transition-based Parsing with Neural Nets

Assignment 4 CSE 517: Natural Language Processing

Transition-Based Dependency Parsing with MaltParser

Parsing with Dynamic Programming

Online Graph Planarisation for Synchronous Parsing of Semantic and Syntactic Dependencies

Fast(er) Exact Decoding and Global Training for Transition-Based Dependency Parsing via a Minimal Feature Set

Learning Latent Linguistic Structure to Optimize End Tasks. David A. Smith with Jason Naradowsky and Xiaoye Tiger Wu

Dependency Parsing. Ganesh Bhosale Neelamadhav G Nilesh Bhosale Pranav Jawale under the guidance of

Incremental Integer Linear Programming for Non-projective Dependency Parsing

Transition-Based Parsing of the Chinese Treebank using a Global Discriminative Model

Homework 2: Parsing and Machine Learning

A Quick Guide to MaltParser Optimization

Multi-Class Logistic Regression and Perceptron

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

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

Formal Languages and Compilers Lecture VII Part 3: Syntactic A

Dependency grammar and dependency parsing

CS395T Project 2: Shift-Reduce Parsing

Context Encoding LSTM CS224N Course Project

Non-Projective Dependency Parsing in Expected Linear Time

Error Recovery during Top-Down Parsing: Acceptable-sets derived from continuation

Tekniker för storskalig parsning: Dependensparsning 2

Graph-Based Parsing. Miguel Ballesteros. Algorithms for NLP Course. 7-11

Large-Scale Syntactic Processing: Parsing the Web. JHU 2009 Summer Research Workshop

CS 314 Principles of Programming Languages. Lecture 3

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

Supplementary A. Built-in transition systems

UNIT III & IV. Bottom up parsing

Syntax Analysis Part I

Agenda for today. Homework questions, issues? Non-projective dependencies Spanning tree algorithm for non-projective parsing

LR Parsing Techniques

Computational Linguistics

The Application of Constraint Rules to Data-driven Parsing

Undirected Dependency Parsing

Dependency grammar and dependency parsing

Statistical parsing. Fei Xia Feb 27, 2009 CSE 590A

Algorithms for NLP. LR Parsing. Reading: Hopcroft and Ullman, Intro. to Automata Theory, Lang. and Comp. Section , pp.

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

Context-Free Grammar. Concepts Introduced in Chapter 2. Parse Trees. Example Grammar and Derivation

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

LL(1) predictive parsing

MIT Specifying Languages with Regular Expressions and Context-Free Grammars. Martin Rinard Massachusetts Institute of Technology

MIT Specifying Languages with Regular Expressions and Context-Free Grammars

AT&T: The Tag&Parse Approach to Semantic Parsing of Robot Spatial Commands

Vorlesung 7: Ein effizienter CYK Parser

Translator Design CRN Test 3 Revision 1 CMSC 4173 Spring 2012

CSCI312 Principles of Programming Languages!

Lexical and Syntax Analysis. Bottom-Up Parsing

Programming Language Syntax and Analysis

Easy-First POS Tagging and Dependency Parsing with Beam Search

Parsing. Handle, viable prefix, items, closures, goto s LR(k): SLR(1), LR(1), LALR(1)

Lexical Analysis. Prof. James L. Frankel Harvard University

Dependency grammar and dependency parsing

CS 4240: Compilers and Interpreters Project Phase 1: Scanner and Parser Due Date: October 4 th 2015 (11:59 pm) (via T-square)

Compiler Design Overview. Compiler Design 1

Syntax Analysis. Chapter 4

CSE 130 Programming Language Principles & Paradigms Lecture # 5. Chapter 4 Lexical and Syntax Analysis

Formal Languages and Compilers Lecture I: Introduction to Compilers

10/5/17. Lexical and Syntactic Analysis. Lexical and Syntax Analysis. Tokenizing Source. Scanner. Reasons to Separate Lexical and Syntax Analysis

Statistical Methods for NLP

Supervised Learning: The Setup. Spring 2018

Top down vs. bottom up parsing

LL(1) predictive parsing

LL(k) Parsing. Predictive Parsers. LL(k) Parser Structure. Sample Parse Table. LL(1) Parsing Algorithm. Push RHS in Reverse Order 10/17/2012

Support Vector Machine Learning for Interdependent and Structured Output Spaces

2068 (I) Attempt all questions.

SEMINAR: RECENT ADVANCES IN PARSING TECHNOLOGY. Parser Evaluation Approaches

The Perceptron. Simon Šuster, University of Groningen. Course Learning from data November 18, 2013

UNIT-III BOTTOM-UP PARSING

Density-Driven Cross-Lingual Transfer of Dependency Parsers

Iterative CKY parsing for Probabilistic Context-Free Grammars

CS 314 Principles of Programming Languages

Exam Marco Kuhlmann. This exam consists of three parts:

10/4/18. Lexical and Syntactic Analysis. Lexical and Syntax Analysis. Tokenizing Source. Scanner. Reasons to Separate Lexical and Syntactic Analysis

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Compiler Design

A Transition-Based Dependency Parser Using a Dynamic Parsing Strategy

Monday, November 9, 2015

COMP-421 Compiler Design. Presented by Dr Ioanna Dionysiou

CKY algorithm / PCFGs

Chapter 4. Lexical and Syntax Analysis

EDAN20 Language Technology Chapter 13: Dependency Parsing

Accurate Parsing and Beyond. Yoav Goldberg Bar Ilan University

Sorting Out Dependency Parsing

Lexical Analysis. Lecture 3-4

Structure of a Compiler: Scanner reads a source, character by character, extracting lexemes that are then represented by tokens.

Dependency Parsing. Johan Aulin D03 Department of Computer Science Lund University, Sweden

UNIVERSITY OF EDINBURGH COLLEGE OF SCIENCE AND ENGINEERING SCHOOL OF INFORMATICS INFR08008 INFORMATICS 2A: PROCESSING FORMAL AND NATURAL LANGUAGES

Chapter 4: LR Parsing

Parser and syntax analyzer. Context-Free Grammar Definition. Scanning and parsing. How bottom-up parsing works: Shift/Reduce tecnique.

Building Compilers with Phoenix

an incremental algorithm for transition-based ccg parsing

Ling 571: Deep Processing for Natural Language Processing

Transcription:

Dependency Parsing CMSC 723 / LING 723 / INST 725 Marine Carpuat Fig credits: Joakim Nivre, Dan Jurafsky & James Martin

Dependency Parsing Formalizing dependency trees Transition-based dependency parsing Shift-reduce parsing Transition system Oracle Learning/predicting parsing actions

Dependency Grammars Syntactic structure = lexical items linked by binary asymmetrical relations called dependencies

Dependency Relations

Example Dependency Parse They hid the letter on the shelf Compare with constituent parse What s the relation?

Dependency formalisms Most general form: a graph G = (V,A) V vertices: usually one per word in sentence A arcs (set of ordered pairs of vertices): head-dependent relations between elements in V Restricting to trees provide computational advantages Single designated ROOT node that has no incoming arcs Except for ROOT, each vertex has exactly one incoming arc Unique path from ROOT to each vertex in V Each word has a single head Dependency structure is connected There is a single root node from which there is a unique path to each word

Projectivity Arc from head to dependent is projective If there is a path from head to every word between head and dependent Dependency tree is projective If all arcs are projective Or equivalently, if it can be drawn with no crossing edges Projective trees make computation easier But most theoretical frameworks do not assume projectivity Need to capture long-distance dependencies, free word order

Data-driven dependency parsing Goal: learn a good predictor of dependency graphs Input: sentence Output: dependency graph/tree G = (V,A) Can be framed as a structured prediction task - very large output space - with interdependent labels 2 dominant approaches: transition-based parsing and graph-based parsing

Transition-based dependency parsing Builds on shift-reduce parsing [Aho & Ullman, 1927] Configuration Stack Input buffer of words Set of dependency relations Goal of parsing find a final configuration where all words accounted for Relations form dependency tree

Transition operators Transitions: produce a new configuration given current configuration Parsing is the task of Finding a sequence of transitions That leads from start state to desired goal state Start state Stack initialized with ROOT node Input buffer initialized with words in sentence Dependency relation set = empty End state Stack and word lists are empty Set of dependency relations = final parse

Arc Standard Transition System Defines 3 transition operators [Covington, 2001; Nivre 2003] LEFT-ARC: create head-dependent rel. between word at top of stack and 2 nd word (under top) remove 2 nd word from stack RIGHT-ARC: Create head-dependent rel. between word on 2 nd word on stack and word on top Remove word at top of stack SHIFT Remove word at head of input buffer Push it on the stack

Arc standard transition systems Preconditions ROOT cannot have incoming arcs LEFT-ARC cannot be applied when ROOT is the 2 nd element in stack LEFT-ARC and RIGHT-ARC require 2 elements in stack to be applied

Transition-based Dependency Parser Assume an oracle Parsing complexity Linear in sentence length! Greedy algorithm Unlike Viterbi for POS tagging

Transition-Based Parsing Illustrated

Where to we get an oracle? Multiclass classification problem Input: current parsing state (e.g., current and previous configurations) Output: one transition among all possible transitions Q: size of output space? Supervised classifiers can be used E.g., perceptron Open questions What are good features for this task? Where do we get training examples?

Generating Training Examples What we have in a treebank What we need to train an oracle Pairs of configurations and predicted parsing action

Generating training examples Approach: simulate parsing to generate reference tree Given A current config with stack S, dependency relations Rc A reference parse (V,Rp) Do

Let s try it out

Features Configuration consist of stack, buffer, current set of relations Typical features Features focus on top level of stack Use word forms, POS, and their location in stack and buffer

Features example Given configuration Example of useful features

Dependency Parsing Formalizing dependency trees Transition-based dependency parsing Shift-reduce parsing Transition system Oracle Learning/predicting parsing actions