Syntactic Phrase Structure

Will Styler - LIGN 6


Today’s Plan


Last time, we talked about constituents


… and we realized that the world of syntax isn’t flat


Now, let’s think a bit more about those structures


Phrase Structure Rules


We have intuitions about what can be inside a noun phrase in English…


A verb phrase has constraints in English


And sentences definitely have rules in English


So, English has rules about how phrases are built


Today, we’ll talk about a very basic approach to modeling syntax


Phrase Structure Rules


Phrase structure rule format


Phrase structure rules are like building blocks of sentences


How do we build trees?


Building a phrase structure tree


A Small Phrase Structure Grammar for English


Noun Phrase Rules


Rule 1) NP -> DET N’

Rule 3) N’ -> N


Rule 1) NP -> DET N’

Rule 3) N’ -> N


… but what if there’s no determiner?


Rule 2) NP -> N’

Rule 3) N’ -> N


Rule 2) NP -> N’

Rule 3) N’ -> N


How do we deal with adjectives?


Rule 4) N’ -> ADJ N’


Rules 1, 3, 4

We can combine Rule 1, Rule 4, and Rule 3…


Rules 1, 3, 4

We can combine Rule 1, Rule 4, and Rule 3…


… Rule 4 is recursive!








(… and so on)


What about prepositions? Linguists love prepositions!

## Rule 5: NP -> NP PP ## Rule 6: PP -> P NP

Rules 5 and 6


“Two computational linguists from San Diego”


Now, let’s make a sentence!


Rule 7: S -> NP VP

Rule 8: VP -> V


A very simple sentence


Adding in a preposition (with Rule 10)


But lots of verbs are transitive, and take a noun phrase as the object (Rule 9)


… and we can bring old rules back in!


… and we can bring more old rules back in!


… and we can add on another PP


Is this starting to feel familiar?


Making Syntax Trees is combining small elements to make bigger, fancier trees



Complementizers put sentences within sentences



… we can go deeper


… and this combines with everything we’ve been doing …


… and just keeps getting worse …


So that’s how trees are grown


In NLP, trees are usually stored with nested parentheses

(S (NP (NP (DET The) (N’ (ADJ proud) (N’ (N baker)))) (PP (P from) (NP (N’ (N San Bernadino))))) (VP (V loved) (CP (C that) (S (NP (N’ (N people))) (VP (V cheered) (CP (C as) (S (NP (N’ (N Will))) (VP (VP (V ate) (NP (NP (DET the) (N’ (ADJ massive) (N’ (ADJ chocolate) (N’ (N cake))))) (PP (P from)(NP (DET the) (N’ (ADJ new) (N’ (N bakery)))))))(PP (P with) (NP (DET his) (N’ (N wife))))))))))))


We can use these trees to understand the structure of sentences!


Structural Ambiguity


Different structures can imply different meanings


I [saw the man] [with the telescope]


I saw [the man with the telescope]


John slapped his friend with the smelly fish


John slapped his friend with the smelly fish


We as humans understand what structures are plausible





- “I saw the woman who is Queen of England’s hat”

We need to account for this in NLP!


You may think…


… but in reality …


Correct parts of speech are crucial


For Next Time


Thank you!