Representing Syntactic Structure S entence N oun V erb P hrase P hrase N oun P hrase N oun V erb N oun cows intimidate cows Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/ A Tree represents a phrase: • tag -- What kind of phrase (e.g., S , NP , VP ) • branches -- Sequence of Tree or Leaf components A Leaf represents a single word: • tag -- What kind of word (e.g., N , V ) • word -- The word 9
Representing Syntactic Structure S entence N oun V erb P hrase P hrase N oun P hrase N oun V erb N oun cows intimidate cows Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/ A Tree represents a phrase: • tag -- What kind of phrase (e.g., S , NP , VP ) • branches -- Sequence of Tree or Leaf components A Leaf represents a single word: • tag -- What kind of word (e.g., N , V ) • word -- The word 9
Representing Syntactic Structure S entence N oun V erb P hrase P hrase N oun P hrase N oun V erb N oun cows intimidate cows Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/ A Tree represents a phrase: • tag -- What kind of phrase (e.g., S , NP , VP ) • branches -- Sequence of Tree or Leaf components A Leaf represents a single word: • tag -- What kind of word (e.g., N , V ) • word -- The word 9
Representing Syntactic Structure S entence N oun V erb P hrase P hrase N oun P hrase N oun V erb N oun cows intimidate cows Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/ A Tree represents a phrase: • tag -- What kind of phrase (e.g., S , NP , VP ) • branches -- Sequence of Tree or Leaf components A Leaf represents a single word: • tag -- What kind of word (e.g., N , V ) • word -- The word 9
Representing Syntactic Structure S entence N oun V erb P hrase P hrase N oun P hrase N oun V erb N oun cows intimidate cows Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/ A Tree represents a phrase: • tag -- What kind of phrase (e.g., S , NP , VP ) • branches -- Sequence of Tree or Leaf components A Leaf represents a single word: • tag -- What kind of word (e.g., N , V ) • word -- The word 9
Representing Syntactic Structure S entence N oun V erb P hrase P hrase N oun P hrase N oun V erb N oun cows intimidate cows Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/ A Tree represents a phrase: • tag -- What kind of phrase (e.g., S , NP , VP ) • branches -- Sequence of Tree or Leaf components A Leaf represents a single word: • tag -- What kind of word (e.g., N , V ) • word -- The word 9
Representing Syntactic Structure S entence N oun V erb P hrase P hrase N oun P hrase N oun V erb N oun cows intimidate cows Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/ A Tree represents a phrase: cows = Leaf ('N', 'cows') • tag -- What kind of phrase (e.g., S , NP , VP ) • branches -- Sequence of Tree or Leaf components A Leaf represents a single word: • tag -- What kind of word (e.g., N , V ) • word -- The word 9
Representing Syntactic Structure S entence N oun V erb P hrase P hrase N oun P hrase N oun V erb N oun cows intimidate cows Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/ A Tree represents a phrase: cows = Leaf ('N', 'cows') • tag -- What kind of phrase (e.g., S , NP , VP ) intimidate = Leaf ('V', 'intimidate') • branches -- Sequence of Tree or Leaf components A Leaf represents a single word: • tag -- What kind of word (e.g., N , V ) • word -- The word 9
Representing Syntactic Structure S entence N oun V erb P hrase P hrase N oun P hrase N oun V erb N oun cows intimidate cows Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/ A Tree represents a phrase: cows = Leaf ('N', 'cows') • tag -- What kind of phrase (e.g., S , NP , VP ) intimidate = Leaf ('V', 'intimidate') • branches -- Sequence of Tree or Leaf components S , NP , VP = 'S', 'NP', 'VP' A Leaf represents a single word: • tag -- What kind of word (e.g., N , V ) • word -- The word 9
Representing Syntactic Structure S entence N oun V erb P hrase P hrase N oun P hrase N oun V erb N oun cows intimidate cows Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/ A Tree represents a phrase: cows = Leaf ('N', 'cows') • tag -- What kind of phrase (e.g., S , NP , VP ) intimidate = Leaf ('V', 'intimidate') • branches -- Sequence of Tree or Leaf components S , NP , VP = 'S', 'NP', 'VP' Tree ( S , [ Tree ( NP , [ cows ]), A Leaf represents a single word: • tag -- What kind of word (e.g., N , V ) • word -- The word 9
Representing Syntactic Structure S entence N oun V erb P hrase P hrase N oun P hrase N oun V erb N oun cows intimidate cows Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/ A Tree represents a phrase: cows = Leaf ('N', 'cows') • tag -- What kind of phrase (e.g., S , NP , VP ) intimidate = Leaf ('V', 'intimidate') • branches -- Sequence of Tree or Leaf components S , NP , VP = 'S', 'NP', 'VP' Tree ( S , [ Tree ( NP , [ cows ]), A Leaf represents a single word: Tree ( VP , [ intimidate , • tag -- What kind of word (e.g., N , V ) • word -- The word 9
Representing Syntactic Structure S entence N oun V erb P hrase P hrase N oun P hrase N oun V erb N oun cows intimidate cows Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/ A Tree represents a phrase: cows = Leaf ('N', 'cows') • tag -- What kind of phrase (e.g., S , NP , VP ) intimidate = Leaf ('V', 'intimidate') • branches -- Sequence of Tree or Leaf components S , NP , VP = 'S', 'NP', 'VP' Tree ( S , [ Tree ( NP , [ cows ]), A Leaf represents a single word: Tree ( VP , [ intimidate , • tag -- What kind of word (e.g., N , V ) Tree ( NP , [ cows ])])]) • word -- The word 9
Representing Syntactic Structure S entence N oun V erb P hrase P hrase N oun P hrase N oun V erb N oun cows intimidate cows Photo by Vince O'Sullivan licensed under http://creativecommons.org/licenses/by-nc-nd/2.0/ A Tree represents a phrase: cows = Leaf ('N', 'cows') • tag -- What kind of phrase (e.g., S , NP , VP ) intimidate = Leaf ('V', 'intimidate') • branches -- Sequence of Tree or Leaf components S , NP , VP = 'S', 'NP', 'VP' Tree ( S , [ Tree ( NP , [ cows ]), A Leaf represents a single word: Tree ( VP , [ intimidate , • tag -- What kind of word (e.g., N , V ) Tree ( NP , [ cows ])])]) • word -- The word 9 (Demo)
Grammars
Context-Free Grammar Rules 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. Grammar 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. Grammar S NP VP 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. Grammar S S NP VP 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. Grammar S S NP VP NP VP 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. Grammar S S NP VP NP VP NP N 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. Grammar S S NP VP NP VP NP N N 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. Grammar S S NP VP NP VP NP N N buffalo N 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. Grammar S S NP VP NP VP NP N N buffalo N buffalo 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. Grammar S S NP VP NP VP NP N N buffalo N buffalo 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. Grammar S S NP VP NP VP NP N N buffalo N VP V NP buffalo 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. Grammar S S NP VP NP VP NP N NP N buffalo N V VP V NP buffalo 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. Grammar S S NP VP NP VP NP N NP N buffalo N V VP V NP buffalo V buffalo 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. Grammar S S NP VP NP VP NP N NP N buffalo N V VP V NP buffalo buffalo V buffalo 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. Grammar S S NP VP NP VP NP N NP N buffalo N V VP V NP buffalo buffalo V buffalo 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. Grammar S S NP VP NP VP NP N NP N buffalo N V N VP V NP buffalo buffalo V buffalo 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. Grammar S S NP VP NP VP NP N NP N buffalo N V N VP V NP buffalo buffalo buffalo V buffalo 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. Grammar S S NP VP NP VP NP N NP N buffalo N V N VP V NP buffalo buffalo buffalo V buffalo 11
Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words S NP VP A S entence ... ... can be expanded as ... ... a N oun P hrase then a V erb P hrase. Grammar S S NP VP NP VP NP N NP N buffalo N V N VP V NP buffalo buffalo buffalo V buffalo 11 (Demo)
Parsing
Exhaustive Parsing Expand all tags recursively, but constrain words to match input 13
Exhaustive Parsing Expand all tags recursively, but constrain words to match input buffalo buffalo buffalo buffalo 13
Exhaustive Parsing Expand all tags recursively, but constrain words to match input S buffalo buffalo buffalo buffalo 13
Exhaustive Parsing Expand all tags recursively, but constrain words to match input S buffalo buffalo buffalo buffalo 13
Exhaustive Parsing Expand all tags recursively, but constrain words to match input S buffalo buffalo buffalo buffalo 13
Exhaustive Parsing Expand all tags recursively, but constrain words to match input S buffalo buffalo buffalo buffalo 0 1 2 3 4 13
Exhaustive Parsing Expand all tags recursively, but constrain words to match input S NP buffalo buffalo buffalo buffalo 0 1 2 3 4 13
Exhaustive Parsing Expand all tags recursively, but constrain words to match input S NP VP buffalo buffalo buffalo buffalo 0 1 2 3 4 13
Exhaustive Parsing Expand all tags recursively, but constrain words to match input S NP VP buffalo buffalo buffalo buffalo 0 1 2 3 4 13
Exhaustive Parsing Expand all tags recursively, but constrain words to match input S VP NP buffalo buffalo buffalo buffalo 0 1 2 3 4 14
Exhaustive Parsing Expand all tags recursively, but constrain words to match input S VP NP N buffalo buffalo buffalo buffalo 0 1 2 3 4 14
Exhaustive Parsing Expand all tags recursively, but constrain words to match input S VP NP Constraint: A Leaf must match the input word N buffalo buffalo buffalo buffalo 0 1 2 3 4 14
Exhaustive Parsing Expand all tags recursively, but constrain words to match input S VP NP Constraint: A Leaf must match the input word N buffalo buffalo buffalo buffalo 0 1 2 3 4 14
Exhaustive Parsing Expand all tags recursively, but constrain words to match input S VP NP NP Constraint: A Leaf must match the input word N V J N buffalo buffalo buffalo buffalo 0 1 2 3 4 14
Exhaustive Parsing Expand all tags recursively, but constrain words to match input S VP NP buffalo buffalo buffalo buffalo 0 1 2 3 4 15
Exhaustive Parsing Expand all tags recursively, but constrain words to match input S VP NP buffalo buffalo buffalo buffalo 0 1 2 3 4 16
Exhaustive Parsing Expand all tags recursively, but constrain words to match input S VP NP J N buffalo buffalo buffalo buffalo 0 1 2 3 4 16
Exhaustive Parsing Expand all tags recursively, but constrain words to match input S VP NP NP J N V N buffalo buffalo buffalo buffalo 0 1 2 3 4 16
Exhaustive Parsing Expand all tags recursively, but constrain words to match input S VP NP NP J N V N buffalo buffalo buffalo buffalo 0 1 2 3 4 (Demo) 16
Learning (Demo)
Scoring a Tree Using Relative Frequencies Not all syntactic structures are equally common 18
Scoring a Tree Using Relative Frequencies Not all syntactic structures are equally common teacher strikes idle kids 18
Recommend
More recommend