0% found this document useful (0 votes)
3 views26 pages

10-Syntax_part2

The document outlines a lecture on Syntax in Natural Language Processing, focusing on Context-Free Grammar (CFG), grammar equivalence, and sentence types. It details the structure of noun phrases and verb phrases, including agreement and subcategorization, while addressing the limitations of CFG in capturing certain linguistic constraints. The lecture also suggests alternative grammatical frameworks that may offer more elegant solutions beyond CFG.

Uploaded by

dw9324764
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views26 pages

10-Syntax_part2

The document outlines a lecture on Syntax in Natural Language Processing, focusing on Context-Free Grammar (CFG), grammar equivalence, and sentence types. It details the structure of noun phrases and verb phrases, including agreement and subcategorization, while addressing the limitations of CFG in capturing certain linguistic constraints. The lecture also suggests alternative grammatical frameworks that may offer more elegant solutions beyond CFG.

Uploaded by

dw9324764
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Year: 2024-2025

Spring Semester

Natural Language
Processing
Dr. Wafaa Samy
Dr. Hanaa Eissa
Syntax (Part 2)

Lecture (10)

2
Contents
• Context-Free Grammar (CFG) (Cont.)
o Grammar Equivalence
o Sentence Types
 Noun Phrase
• Agreement
 Verb Phrase
• Subcategorization

3
Grammar Equivalence
• Two Context Free Grammars (CFG) are
equivalent if they generate the same language
(i.e. set of strings).

4
Example (1)
Set of Non-Terminals Set of Terminals Set of Non-Terminals Set of Terminals

Start Symbol

Set of Rules

5
An English Grammar Fragment
• Sentences
• Noun phrases
o Agreement

• Verb phrases
o Subcategorization

• Prepositional phrases

6
Sentence Types
1. Declaratives: (e.g. A plane left.)
S  NP VP

2. Imperatives: (e.g. Leave!)


S  VP

3. Yes-No Questions: (e.g. Did the plane leave?)


S  Aux NP VP

4. WH Questions: (e.g. When did the plane leave?)


S  WH-NP Aux NP VP
7
Note
NP → Proper-Noun
NP → Det Nominal
Nominal → Noun | Noun Nominal
Proper-Noun → Cairo | Adel
Det → a
Det → the
Noun → flight

• Note: A CFG can be thought of as a generator for sentences.


o We could read the arrow as: rewrite the symbol on the left with
the string of symbols on the right.
o Example:
 NP → Det Nominal, rewrite NP as Det Nominal.
8
Noun Phrases
• Let’s consider the following rule in more detail:
NP  Det Nominal
• Most of the complexity of English noun
phrases is hidden in this rule.

9
Example (2): Noun Phrase
• The statement, “a flight” can be parsed (or derived) from
the rules as:
NP → Proper-Noun
NP → Det Nominal
Nominal → Noun | Noun Nominal
Proper-Noun → Cairo | Adel
Det → a
Det → the
Noun → flight

10
Determiners
• Noun phrases can start with determiners.
• Determiners can be:
o Simple lexical items: the, this, a, an, etc.
 A car.

o Or simple possessives.
 John’s car.

o Or complex recursive versions of that.


 John’s sister’s husband’s son’s car.
11
Nominal
• Contains the head and any pre- and post- modifiers
of the head.
• Pre-modifiers:
o Quantifiers, cardinals, ordinals...
 Three cars.
o Adjectives.
 Large cars.
o Ordering constraints.
 Three large cars.
 ?large three cars.
12
Post-modifiers
• Three kinds of post-modifiers:
1. Prepositional phrases (e.g. From Seattle).
o All flights from Cairo.
2. Non-finite clauses (e.g. Arriving before noon).
o Any flights arriving before noon.
3. Relative clauses (e.g. That serve breakfast).
o A flight that serve breakfast.
• Same general (recursive) rule to handle these:
o Nominal  Nominal PP
o Nominal  Nominal GerundVP
o Nominal  Nominal RelClause
13
Example (3): Noun Phrases
NP Structure: Clearly this
• Consider the NP is really about flights.
That’s the central critical
parsing (or noun in this NP. Let’s call
derivation) for the that the head.
following example:
All the morning
flights from Denver
to Tampa leaving
before 10.

Nominal  Nominal PP
Nominal  Nominal GerundVP
Nominal  Nominal RelClause

14 Head
Agreement
• By agreement, we have in mind constraints that hold
among various constituents that take part in a rule or
set of rules.

• For example, in English, determiners and the head


nouns in NPs have to agree in their number.

This flight *This flights


Those flights *Those flight
(Correct) (Incorrect)
15
Problem
• Our earlier NP rules are clearly deficient since they
don’t capture the agreement constraint.
o NP → Det Nominal
 Accepts, and assigns correct structures, to grammatical
examples (this flight).
 But it is also happy with incorrect examples (*these
flight).

o Such a rule is said to overgenerate.


o We’ll come back to this in a bit.
16
Verb Phrases
• English VPs consist of a head verb along with 0 or
more following constituents which we’ll call
arguments.

17
Subcategorization
• But, even though there are many valid VP rules in
English, not all verbs are allowed to participate in all
those VP rules.
• We can subcategorize the verbs in a language
according to the sets of VP rules that they participate
in.
• This is a modern take on the traditional notion of
transitive/intransitive.
• Modern grammars may have many (i.e. 100s or such)
classes.
18
Subcategorization (Cont.)
• Sneeze: John sneezed
• Find: Please find [a flight to NY]NP
• Give: Give [me]NP[a cheaper fare]NP
• Help: Can you help [me]NP[with a flight]PP
• Prefer: I prefer [to leave earlier]TO-VP
• Told: I was told [United has a flight]S
• …
(Correct)
19
Subcategorization (Cont.)
• *John sneezed the book.
• *I prefer United has a flight.
• *Give with a flight.
(Incorrect)

• As with agreement phenomena, we need a


way to formally express the constraints.

20
Why?
• Right now, the various rules for VPs
overgenerate.
o They permit the presence of strings containing
verbs and arguments that don’t go together.
o For example: *John sneezed the book. (Incorrect)
VP  V NP
therefore, Sneezed the book is a VP since “sneeze” is
a verb and “the book” is a valid NP.

21
Possible CFG Solution
• Possible solution for
agreement. SgS  SgNP SgVP
• Can use the same trick for PlS  PlNP PlVP
all the verb/VP classes.
SgNP  SgDet SgNom
• Disadvantage: Explosion of
rules can be a problem. PlNP  PlDet PlNom
• In English, subjects and verbs have to PlVP  PlV NP
agree in person and number. Determiners
and nouns have to agree in number. SgVP  SgV NP

22
(Accepted) (Not Accepted)
Possible CFG Solution (Cont.)
• Verb-with-NP-complement  find | leave | …
• Verb-with-S-complement  think | say | believe | …
• Verb-with-no-complement  sneeze | disappear | …

• VP  Verb-with-NP-complement NP
• VP  Verb-with-S-complement S
• VP  Verb-with-no-complement

• …
23
CFG Solution for Agreement
• It works and stays within the power of CFGs.
• But it’s ugly.
• And it doesn’t scale all that well because of
the interaction among the various constraints
explodes the number of rules in our grammar.

24
The Point
• CFGs appear to be just about what we need to
account for a lot of basic syntactic structure in
English.
• But there are problems.
o That can be dealt with adequately, although not elegantly,
by staying within the CFG framework.

• There are simpler, more elegant, solutions that take


us out of the CFG framework (beyond its formal
power):
o LFG, HPSG, Construction grammar, XTAG, etc.

25

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy