Grammars and Constituency Structure › Worked Example

Michael BrenndoerferMay 4, 20252 min read
Language AI HandbookAll chapters
Part 7 of 67Linguistic Form: Morphology and Syntax
Chapter 46Grammars and Constituency Structure › Worked Example
Reading section 7 of 11 · Worked Example · 2 minSection 7 of 11 · 2 min

Section 7 of 11 · 2 min read

Grammars and Constituency Structure › Worked ExampleSection view · Sections in this chapter7 / 11 ↓
Reading tools Definitions, links & notes

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Notes & comments

Let us work through the ambiguous sentence with the grammar from earlier:

the dog chased the cat with a telescope

The tokens are:

Code
CollapseExpand
the  dog  chased  the  cat  with  a  telescope

The grammar allows two complete S trees.

Parse A: the prepositional phrase modifies the object noun phrase.

Code
CollapseExpand
[S
  [NP [Det the] [N dog]]
  [VP
    [V chased]
    [NP
      [NP [Det the] [N cat]]
      [PP [P with] [NP [Det a] [N telescope]]]]]]

In this parse, "the cat with a telescope" is a single NP. The cat is the one with the telescope. The VP is "chased the cat with a telescope", where the object is the entire NP. The attachment is noun phrase attachment because the PP is a sister of the inner NP "the cat" inside the larger object NP.

Parse B: the prepositional phrase modifies the verb phrase.

Code
CollapseExpand
[S
  [NP [Det the] [N dog]]
  [VP
    [VP [V chased] [NP [Det the] [N cat]]]
    [PP [P with] [NP [Det a] [N telescope]]]]]

In this parse, "with a telescope" is a sister of the VP "chased the cat". The dog used a telescope to chase the cat. The object NP is just "the cat". The attachment is verb phrase attachment because the PP combines with the VP rather than with the object NP.

Both trees have the same yield:

Code
CollapseExpand
the dog chased the cat with a telescope

The grammar does not distinguish them. A PCFG can rank them if its rule probabilities favor one attachment pattern. For example, assuming the shared rule factors have positive probability, if the grammar assigns a higher probability to VP→VP PPVP \to VP\ PP than to NP→NP PPNP \to NP\ PP, Parse B will score higher. When a PCFG is estimated from a treebank, its preferences come from those observed rule uses. In our code example below, we instead assign probabilities by hand to illustrate the scoring calculation. The worked example therefore shows both the strength and the weakness of CFGs. The grammar precisely defines the space of possible structures, but it does not by itself tell us which structure is intended.

The grammar gives us a precise space of possible structures. Ambiguity means that space contains more than one tree for the same string. Scoring can rank the alternatives; identifying a speaker's intended reading may require contextual information.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy