61a lecture 37
play

61A Lecture 37 Wednesday, April 29 Announcements 2 Announcements - PowerPoint PPT Presentation

61A Lecture 37 Wednesday, April 29 Announcements 2 Announcements Homework 9 (4 pts) due Wednesday 4/29 @ 11:59pm 2 Announcements Homework 9 (4 pts) due Wednesday 4/29 @ 11:59pm Quiz 4 due Thursday 4/30 @ 11:59pm 2 Announcements


  1. 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

  2. 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

  3. 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

  4. 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

  5. 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

  6. 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

  7. 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

  8. 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

  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

  10. 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

  11. 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

  12. 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

  13. 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)

  14. Grammars

  15. Context-Free Grammar Rules 11

  16. Context-Free Grammar Rules A grammar rule describes how a tag can be expanded as a sequence of tags or words 11

  17. 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

  18. 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

  19. 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

  20. 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

  21. 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

  22. 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

  23. 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

  24. 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

  25. 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

  26. 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

  27. 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

  28. 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

  29. 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

  30. 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

  31. 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

  32. 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

  33. 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

  34. 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

  35. 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

  36. 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

  37. 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

  38. 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)

  39. Parsing

  40. Exhaustive Parsing Expand all tags recursively, but constrain words to match input 13

  41. Exhaustive Parsing Expand all tags recursively, but constrain words to match input buffalo buffalo buffalo buffalo 13

  42. Exhaustive Parsing Expand all tags recursively, but constrain words to match input S buffalo buffalo buffalo buffalo 13

  43. Exhaustive Parsing Expand all tags recursively, but constrain words to match input S buffalo buffalo buffalo buffalo 13

  44. Exhaustive Parsing Expand all tags recursively, but constrain words to match input S buffalo buffalo buffalo buffalo 13

  45. Exhaustive Parsing Expand all tags recursively, but constrain words to match input S buffalo buffalo buffalo buffalo 0 1 2 3 4 13

  46. Exhaustive Parsing Expand all tags recursively, but constrain words to match input S NP buffalo buffalo buffalo buffalo 0 1 2 3 4 13

  47. 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

  48. 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

  49. 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

  50. 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

  51. 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

  52. 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

  53. 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

  54. 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

  55. 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

  56. 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

  57. 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

  58. 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

  59. Learning (Demo)

  60. Scoring a Tree Using Relative Frequencies Not all syntactic structures are equally common 18

  61. Scoring a Tree Using Relative Frequencies Not all syntactic structures are equally common teacher strikes idle kids 18

Recommend


More recommend