SlideShare a Scribd company logo
1 of 17
Download to read offline
Natural Language Processing
Emory University
Jinho D. Choi
Tree-Adjoining
Grammar
Mildly Context-Sensitive Grammar
• Why another grammar?
- Context-free grammar cannot capture all linguistic phenomena.
- Context-sensitive grammar takes exponential time for parsing.
• Mildly context-sensitive grammar
- Can capture all linguistic phenomena in CFG and more.
- Can be parsed in polynomial time.
- Grows linearly as the string length grows.
• Formalisms
- Tree-adjoining grammars (TAG).
- Combinatory categorial grammars (CCG).
2
Tree-Adjoining Grammars
• Tree generating system
- What are the elementary objects of CFG?
- What are the elementary objects of TAG?
3
S, NP, VP, N, V, D,
I, bought, a, car
buy a car
ND
V
N
NP
VP
NP VP
will
V
S
buy
V NP1↓
VPNP0↓
S
car
ND↓
NP
a
D
VP*
VP
will
V
N
NP
← Strings ↑ Trees
Tree-Adjoining Grammars
• G = (N, Σ, S, I, A)
- N : a finite set of non-terminals.
- Σ : a finite set of terminals.
- S : a start symbol representing the whole sentence, where S ∈ N.
- I : a finite set of initial trees.
- A : a finite set of auxiliary trees.
4
Same as CFG
No production rules?
Substitution & Adjunction
Elementary trees
Elementary Tree
• Elementary trees (initial trees ∪ auxiliary trees)
- Interior nodes are labeled by non-terminals.
- Nodes on the frontier are labeled by terminals or non-terminals.
- Non-terminal nodes on the frontier are marked for substitution (↓).
• The foot node in an auxiliary tree is marked for adjunction (*).
• The foot node must have the same label as the root node.
5
VP*
VP
will
V
buy
V NP1↓
VPNP0↓
S
car
ND↓
NP
a
D
N
NP
Initial trees Auxiliary tree
Derivation
• Substitution
- Substitute X↓ with a tree whose root node is labeled by X.
- Only trees derived from initial trees can be substituted.
6
buy
V NP1↓
VPNP0↓
S
car
ND↓
NP
a
DN
NP
VP*
VP
will
V
car
ND
NP
a
Which NP?
car
ND
NP
a
V
VP
S
buy
N
NP
Derivation
• Adjunction
- Adjoin X* with a tree containing a non-substitution node labeled by X.
- Any adjunction on X↓ is not allowed.
7
car
ND
NP
a
V
VP
S
buy
N
NP VP*
VP
will
VVP
S
N
NP
N VP*
NP VP
will
V
S
car
ND
NP
a
V
VP
buy buy a car
ND
V
N
NP
VP
NP VP
will
V
S
Derivation Tree
• Derivation Tree
- Derived tree: a tree composed by two other trees.
- A tree showing how a derived tree was constructed.
8
buy
V NP1↓
VPNP0↓
S
αbuy
car
ND↓
NP
αcar
N
NP
αJohn
a
D
αa
VP*
VP
will
V
αwill
12
2.21
What kind of tree is this?
Lexicalization
• Lexicalized grammar
- A finite set of structures each associated with a lexical item (anchor).
- Operations composing the structures.
9
Design elementary trees using only substitutions
bought a car
ND
V
N
NP
VP
NP VP
almost
AP
S
A
by taking

1.The leftmost lexical item
2.The rightmost lexical item
3.The head lexical item


as the anchor of each phrase.
Lexicalization with Substitution
10
VP↓NP↓
S
N
VP↓
VP
almost
AP
A
bought
V NP↓
VP
a
N↓D
NP
car
N
Leftmost
lexical item
N
NP
almost
AP
A
bought
V
a
D
car
ND↓
V↓ NP
VP
NP↓ VP
AP↓
S
Rightmost
lexical item
bought
V NP↓
VP
NP↓ VP
AP↓
S
N
NP
almost
AP
A
car
ND↓
NP
a
D
Head
lexical item
Which gives the most meaningful trees?
Is this ideal?
Lexicalization with Adjunction
11
John bought a car John almost bought a car John bought a car too
bought
V NP↓
VP
S
NP↓
bought
V NP↓
VP
NP↓ VP
AP↓
S
bought
V NP↓
VP
NP↓
S
VP
AP↓
What should be included in the domain of locality for “bought”?
VP*
VP
A
AP
almost
AP
VP
A
VP*
toobought
V NP↓
VP
S
NP↓
Domain of Locality
• CFG vs TAG
- CFG, the domain of locality is constrained to direct children.
- TAG, the domain of locality can be extended much more.
• Reading presentation
- “Domain of Locality”,Aravind Joshi, 2004.
- Presented by Kate Silverstein.
• Next week’s readings
- “Synchronous Tree Adjoining Grammars”.
- Shieber & Schabes, 1990.
12
Exercises
• Wh-question
- What did John buy for Mary
• Relative clause
- John bought a car which Mary wanted
• Light-verb construction
- John made a bid for the car
• Verb-particle construction
- Mary threw the car away
13
Wh-Question
14
V
NP VP
S
S
V
buy
NP
!
PP
P NP
for
N
Mary
N
Johndid
NP
S
N
What
“What did John buy for Mary”
V
NP↓ VP
S
S
NP↓
buy
NP
!
PP↓
NP
N
John
PP
P NP↓
for
S
V S*
did
NP
N
Wh
NP
N
Mary
Relative Clause
15
“John bought a car which Mary wanted”
a
D
bought
V NP↓
VP
S
NP↓
NP
N
John car
ND↓
NP NP
N
Mary NP↓ S
S
NP
NP*
NP↓ VP
V NP
!wanted
NP
N
which
NP S
S
NP
NP VP
V NP
!wanted
N
Mary
N
whicha
ND
NP
car
VP
V
bought
NP
John
N
S
Could it be adjoined earlier?
Light-Verb Construction
16
“John made a bid for the car”
made
V NP
VP
NP↓
S
VP
PP↓
D↓ N
bid
NP
N
John
PP
P NP↓
for car
ND↓
NP
a
D
the
D
made
V NP
VP
NP
S
VP
PP
D N
bid
P NP
for car
ND
theaJohn
N
Verb-Particle Construction
17
“Mary threw the car away”
threw
V NP↓
VP
S
NP↓
P
away
NP
N
Mary
the
D
car
ND↓
NP
threw
V NP
VP
S
NP
P
awayMary the car
N
ND

More Related Content

What's hot

Parts of Speect Tagging
Parts of Speect TaggingParts of Speect Tagging
Parts of Speect Tagging
theyaseen51
 
Context free grammars
Context free grammarsContext free grammars
Context free grammars
Ronak Thakkar
 

What's hot (20)

Analyzing Text Preprocessing and Feature Selection Methods for Sentiment Anal...
Analyzing Text Preprocessing and Feature Selection Methods for Sentiment Anal...Analyzing Text Preprocessing and Feature Selection Methods for Sentiment Anal...
Analyzing Text Preprocessing and Feature Selection Methods for Sentiment Anal...
 
Universal Dependencies
Universal DependenciesUniversal Dependencies
Universal Dependencies
 
Parts of Speect Tagging
Parts of Speect TaggingParts of Speect Tagging
Parts of Speect Tagging
 
Language models
Language modelsLanguage models
Language models
 
Types of Language in Theory of Computation
Types of Language in Theory of ComputationTypes of Language in Theory of Computation
Types of Language in Theory of Computation
 
Top Down Parsing, Predictive Parsing
Top Down Parsing, Predictive ParsingTop Down Parsing, Predictive Parsing
Top Down Parsing, Predictive Parsing
 
Natural Language Processing - Unit 1
Natural Language Processing - Unit 1Natural Language Processing - Unit 1
Natural Language Processing - Unit 1
 
Context free grammars
Context free grammarsContext free grammars
Context free grammars
 
NLP_KASHK:Finite-State Morphological Parsing
NLP_KASHK:Finite-State Morphological ParsingNLP_KASHK:Finite-State Morphological Parsing
NLP_KASHK:Finite-State Morphological Parsing
 
Presentation on Text Classification
Presentation on Text ClassificationPresentation on Text Classification
Presentation on Text Classification
 
Lecture: Word Sense Disambiguation
Lecture: Word Sense DisambiguationLecture: Word Sense Disambiguation
Lecture: Word Sense Disambiguation
 
Compiler optimization
Compiler optimizationCompiler optimization
Compiler optimization
 
CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR
 
Text classification presentation
Text classification presentationText classification presentation
Text classification presentation
 
Lightweight Natural Language Processing (NLP)
Lightweight Natural Language Processing (NLP)Lightweight Natural Language Processing (NLP)
Lightweight Natural Language Processing (NLP)
 
Nlp ambiguity presentation
Nlp ambiguity presentationNlp ambiguity presentation
Nlp ambiguity presentation
 
Challenges in nlp
Challenges in nlpChallenges in nlp
Challenges in nlp
 
Parsing
ParsingParsing
Parsing
 
Natural lanaguage processing
Natural lanaguage processingNatural lanaguage processing
Natural lanaguage processing
 
Generics C#
Generics C#Generics C#
Generics C#
 

More from Jinho Choi

More from Jinho Choi (20)

Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...
Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...
Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...
 
Analysis of Hierarchical Multi-Content Text Classification Model on B-SHARP D...
Analysis of Hierarchical Multi-Content Text Classification Model on B-SHARP D...Analysis of Hierarchical Multi-Content Text Classification Model on B-SHARP D...
Analysis of Hierarchical Multi-Content Text Classification Model on B-SHARP D...
 
Competence-Level Prediction and Resume & Job Description Matching Using Conte...
Competence-Level Prediction and Resume & Job Description Matching Using Conte...Competence-Level Prediction and Resume & Job Description Matching Using Conte...
Competence-Level Prediction and Resume & Job Description Matching Using Conte...
 
Transformers to Learn Hierarchical Contexts in Multiparty Dialogue for Span-b...
Transformers to Learn Hierarchical Contexts in Multiparty Dialogue for Span-b...Transformers to Learn Hierarchical Contexts in Multiparty Dialogue for Span-b...
Transformers to Learn Hierarchical Contexts in Multiparty Dialogue for Span-b...
 
The Myth of Higher-Order Inference in Coreference Resolution
The Myth of Higher-Order Inference in Coreference ResolutionThe Myth of Higher-Order Inference in Coreference Resolution
The Myth of Higher-Order Inference in Coreference Resolution
 
Noise Pollution in Hospital Readmission Prediction: Long Document Classificat...
Noise Pollution in Hospital Readmission Prediction: Long Document Classificat...Noise Pollution in Hospital Readmission Prediction: Long Document Classificat...
Noise Pollution in Hospital Readmission Prediction: Long Document Classificat...
 
Abstract Meaning Representation
Abstract Meaning RepresentationAbstract Meaning Representation
Abstract Meaning Representation
 
Semantic Role Labeling
Semantic Role LabelingSemantic Role Labeling
Semantic Role Labeling
 
CKY Parsing
CKY ParsingCKY Parsing
CKY Parsing
 
CS329 - WordNet Similarities
CS329 - WordNet SimilaritiesCS329 - WordNet Similarities
CS329 - WordNet Similarities
 
CS329 - Lexical Relations
CS329 - Lexical RelationsCS329 - Lexical Relations
CS329 - Lexical Relations
 
Automatic Knowledge Base Expansion for Dialogue Management
Automatic Knowledge Base Expansion for Dialogue ManagementAutomatic Knowledge Base Expansion for Dialogue Management
Automatic Knowledge Base Expansion for Dialogue Management
 
Attention is All You Need for AMR Parsing
Attention is All You Need for AMR ParsingAttention is All You Need for AMR Parsing
Attention is All You Need for AMR Parsing
 
Graph-to-Text Generation and its Applications to Dialogue
Graph-to-Text Generation and its Applications to DialogueGraph-to-Text Generation and its Applications to Dialogue
Graph-to-Text Generation and its Applications to Dialogue
 
Real-time Coreference Resolution for Dialogue Understanding
Real-time Coreference Resolution for Dialogue UnderstandingReal-time Coreference Resolution for Dialogue Understanding
Real-time Coreference Resolution for Dialogue Understanding
 
Topological Sort
Topological SortTopological Sort
Topological Sort
 
Tries - Put
Tries - PutTries - Put
Tries - Put
 
Multi-modal Embedding Learning for Early Detection of Alzheimer's Disease
Multi-modal Embedding Learning for Early Detection of Alzheimer's DiseaseMulti-modal Embedding Learning for Early Detection of Alzheimer's Disease
Multi-modal Embedding Learning for Early Detection of Alzheimer's Disease
 
Building Widely-Interpretable Semantic Networks for Dialogue Contexts
Building Widely-Interpretable Semantic Networks for Dialogue ContextsBuilding Widely-Interpretable Semantic Networks for Dialogue Contexts
Building Widely-Interpretable Semantic Networks for Dialogue Contexts
 
How to make Emora talk about Sports Intelligently
How to make Emora talk about Sports IntelligentlyHow to make Emora talk about Sports Intelligently
How to make Emora talk about Sports Intelligently
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

CS571: Tree Adjoining Grammar

  • 1. Natural Language Processing Emory University Jinho D. Choi Tree-Adjoining Grammar
  • 2. Mildly Context-Sensitive Grammar • Why another grammar? - Context-free grammar cannot capture all linguistic phenomena. - Context-sensitive grammar takes exponential time for parsing. • Mildly context-sensitive grammar - Can capture all linguistic phenomena in CFG and more. - Can be parsed in polynomial time. - Grows linearly as the string length grows. • Formalisms - Tree-adjoining grammars (TAG). - Combinatory categorial grammars (CCG). 2
  • 3. Tree-Adjoining Grammars • Tree generating system - What are the elementary objects of CFG? - What are the elementary objects of TAG? 3 S, NP, VP, N, V, D, I, bought, a, car buy a car ND V N NP VP NP VP will V S buy V NP1↓ VPNP0↓ S car ND↓ NP a D VP* VP will V N NP ← Strings ↑ Trees
  • 4. Tree-Adjoining Grammars • G = (N, Σ, S, I, A) - N : a finite set of non-terminals. - Σ : a finite set of terminals. - S : a start symbol representing the whole sentence, where S ∈ N. - I : a finite set of initial trees. - A : a finite set of auxiliary trees. 4 Same as CFG No production rules? Substitution & Adjunction Elementary trees
  • 5. Elementary Tree • Elementary trees (initial trees ∪ auxiliary trees) - Interior nodes are labeled by non-terminals. - Nodes on the frontier are labeled by terminals or non-terminals. - Non-terminal nodes on the frontier are marked for substitution (↓). • The foot node in an auxiliary tree is marked for adjunction (*). • The foot node must have the same label as the root node. 5 VP* VP will V buy V NP1↓ VPNP0↓ S car ND↓ NP a D N NP Initial trees Auxiliary tree
  • 6. Derivation • Substitution - Substitute X↓ with a tree whose root node is labeled by X. - Only trees derived from initial trees can be substituted. 6 buy V NP1↓ VPNP0↓ S car ND↓ NP a DN NP VP* VP will V car ND NP a Which NP? car ND NP a V VP S buy N NP
  • 7. Derivation • Adjunction - Adjoin X* with a tree containing a non-substitution node labeled by X. - Any adjunction on X↓ is not allowed. 7 car ND NP a V VP S buy N NP VP* VP will VVP S N NP N VP* NP VP will V S car ND NP a V VP buy buy a car ND V N NP VP NP VP will V S
  • 8. Derivation Tree • Derivation Tree - Derived tree: a tree composed by two other trees. - A tree showing how a derived tree was constructed. 8 buy V NP1↓ VPNP0↓ S αbuy car ND↓ NP αcar N NP αJohn a D αa VP* VP will V αwill 12 2.21 What kind of tree is this?
  • 9. Lexicalization • Lexicalized grammar - A finite set of structures each associated with a lexical item (anchor). - Operations composing the structures. 9 Design elementary trees using only substitutions bought a car ND V N NP VP NP VP almost AP S A by taking
 1.The leftmost lexical item 2.The rightmost lexical item 3.The head lexical item 
 as the anchor of each phrase.
  • 10. Lexicalization with Substitution 10 VP↓NP↓ S N VP↓ VP almost AP A bought V NP↓ VP a N↓D NP car N Leftmost lexical item N NP almost AP A bought V a D car ND↓ V↓ NP VP NP↓ VP AP↓ S Rightmost lexical item bought V NP↓ VP NP↓ VP AP↓ S N NP almost AP A car ND↓ NP a D Head lexical item Which gives the most meaningful trees? Is this ideal?
  • 11. Lexicalization with Adjunction 11 John bought a car John almost bought a car John bought a car too bought V NP↓ VP S NP↓ bought V NP↓ VP NP↓ VP AP↓ S bought V NP↓ VP NP↓ S VP AP↓ What should be included in the domain of locality for “bought”? VP* VP A AP almost AP VP A VP* toobought V NP↓ VP S NP↓
  • 12. Domain of Locality • CFG vs TAG - CFG, the domain of locality is constrained to direct children. - TAG, the domain of locality can be extended much more. • Reading presentation - “Domain of Locality”,Aravind Joshi, 2004. - Presented by Kate Silverstein. • Next week’s readings - “Synchronous Tree Adjoining Grammars”. - Shieber & Schabes, 1990. 12
  • 13. Exercises • Wh-question - What did John buy for Mary • Relative clause - John bought a car which Mary wanted • Light-verb construction - John made a bid for the car • Verb-particle construction - Mary threw the car away 13
  • 14. Wh-Question 14 V NP VP S S V buy NP ! PP P NP for N Mary N Johndid NP S N What “What did John buy for Mary” V NP↓ VP S S NP↓ buy NP ! PP↓ NP N John PP P NP↓ for S V S* did NP N Wh NP N Mary
  • 15. Relative Clause 15 “John bought a car which Mary wanted” a D bought V NP↓ VP S NP↓ NP N John car ND↓ NP NP N Mary NP↓ S S NP NP* NP↓ VP V NP !wanted NP N which NP S S NP NP VP V NP !wanted N Mary N whicha ND NP car VP V bought NP John N S Could it be adjoined earlier?
  • 16. Light-Verb Construction 16 “John made a bid for the car” made V NP VP NP↓ S VP PP↓ D↓ N bid NP N John PP P NP↓ for car ND↓ NP a D the D made V NP VP NP S VP PP D N bid P NP for car ND theaJohn N
  • 17. Verb-Particle Construction 17 “Mary threw the car away” threw V NP↓ VP S NP↓ P away NP N Mary the D car ND↓ NP threw V NP VP S NP P awayMary the car N ND