Natural Language Processing CS Lecture 05. Razvan C. Bunescu School of Electrical Engineering and Computer Science

Similar documents
Syntax Parsing 1. Grammars and parsing 2. Top-down and bottom-up parsing 3. Chart parsers 4. Bottom-up chart parsing 5. The Earley Algorithm

Basic Parsing with Context-Free Grammars. Some slides adapted from Julia Hirschberg and Dan Jurafsky 1

11/29/2010. Statistical Parsing. Statistical Parsing. Simple PCFG for ATIS English. Syntactic Disambiguation

Grammars & Parsing, Part 1:

CS 598 Natural Language Processing

Parsing of part-of-speech tagged Assamese Texts

Natural Language Processing. George Konidaris

Compositional Semantics

Context Free Grammars. Many slides from Michael Collins

Some Principles of Automated Natural Language Information Extraction

ENGBG1 ENGBL1 Campus Linguistics. Meeting 2. Chapter 7 (Morphology) and chapter 9 (Syntax) Pia Sundqvist

1/20 idea. We ll spend an extra hour on 1/21. based on assigned readings. so you ll be ready to discuss them in class

BANGLA TO ENGLISH TEXT CONVERSION USING OPENNLP TOOLS

Proof Theory for Syntacticians

Chapter 4: Valence & Agreement CSLI Publications

Prediction of Maximal Projection for Semantic Role Labeling

The Interface between Phrasal and Functional Constraints

UNIVERSITY OF OSLO Department of Informatics. Dialog Act Recognition using Dependency Features. Master s thesis. Sindre Wetjen

RANKING AND UNRANKING LEFT SZILARD LANGUAGES. Erkki Mäkinen DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF TAMPERE REPORT A ER E P S I M S

Construction Grammar. University of Jena.

Using dialogue context to improve parsing performance in dialogue systems

Developing a TT-MCTAG for German with an RCG-based Parser

Machine Learning from Garden Path Sentences: The Application of Computational Linguistics

Enhancing Unlexicalized Parsing Performance using a Wide Coverage Lexicon, Fuzzy Tag-set Mapping, and EM-HMM-based Lexical Probabilities

An Introduction to the Minimalist Program

Derivational: Inflectional: In a fit of rage the soldiers attacked them both that week, but lost the fight.

Analysis of Probabilistic Parsing in NLP

Informatics 2A: Language Complexity and the. Inf2A: Chomsky Hierarchy

Beyond the Pipeline: Discrete Optimization in NLP

The presence of interpretable but ungrammatical sentences corresponds to mismatches between interpretive and productive parsing.

Inleiding Taalkunde. Docent: Paola Monachesi. Blok 4, 2001/ Syntax 2. 2 Phrases and constituent structure 2. 3 A minigrammar of Italian 3

A Version Space Approach to Learning Context-free Grammars

Parsing natural language

Introduction to HPSG. Introduction. Historical Overview. The HPSG architecture. Signature. Linguistic Objects. Descriptions.

Language Acquisition Fall 2010/Winter Lexical Categories. Afra Alishahi, Heiner Drenhaus

AQUA: An Ontology-Driven Question Answering System

Target Language Preposition Selection an Experiment with Transformation-Based Learning and Aligned Bilingual Data

CS Machine Learning

LNGT0101 Introduction to Linguistics

"f TOPIC =T COMP COMP... OBJ

Update on Soar-based language processing

Modeling Attachment Decisions with a Probabilistic Parser: The Case of Head Final Structures

A Minimalist Approach to Code-Switching. In the field of linguistics, the topic of bilingualism is a broad one. There are many

Accurate Unlexicalized Parsing for Modern Hebrew

EdIt: A Broad-Coverage Grammar Checker Using Pattern Grammar

Second Exam: Natural Language Parsing with Neural Networks

Probabilistic Latent Semantic Analysis

The College Board Redesigned SAT Grade 12

A Computational Evaluation of Case-Assignment Algorithms

Efficient Normal-Form Parsing for Combinatory Categorial Grammar

Towards a MWE-driven A* parsing with LTAGs [WG2,WG3]

Linking Task: Identifying authors and book titles in verbose queries

Ch VI- SENTENCE PATTERNS.

Basic Syntax. Doug Arnold We review some basic grammatical ideas and terminology, and look at some common constructions in English.

Minimalism is the name of the predominant approach in generative linguistics today. It was first

Pre-Processing MRSes

The stages of event extraction

LTAG-spinal and the Treebank

Chunk Parsing for Base Noun Phrases using Regular Expressions. Let s first let the variable s0 be the sentence tree of the first sentence.

NATURAL LANGUAGE PARSING AND REPRESENTATION IN XML EUGENIO JAROSIEWICZ

CS 1103 Computer Science I Honors. Fall Instructor Muller. Syllabus

Achim Stein: Diachronic Corpora Aston Corpus Summer School 2011

Ensemble Technique Utilization for Indonesian Dependency Parser

School of Innovative Technologies and Engineering

The CYK -Approach to Serial and Parallel Parsing

THE INTERNATIONAL JOURNAL OF HUMANITIES & SOCIAL STUDIES

Section 3.4. Logframe Module. This module will help you understand and use the logical framework in project design and proposal writing.

Part III: Semantics. Notes on Natural Language Processing. Chia-Ping Chen

A Graph Based Authorship Identification Approach

Objectives. Chapter 2: The Representation of Knowledge. Expert Systems: Principles and Programming, Fourth Edition

Chinese Language Parsing with Maximum-Entropy-Inspired Parser

THE ROLE OF DECISION TREES IN NATURAL LANGUAGE PROCESSING

Specifying Logic Programs in Controlled Natural Language

Writing Research Articles

A Domain Ontology Development Environment Using a MRD and Text Corpus

The Role of the Head in the Interpretation of English Deverbal Compounds

Case government vs Case agreement: modelling Modern Greek case attraction phenomena in LFG

An Interactive Intelligent Language Tutor Over The Internet

Guidelines for Writing an Internship Report

Twitter Sentiment Classification on Sanders Data using Hybrid Approach

ScienceDirect. A Framework for Clustering Cardiac Patient s Records Using Unsupervised Learning Techniques

Natural Language Processing: Interpretation, Reasoning and Machine Learning

Introduction to Simulation

Theoretical Syntax Winter Answers to practice problems

CS 446: Machine Learning

Specifying a shallow grammatical for parsing purposes

Chapter 2 Rule Learning in a Nutshell

Introduction to the Revised Mathematics TEKS (2012) Module 1

The Revised Math TEKS (Grades 9-12) with Supporting Documents

The Smart/Empire TIPSTER IR System

SEMAFOR: Frame Argument Resolution with Log-Linear Models

Character Stream Parsing of Mixed-lingual Text

Words come in categories

ON THE SYNTAX AND SEMANTICS

Parsing with Treebank Grammars: Empirical Bounds, Theoretical Models, and the Structure of the Penn Treebank

2/15/13. POS Tagging Problem. Part-of-Speech Tagging. Example English Part-of-Speech Tagsets. More Details of the Problem. Typical Problem Cases

Correspondence between the DRDP (2015) and the California Preschool Learning Foundations. Foundations (PLF) in Language and Literacy

COMPUTATIONAL COMPLEXITY OF LEFT-ASSOCIATIVE GRAMMAR

Universal Grammar 2. Universal Grammar 1. Forms and functions 1. Universal Grammar 3. Conceptual and surface structure of complex clauses

Cal s Dinner Card Deals

Transcription:

Natural Language Processing CS 6840 Lecture 05 Razvan C. Bunescu School of Electrical Engineering and Computer Science bunescu@ohio.edu

Syntactic Parsing Syntactic Parsing = assigning a syntactic structure to a sentence. For CFGs: assigning a phrase-tructure tree to a sentence. Book that flight.

Syntactic Parsing as Search Parsing search through the space of all possible parse trees such that: 1. The leaves of the final parse tree coincide with the words in the input sentence. 2. The root of the parse tree is the symbol S, i.e. complete parse tree. 2 search strategies: Top-Down parsing (goal-directed search). Bottom-Up parsing (data-directed search).

Top-Down Parsing Build the parse tree from the root S down to the leaves: Expand tree nodes N by using CFG rules N N 1 N k. Grow trees downward until reaching the POS categories at the bottom of the tree. Reject trees that do not match all the words in the input.

Bottom-Up Parsing Build the parse tree from the leaf words up to the root S: Find root nodes N 1 N k in the current forest such that they match a CFG rule N N 1 N k. Reject sub-trees that cannot lead to the start symbol S.

Top-Down vs. Bottom-Up Top-down: Only searches for trees that are complete (i.e. S s) But also suggests trees that are not consistent with any of the words. Bottom-up: Only forms trees consistent with the words. But also suggests trees that make no sense globally. How expensive is the entire search process?

Syntactic Parsing as Search How to keep track of the search space and how to make choices: Which node to try to expand next. Which grammar rule to use to expand a node. Backtracking (naïve implementation of parsing): Expand the search space incrementally, choose a state to expand in the search space (depth-first, breadth-first, or other strategies). If strategy arrives at an inconsistent tree, backtrack to an unexplored search on the agenda. Doomed because of large search space and redundant work due to shared subproblems.

Large Search Space Global Ambiguity: coordination: old men and women attachment: we saw the Eiffel Tower flying to Paris Local Ambiguity

Shared Subproblems Parse the sentence: a flight from Indianapolis to Houston on NWA Use backtracking with a top-down, depth-first, left-to-right strategy: Assume a top-down parse making choices among the various Nominal rules, in particular, between these two: Nominal Noun Nominal Nominal PP Statically choosing the rules in this order leads to the following bad results, in which every part of the final tree is derived more than once:

Shared Subproblems

Syntactic Parsing using Dynamic Programming Shared subproblems dynamic programming could help. Dynamic Programming: CKY algorithm (bottom-up search). Need to transform the CFG into Chomsky Normal Form (CNF). Any CFG can be transformed into CNF automatically. Earley algorithm (top-down search). does not require a normalized grammar. a single left-to-right pass that fills an array/chart of size n + 1. more complex than CKY. Chart parsing: more general, retain completed phrases in a chart, can combine top-down and bottom-up search.

CKY Parsing: Chomsky Normal Form All rules should be of one of two forms: A B C or A w CNF conversion procedure: 1. Convert terminals to dummy non-terminals: INF-VP to VP INF-VP TO VP and TO to 2. Convert unit productions Nominal Noun Noun book flight Nominal book flight 3. Make all rules binary by adding new non-terminals: VP Verb NP PP VP VX PP VX Verb NP

L 1 Grammar

CKY Parsing: Dynamic Programming Use indeces to point at gaps between words: 0 Book 1 the 2 flight 3 through 4 Houston 5 A sentence with n words n + 1 positions. words[1] = book, words[2] = the, Define a (n + 1) (n + 1) matrix T: T[i,j] = the set of non-terminals that can generate the sequence of words between gaps i and j. T[0,n] contains S the sentence can be generated by the CFG. How can we compute T[i,j]? Only interested in the upper-triangular portion (i.e. i < j).

CKY: Dynamic Programming Recursively define the table values: 1. A T[i-1,i] if and only if there is a rule A words[i]. 2. A T[i,j] if and only if k, i < k < j, such that: B T[i,k] and C T[k,j]. There is a rule A B C in the CFG. Bottom-up computation: In order to compute the set T[i,j], the sets T[i,k] and T[k,j] need to have been computed already, for all i < k < j. (at least) two possible orderings: which one is more natural?

CKY: Bottom-Up Computation 0 i = 1 2 3 4 5 6 7 0 1 2 3 4 5 A[i,k] j = 6 A[i,j] A[k,j] 7

CKY Parsing Fill the table a column at a time, left to right, bottom to top.

CKY Parsing: Example

0 1 2 3 4 5 S NP VP S X1 VP X1 Aux NP S book include prefer S Verb NP S X2 NP X2 Verb NP S VP PP NP I he she me NP Houston NWA NP Det Nominal Nominal book flight meal money Nominal Nominal Noun Nominal Nominal PP VP book include prefer VP Verb NP VP VP PP VP X2 PP PP Prep NP

0 1 2 3 4 5 S NP VP S X1 VP X1 Aux NP S book include prefer S Verb NP S X2 NP X2 Verb NP S VP PP NP I he she me NP Houston NWA NP Det Nominal Nominal book flight meal money Nominal Nominal Noun Nominal Nominal PP VP book include prefer VP Verb NP VP VP PP VP X2 PP PP Prep NP

0 1 2 3 4 5 S NP VP S X1 VP X1 Aux NP S book include prefer S Verb NP S X2 NP X2 Verb NP S VP PP NP I he she me NP Houston NWA NP Det Nominal Nominal book flight meal money Nominal Nominal Noun Nominal Nominal PP VP book include prefer VP Verb NP VP VP PP VP X2 PP PP Prep NP

0 1 2 3 4 5 S NP VP S X1 VP X1 Aux NP S book include prefer S Verb NP S X2 NP X2 Verb NP S VP PP NP I he she me NP Houston NWA NP Det Nominal Nominal book flight meal money Nominal Nominal Noun Nominal Nominal PP VP book include prefer VP Verb NP VP VP PP VP X2 PP PP Prep NP

0 1 2 3 4 5 S NP VP S X1 VP X1 Aux NP S book include prefer S Verb NP S X2 NP X2 Verb NP S VP PP NP I he she me NP Houston NWA NP Det Nominal Nominal book flight meal money Nominal Nominal Noun Nominal Nominal PP VP book include prefer VP Verb NP VP VP PP VP X2 PP PP Prep NP

CKY Parsing How do we change the algorithm to output the parse trees? Time complexity: for computing the table? for computing all parses?

CKY Parsing The parse trees correspond to the CNF grammar, not the original CFG: complicates subsequent syntax-direct semantic analysis. Post-processing of the parse tree: For binary productions: delete the new dummy non-terminals and promote their daughters to restore the original tree. For unit productions: alter the basic CKY algorithm to handle them directly. homework exercise 13.3

CKY Parsing Does CKY solve ambiguity? Book the flight through Houston. Use probabilistic CKY parsing, output highest probability tree. Will probabilistic CKY solve all ambiguity? - One morning I shot an elephant in my pajamas. - How he got into my pajamas I don t know.

Shallow Parsing: Chunking Chunking = find all non-recursive major types of phrases: [ NP The morning flight] [ PP from] [ NP Denver] [ VP has arrived] [ NP The morning flight] from [ NP Denver] has arrived Chunking can be approached as Sequence Labeling. Evaluation: Precision (P) = Recall (R) = # correct chunks found total # chunks found # correct chunks found total # actual chunks F F 1 2 ( β + 1) PR β P + R = 2 PR = 2 P + R Currently, best NP chunking system obtains F 1 =96%.