Natural Language Processing

Similar documents
CS 598 Natural Language Processing

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

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

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

Grammars & Parsing, Part 1:

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

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

Chapter 4: Valence & Agreement CSLI Publications

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

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

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

Parsing of part-of-speech tagged Assamese Texts

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

Ch VI- SENTENCE PATTERNS.

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

Cross-lingual Transfer Parsing for Low-Resourced Languages: An Irish Case Study

Natural Language Processing. George Konidaris

Proof Theory for Syntacticians

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

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

THE INTERNATIONAL JOURNAL OF HUMANITIES & SOCIAL STUDIES

Accurate Unlexicalized Parsing for Modern Hebrew

Construction Grammar. University of Jena.

Theoretical Syntax Winter Answers to practice problems

The Effect of Multiple Grammatical Errors on Processing Non-Native Writing

BULATS A2 WORDLIST 2

Specifying a shallow grammatical for parsing purposes

Words come in categories

Some Principles of Automated Natural Language Information Extraction

Towards a Machine-Learning Architecture for Lexical Functional Grammar Parsing. Grzegorz Chrupa la

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

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

Context Free Grammars. Many slides from Michael Collins

Ensemble Technique Utilization for Indonesian Dependency Parser

LTAG-spinal and the Treebank

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

Project in the framework of the AIM-WEST project Annotation of MWEs for translation

Prediction of Maximal Projection for Semantic Role Labeling

Approaches to control phenomena handout Obligatory control and morphological case: Icelandic and Basque

The Interface between Phrasal and Functional Constraints

Adjectives tell you more about a noun (for example: the red dress ).

Development of the First LRs for Macedonian: Current Projects

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

SAMPLE. Chapter 1: Background. A. Basic Introduction. B. Why It s Important to Teach/Learn Grammar in the First Place

EAGLE: an Error-Annotated Corpus of Beginning Learner German

Parsing natural language

A Graph Based Authorship Identification Approach

AQUA: An Ontology-Driven Question Answering System

Adapting Stochastic Output for Rule-Based Semantics

Underlying and Surface Grammatical Relations in Greek consider

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

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

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

A Computational Evaluation of Case-Assignment Algorithms

"f TOPIC =T COMP COMP... OBJ

EdIt: A Broad-Coverage Grammar Checker Using Pattern Grammar

Dependency Annotation of Coordination for Learner Language

Refining the Design of a Contracting Finite-State Dependency Parser

Annotation Projection for Discourse Connectives

Feature-Based Grammar

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

Dear Teacher: Welcome to Reading Rods! Reading Rods offer many outstanding features! Read on to discover how to put Reading Rods to work today!

Nancy Hennessy M.Ed. 1

Analysis of Probabilistic Parsing in NLP

Pre-Processing MRSes

The building blocks of HPSG grammars. Head-Driven Phrase Structure Grammar (HPSG) HPSG grammars from a linguistic perspective

Compositional Semantics

What Can Neural Networks Teach us about Language? Graham Neubig a2-dlearn 11/18/2017

A Framework for Customizable Generation of Hypertext Presentations

Hyperedge Replacement and Nonprojective Dependency Structures

The Discourse Anaphoric Properties of Connectives

1 st Quarter (September, October, November) August/September Strand Topic Standard Notes Reading for Literature

Character Stream Parsing of Mixed-lingual Text

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

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

The Pennsylvania State University. The Graduate School. College of the Liberal Arts THE TEACHABILITY HYPOTHESIS AND CONCEPT-BASED INSTRUCTION

Achim Stein: Diachronic Corpora Aston Corpus Summer School 2011

First Grade Curriculum Highlights: In alignment with the Common Core Standards

5 th Grade Language Arts Curriculum Map

Hindi Aspectual Verb Complexes

A Dataset of Syntactic-Ngrams over Time from a Very Large Corpus of English Books

Pseudo-Passives as Adjectival Passives

Heads and history NIGEL VINCENT & KERSTI BÖRJARS The University of Manchester

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

Cross-Lingual Dependency Parsing with Universal Dependencies and Predicted PoS Labels

Hindi-Urdu Phrase Structure Annotation

The Indiana Cooperative Remote Search Task (CReST) Corpus

California Department of Education English Language Development Standards for Grade 8

Constraining X-Bar: Theta Theory

SINGLE DOCUMENT AUTOMATIC TEXT SUMMARIZATION USING TERM FREQUENCY-INVERSE DOCUMENT FREQUENCY (TF-IDF)

Second Exam: Natural Language Parsing with Neural Networks

Chapter 3: Semi-lexical categories. nor truly functional. As Corver and van Riemsdijk rightly point out, There is more

Writing a composition

LING 329 : MORPHOLOGY

LNGT0101 Introduction to Linguistics

In Udmurt (Uralic, Russia) possessors bear genitive case except in accusative DPs where they receive ablative case.

Loughton School s curriculum evening. 28 th February 2017

Using dialogue context to improve parsing performance in dialogue systems

BANGLA TO ENGLISH TEXT CONVERSION USING OPENNLP TOOLS

On the Notion Determiner

Transcription:

Natural Language Processing Syntax Joakim Nivre Uppsala University Department of Linguistics and Philology joakim.nivre@lingfil.uu.se Natural Language Processing 1(7)

What is Syntax? Words do not occur in isolation they combine into sentences Snoopy hugs Woodstock Woodstock hugs Snoopy Snoopy hugs birds *Birds hugs Snoopy Birds hug Snoopy Snoopy hugs them *Them hug Snoopy They hug Snoopy Syntax the study of sentence structure Natural Language Processing 2(7)

Two Views of Syntax Dependency: Syntactic structure resides in relations between words Focus on the functional roles (subject, object,...) Long tradition in descriptive grammar going back to Antiquity Constituency: Syntactic structure consists in the composition of phrases Focus on structural categories (noun phrase, verb phrase,...) Introduced in structural linguistics in the 20th century Natural Language Processing 3(7)

Dependency Syntactic structure represented by dependency trees Words represented by tree nodes Dependencies represented by directed arcs between nodes Functional roles specified by arc labels punct obj amod subj amod pmod pobj amod Economic news had little effect on financial markets. ADJ NOUN VERB ADJ NOUN ADP ADJ NOUN PUNCT Natural Language Processing 4(7)

Constituency Syntactic structure represented by phrase structure trees Words represented by terminal tree nodes (leaves) Phrases represented by internal tree nodes Phrase types specified by node labels Phrase structure trees can be defined by context-free grammars S VP NP NP PP NP NP Punct Adj Noun Verb Adj Noun Prep Adj Noun Economic news had little effect on financial markets. Natural Language Processing 5(7)

Two Complementary Views? Dependency trees explicitly represent dependency relations (directed arcs) functional categories (arc labels) possibly some structural categories (parts-of-speech) Phrase structure trees explicitly represent phrases (internal nodes) structural categories (node labels) possibly some functional categories (grammatical functions) Both are widely used in NLP and hybrid representations exist Natural Language Processing 6(7)

Quiz True or false? 1. Syntax studies the internal structure or words 2. Syntax studies the order of words in sentences 3. Dependency trees show how words are related in sentences 4. Dependency trees show how sentences are composed of phrases Natural Language Processing 7(7)

Natural Language Processing Dependency Joakim Nivre Uppsala University Department of Linguistics and Philology joakim.nivre@lingfil.uu.se Natural Language Processing 1(9)

Dependency Syntactic structure consists of words, related by binary, asymmetric relations called dependencies Economic news had little effect on financial markets. ADJ NOUN VERB ADJ NOUN ADP ADJ NOUN PUNCT Natural Language Processing 2(9)

Dependency Syntactic structure consists of words, related by binary, asymmetric relations called dependencies Economic news had little effect on financial markets. ADJ NOUN VERB ADJ NOUN ADP ADJ NOUN PUNCT Natural Language Processing 2(9)

Dependency Syntactic structure consists of words, related by binary, asymmetric relations called dependencies Economic news had little effect on financial markets. ADJ NOUN VERB ADJ NOUN ADP ADJ NOUN PUNCT Natural Language Processing 2(9)

Dependency Syntactic structure consists of words, related by binary, asymmetric relations called dependencies Economic news had little effect on financial markets. ADJ NOUN VERB ADJ NOUN ADP ADJ NOUN PUNCT Natural Language Processing 2(9)

Dependency Syntactic structure consists of words, related by binary, asymmetric relations called dependencies Economic news had little effect on financial markets. ADJ NOUN VERB ADJ NOUN ADP ADJ NOUN PUNCT Natural Language Processing 2(9)

Dependency Syntactic structure consists of words, related by binary, asymmetric relations called dependencies Economic news had little effect on financial markets. ADJ NOUN VERB ADJ NOUN ADP ADJ NOUN PUNCT Natural Language Processing 2(9)

Dependency Syntactic structure consists of words, related by binary, asymmetric relations called dependencies p obj pobj amod subj amod pmod amod Economic news had little effect on financial markets. ADJ NOUN VERB ADJ NOUN ADP ADJ NOUN PUNCT Natural Language Processing 2(9)

Terminology Higher Head Governor Regent. Lower Dependent Modifier Subordinate. Natural Language Processing 3(9)

Terminology Higher Head Governor Regent. Lower Dependent Modifier Subordinate. Natural Language Processing 3(9)

Criteria for Heads and Dependents Criteria for a syntactic relation between a head H and a dependent D in a construction C: 1. H determines the syntactic category of C; H can replace C. 2. H determines the semantic category of C; D specifies H. 3. H is obligatory; D may be optional. 4. H selects D and determines whether D is obligatory. 5. The form of D depends on H (agreement or government). 6. The linear position of D is specified with reference to H. Issues: Syntactic (and morphological) versus semantic criteria Exocentric versus endocentric constructions Natural Language Processing 4(9)

Some Clear Cases Construction Head Dependent Exocentric Verb Subject (subj) Verb Object (obj) Endocentric Verb Adverbial (advmod) Noun Attribute (amod) Economic news suddenly affected financial markets. ADJ NOUN ADV VERB ADJ NOUN PUNCT Natural Language Processing 5(9)

Some Clear Cases Construction Head Dependent Exocentric Verb Subject (subj) Verb Object (obj) Endocentric Verb Adverbial (advmod) Noun Attribute (amod) subj Economic news suddenly affected financial markets. ADJ NOUN ADV VERB ADJ NOUN PUNCT Natural Language Processing 5(9)

Some Clear Cases Construction Head Dependent Exocentric Verb Subject (subj) Verb Object (obj) Endocentric Verb Adverbial (advmod) Noun Attribute (amod) subj obj Economic news suddenly affected financial markets. ADJ NOUN ADV VERB ADJ NOUN PUNCT Natural Language Processing 5(9)

Some Clear Cases Construction Head Dependent Exocentric Verb Subject (subj) Verb Object (obj) Endocentric Verb Adverbial (advmod) Noun Attribute (amod) subj advmod obj Economic news suddenly affected financial markets. ADJ NOUN ADV VERB ADJ NOUN PUNCT Natural Language Processing 5(9)

Some Clear Cases Construction Head Dependent Exocentric Verb Subject (subj) Verb Object (obj) Endocentric Verb Adverbial (advmod) Noun Attribute (amod) amod subj advmod obj amod Economic news suddenly affected financial markets. ADJ NOUN ADV VERB ADJ NOUN PUNCT Natural Language Processing 5(9)

Some Tricky Cases Complex verb groups (auxiliary main verb) Subordinate clauses (complementizer verb) Coordination (coordinator conjuncts) Prepositional phrases (preposition nominal) Punctuation I can see that they rely on this and that. PRON AUX VERB SCONJ PRON VERB ADP PRON CONJ PRON PUNCT Natural Language Processing 6(9)

Some Tricky Cases Complex verb groups (auxiliary main verb) Subordinate clauses (complementizer verb) Coordination (coordinator conjuncts) Prepositional phrases (preposition nominal) Punctuation subj ccomp I can see that they rely on this and that. PRON AUX VERB SCONJ PRON VERB ADP PRON CONJ PRON PUNCT Natural Language Processing 6(9)

Some Tricky Cases Complex verb groups (auxiliary main verb) Subordinate clauses (complementizer verb) Coordination (coordinator conjuncts) Prepositional phrases (preposition nominal) Punctuation subj ccomp I can see that they rely on this and that. PRON AUX VERB SCONJ PRON VERB ADP PRON CONJ PRON PUNCT Natural Language Processing 6(9)

Some Tricky Cases Complex verb groups (auxiliary main verb) Subordinate clauses (complementizer verb) Coordination (coordinator conjuncts) Prepositional phrases (preposition nominal) Punctuation I can see that they rely on this and that. PRON AUX VERB SCONJ PRON VERB ADP PRON CONJ PRON PUNCT Natural Language Processing 6(9)

Some Tricky Cases Complex verb groups (auxiliary main verb) Subordinate clauses (complementizer verb) Coordination (coordinator conjuncts) Prepositional phrases (preposition nominal) Punctuation I can see that they rely on this and that. PRON AUX VERB SCONJ PRON VERB ADP PRON CONJ PRON PUNCT Natural Language Processing 6(9)

Some Tricky Cases Complex verb groups (auxiliary main verb) Subordinate clauses (complementizer verb) Coordination (coordinator conjuncts) Prepositional phrases (preposition nominal) Punctuation I can see that they rely on this and that. PRON AUX VERB SCONJ PRON VERB ADP PRON CONJ PRON PUNCT Natural Language Processing 6(9)

Treebanks Treebanks Syntactically annotated corpora are called treebanks Treebanks can be used to train and evaluate syntactic parsers Dependency treebanks Treebanks with dependency-based annotation Example: Prague Dependency Treebank of Czech Annotation schemes can vary considerably across languages Natural Language Processing 7(9)

Universal Dependencies (UD) Standardized framework for dependency annotation Consistent analysis across typologically different languages obl obj case det nsubj det det DET NOUN VERB DET NOUN ADP DET NOUN the dog chased the cat from the room koira jahtasi kissan huoneesta NOUN VERB NOUN NOUN Case=Nom Case=Acc Case=Ela nsubj obj obl Natural Language Processing 8(9)

Quiz The big bear scared the little dog. True or false 1. The word dog is a dependent of the word bear 2. The word bear is a dependent of the word scared 3. The word scared is a dependent of the word little 4. The word little is a dependent of the word dog Natural Language Processing 9(9)

Natural Language Processing Constituency Joakim Nivre Uppsala University Department of Linguistics and Philology joakim.nivre@lingfil.uu.se Natural Language Processing 1(11)

Constituency Word groups can act as single units Los Angeles a high-class spot such as Mindy s three parties from Brooklyn they Such groups of words are called constituents Constituents have similar internal structure and behavior Natural Language Processing 2(11)

Immediate Constituency Analysis We can find constituents by recursive decomposition: The girl in the corner wears a yellow hat and dark sunglasses. Natural Language Processing 3(11)

Immediate Constituency Analysis We can find constituents by recursive decomposition: The girl in the corner wears a yellow hat and dark sunglasses. The girl in the corner + wears a yellow hat and dark sunglasses. Natural Language Processing 3(11)

Immediate Constituency Analysis We can find constituents by recursive decomposition: The girl in the corner wears a yellow hat and dark sunglasses. The girl in the corner + wears a yellow hat and dark sunglasses. [The girl + in the corner] [wears + a yellow hat and dark sunglasses]. Natural Language Processing 3(11)

Immediate Constituency Analysis We can find constituents by recursive decomposition: The girl in the corner wears a yellow hat and dark sunglasses. The girl in the corner + wears a yellow hat and dark sunglasses. [The girl + in the corner] [wears + a yellow hat and dark sunglasses]. [The + girl] [in + the corner] wears [a yellow hat + and + dark sunglasses]. Natural Language Processing 3(11)

Immediate Constituency Analysis We can find constituents by recursive decomposition: The girl in the corner wears a yellow hat and dark sunglasses. The girl in the corner + wears a yellow hat and dark sunglasses. [The girl + in the corner] [wears + a yellow hat and dark sunglasses]. [The + girl] [in + the corner] wears [a yellow hat + and + dark sunglasses]. The girl in [the + corner] wears [a + yellow hat] and [dark + sunglasses]. Natural Language Processing 3(11)

Immediate Constituency Analysis We can find constituents by recursive decomposition: The girl in the corner wears a yellow hat and dark sunglasses. The girl in the corner + wears a yellow hat and dark sunglasses. [The girl + in the corner] [wears + a yellow hat and dark sunglasses]. [The + girl] [in + the corner] wears [a yellow hat + and + dark sunglasses]. The girl in [the + corner] wears [a + yellow hat] and [dark + sunglasses]. The girl in the corner wears a [yellow + hat] and dark sunglasses. Natural Language Processing 3(11)

Test for Constituents Substitution: similar constituents can replace each other The girl in the corner wears a yellow hat and dark sunglasses The girl wears a yellow hat and dark sunglasses She wears a yellow hat and dark sunglasses *In the corner wears a yellow hat and dark sunglasses Movement: words in a constituent move together She went to Paris on Monday. On Monday she went to Paris. *Paris on Monday she went to. *On she went to Paris Monday. Natural Language Processing 4(11)

Constituent Types Noun phrase (NP) she the house Robin Hood and his merry men Verb phrase (VP) blushed loves Mary was told to sit down and be quiet Prepositional phrase (PP) on it with the telescope through the foggy dew Natural Language Processing 5(11)

Context-Free Grammar Acontext-freegrammar(CFG)consistsof a finite set of nonterminal symbols a finite set of terminal symbols a distinguished nonterminal symbol S (for Start) a finite set of rules of the form A α where A is a nonterminal and α is a (possibly empty) sequence of nonterminal and terminal symbols Natural Language Processing 6(11)

Example Grammar S NP VP Punct Verb had VP VP PP Noun news VP Verb NP Noun effect NP NP PP Noun markets NP Adj Noun Adj Economic PP Prep NP Adj little Adj financial Prep on Punct. Natural Language Processing 7(11)

Example Grammar Grammar Lexicon S NP VP Punct Verb had VP VP PP Noun news VP Verb NP Noun effect NP NP PP Noun markets NP Adj Noun Adj Economic PP Prep NP Adj little Adj financial Prep on Punct. Natural Language Processing 7(11)

Derivations S Natural Language Processing 8(11)

Derivations S NP VP Punct Natural Language Processing 8(11)

Derivations S NP VP Punct Adj Noun VP Punct Natural Language Processing 8(11)

Derivations S NP VP Punct Adj Noun VP Punct Economic Noun VP Punct Natural Language Processing 8(11)

Derivations S NP VP Punct Adj Noun VP Punct Economic Noun VP Punct Economic news VP Punct Natural Language Processing 8(11)

Derivations S NP VP Punct Adj Noun VP Punct Economic Noun VP Punct Economic news VP Punct Economic news Verb NP Punct Natural Language Processing 8(11)

Derivations S NP VP Punct Adj Noun VP Punct Economic Noun VP Punct Economic news VP Punct Economic news Verb NP Punct Economic news had NP Punct Natural Language Processing 8(11)

Derivations S NP VP Punct Adj Noun VP Punct Economic Noun VP Punct Economic news VP Punct Economic news Verb NP Punct Economic news had NP Punct Economic news had NP PP Punct Natural Language Processing 8(11)

Derivations S NP VP Punct Adj Noun VP Punct Economic Noun VP Punct Economic news VP Punct Economic news Verb NP Punct Economic news had NP Punct Economic news had NP PP Punct Economic news had Adj Noun PP Punct Natural Language Processing 8(11)

Derivations S NP VP Punct Adj Noun VP Punct Economic Noun VP Punct Economic news VP Punct Economic news Verb NP Punct Economic news had NP Punct Economic news had NP PP Punct Economic news had Adj Noun PP Punct Economic news had little Noun PP Punct Natural Language Processing 8(11)

Derivations S NP VP Punct Adj Noun VP Punct Economic Noun VP Punct Economic news VP Punct Economic news Verb NP Punct Economic news had NP Punct Economic news had NP PP Punct Economic news had Adj Noun PP Punct Economic news had little Noun PP Punct Economic news had little effect PP Punct Natural Language Processing 8(11)

Derivations S NP VP Punct Adj Noun VP Punct Economic Noun VP Punct Economic news VP Punct Economic news Verb NP Punct Economic news had NP Punct Economic news had NP PP Punct Economic news had Adj Noun PP Punct Economic news had little Noun PP Punct Economic news had little effect PP Punct Economic news had little effect Prep NP Punct Natural Language Processing 8(11)

Derivations S NP VP Punct Adj Noun VP Punct Economic Noun VP Punct Economic news VP Punct Economic news Verb NP Punct Economic news had NP Punct Economic news had NP PP Punct Economic news had Adj Noun PP Punct Economic news had little Noun PP Punct Economic news had little effect PP Punct Economic news had little effect Prep NP Punct Economic news had little effect on NP Punct Natural Language Processing 8(11)

Derivations S NP VP Punct Adj Noun VP Punct Economic Noun VP Punct Economic news VP Punct Economic news Verb NP Punct Economic news had NP Punct Economic news had NP PP Punct Economic news had Adj Noun PP Punct Economic news had little Noun PP Punct Economic news had little effect PP Punct Economic news had little effect Prep NP Punct Economic news had little effect on NP Punct Economic news had little effect on Adj Noun Punct Natural Language Processing 8(11)

Derivations S NP VP Punct Adj Noun VP Punct Economic Noun VP Punct Economic news VP Punct Economic news Verb NP Punct Economic news had NP Punct Economic news had NP PP Punct Economic news had Adj Noun PP Punct Economic news had little Noun PP Punct Economic news had little effect PP Punct Economic news had little effect Prep NP Punct Economic news had little effect on NP Punct Economic news had little effect on Adj Noun Punct Economic news had little effect on financial Noun Punct Natural Language Processing 8(11)

Derivations S NP VP Punct Adj Noun VP Punct Economic Noun VP Punct Economic news VP Punct Economic news Verb NP Punct Economic news had NP Punct Economic news had NP PP Punct Economic news had Adj Noun PP Punct Economic news had little Noun PP Punct Economic news had little effect PP Punct Economic news had little effect Prep NP Punct Economic news had little effect on NP Punct Economic news had little effect on Adj Noun Punct Economic news had little effect on financial Noun Punct Economic news had little effect on financial markets Punct Natural Language Processing 8(11)

Derivations S NP VP Punct Adj Noun VP Punct Economic Noun VP Punct Economic news VP Punct Economic news Verb NP Punct Economic news had NP Punct Economic news had NP PP Punct Economic news had Adj Noun PP Punct Economic news had little Noun PP Punct Economic news had little effect PP Punct Economic news had little effect Prep NP Punct Economic news had little effect on NP Punct Economic news had little effect on Adj Noun Punct Economic news had little effect on financial Noun Punct Economic news had little effect on financial markets Punct Economic news had little effect on financial markets. Natural Language Processing 8(11)

Phrase Structure Trees S NP VP Punct Adj Noun VP Punct Economic Noun VP Punct Economic news VP Punct Economic news Verb NP Punct Economic news had NP Punct Economic news had NP PP Punct Economic news had Adj Noun PP Punct Economic news had little Noun PP Punct Economic news had little effect PP Punct Economic news had little effect Prep NP Punct Economic news had little effect on NP Punct Economic news had little effect on Adj Noun Punct Economic news had little effect on financial Noun Punct Economic news had little effect on financial markets Punct Economic news had little effect on financial markets. S VP NP PP NP NP NP Adj Noun Verb Adj Noun Prep Adj Noun Punct Economic news had little effect on financial markets. Natural Language Processing 9(11)

Treebanks and Grammars Constituency treebanks Treebanks with constituency-based annotation Example: Penn Treebank of English Treebank grammars We can extract CFGs from constituency treebanks Treebank grammars can be used to build syntactic parsers Natural Language Processing 10(11)

Quiz The big bear scared the little dog. True or false 1. The substring dog is a noun phrase 2. The substring little dog is a noun phrase 3. The substring the little dog is a noun phrase 4. The substring scared the little dog is a noun phrase 5. The substring scared the little dog is a verb phrase Natural Language Processing 11(11)

Natural Language Processing Universal Dependencies Joakim Nivre Uppsala University Department of Linguistics and Philology joakim.nivre@lingfil.uu.se Natural Language Processing 1(13)

Universal Dependencies (UD) Framework for multilingual grammatical annotation Morphological layer: Part-of-speech tags Morphological features Lemmas Syntactic layer: Dependency tree Natural Language Processing 2(13)

Predicates and Arguments nsubj obj iobj nsubj Snoopy barked Natural Language Processing 3(13)

Predicates and Arguments nsubj obj iobj nsubj nsubj obj Snoopy barked Snoopy hugged Woodstock Natural Language Processing 3(13)

Predicates and Arguments nsubj obj iobj nsubj nsubj obj Snoopy barked Snoopy hugged Woodstock obj nsubj iobj Snoopy gave Woodstock food Natural Language Processing 3(13)

Predicates and Modifiers advmod obl nsubj advmod Snoopy barked angrily Natural Language Processing 4(13)

Predicates and Modifiers advmod obl obl nsubj advmod nsubj obj case Snoopy barked angrily Snoopy hugged Woodstock in Paris Natural Language Processing 4(13)

Predicates and Modifiers advmod obl obl nsubj advmod nsubj obj case Snoopy barked angrily Snoopy hugged Woodstock in Paris obl nsubj obj case Snoopy gave food to Woodstock Natural Language Processing 4(13)

Noun Phrases amod nmod amod black coffee Natural Language Processing 5(13)

Noun Phrases amod nmod nmod amod black coffee case coffee with cream Natural Language Processing 5(13)

Noun Phrases amod nmod nmod amod black coffee case coffee with cream nmod amod case black coffee with cream Natural Language Processing 5(13)

Quiz Snoopy likes tasty bagels Which words are dependents of likes? 1. Snoopy 2. likes 3. tasty 4. bagels Natural Language Processing 6(13)

Quiz Snoopy likes tasty bagels Which dependency relation does bagels have to its head? 1. nsubj 2. obj 3. obl 4. nmod Natural Language Processing 7(13)

Function Words aux case det obj nsubj det Snoopy hugged the bird Natural Language Processing 8(13)

Function Words aux case det obj nsubj nsubj det aux obj Snoopy hugged the bird Snoopy will hug Woodstock Natural Language Processing 8(13)

Function Words aux case det obj nsubj nsubj det aux obj Snoopy hugged the bird Snoopy will hug Woodstock nsubj aux aux obl case det Snoopy could have slept on the roof Natural Language Processing 8(13)

Subordinate Clauses ccomp mark nsubj nsubj aux obj ccomp xcomp mark Snoopy promised that he would hug Woodstock Natural Language Processing 9(13)

Subordinate Clauses ccomp mark nsubj nsubj aux obj ccomp xcomp mark Snoopy promised that he would hug Woodstock xcomp nsubj mark obj Snoopy promised to hug Woodstock Natural Language Processing 9(13)

Adverbial and Adnominal Clauses advcl nsubj obj mark nsubj obj advcl acl Snoopy hugs Woodstock if Lucy hugs Linus Natural Language Processing 10(13)

Adverbial and Adnominal Clauses advcl nsubj obj mark nsubj obj advcl acl Snoopy hugs Woodstock if Lucy hugs Linus acl det nsubj obj the bird who hugged Snoopy Natural Language Processing 10(13)

Adverbial and Adnominal Clauses advcl nsubj obj mark nsubj obj advcl acl Snoopy hugs Woodstock if Lucy hugs Linus acl acl obj det nsubj obj det nsubj the bird who hugged Snoopy the bird who Snoopy hugged Natural Language Processing 10(13)

Adverbial and Adnominal Clauses advcl nsubj obj mark nsubj obj advcl acl Snoopy hugs Woodstock if Lucy hugs Linus acl:relcl acl:relcl obj det nsubj obj det nsubj the bird who hugged Snoopy the bird who Snoopy hugged Natural Language Processing 10(13)

Other Relations flat compound punct nsubj obj Charlie Brown ate a tuna bagel. Natural Language Processing 11(13)

Other Relations flat compound punct nsubj flat Charlie Brown ate a tuna bagel. Natural Language Processing 11(13)

Other Relations flat compound punct flat nsubj obj compound Charlie Brown ate a tuna bagel. Natural Language Processing 11(13)

Other Relations flat compound punct punct flat nsubj obj compound Charlie Brown ate a tuna bagel. Natural Language Processing 11(13)

Quiz Snoopy could have tried to hug Woodstock Which verb is the root of the dependency tree? 1. could 2. have 3. tried 4. hug Natural Language Processing 12(13)

Quiz Snoopy could have tried to hug Woodstock Which verbs have the dependency relation aux to its head? 1. could 2. have 3. tried 4. hug Natural Language Processing 13(13)