1 / 72

Week 9: Probabilistische Grammatica's

Remko Scha, ILLC Opleiding Kunstmatige Intelligentie. Taaltheorie en Taalverwerking. Week 9: Probabilistische Grammatica's. Jurafsky & Martin (ed. 1), Hoofdstuk 12: Lexicalized and Probabilistic Parsing). Ambiguïteit. Ambiguïteit. Ambiguïteit. Ambiguïteit.

shada
Télécharger la présentation

Week 9: Probabilistische Grammatica's

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Remko Scha, ILLC Opleiding Kunstmatige Intelligentie Taaltheorie en Taalverwerking Week 9: Probabilistische Grammatica's Jurafsky & Martin (ed. 1), Hoofdstuk 12:Lexicalized and Probabilistic Parsing)

  2. Ambiguïteit

  3. Ambiguïteit

  4. Ambiguïteit

  5. Ambiguïteit Cf.: Can you book me a flight? Can you book Mr. Jones some flights?

  6. Syntactische Ambiguïteit • Wat voor redenen zijn er om Can you [book [TWA flights]]? te verkiezen boven Can you [book TWA flights]? • 1. Pragmatisch: • Men vraagt niet vaak of je voor een specifiek iemand vluchten kunt boeken. Of: men vraagt niet vaak over vluchten zonder verdere specificaties. • 2. Semantisch: • Vluchten boeken voor een vliegmaatschappij is onzinnig in dit domein. • 3. Syntactisch: • Werkwoorden worden meestal zonder meewerkend voorwerp gebruikt; • of: "to book" wordt meestal zonder meewerkend voorwerp gebruikt; • of: "flights" wordt vaak met een modifier gebruikt; • etc.

  7. Syntactische Ambiguïteit • Disambiguërings-methodes: • 1./2. Pragmatisch/Semantisch: • Bepaal betekenis-representaties voor elk van de mogelijke interpretaties. Redeneer over wat iemand kan willen weten en over wat zinnig is in dit domein. [Ouderwetse symbolische A.I.]

  8. Syntactische Ambiguïteit • Disambiguërings-methodes: • 1./2. Pragmatisch/Semantisch: • Bepaal betekenis-representaties voor elk van de mogelijke interpretaties. Redeneer over wat iemand kan willen weten en over wat zinnig is in dit domein. • 2. Syntactisch: • Doe statistiek over syntactische structuren.

  9. Syntactische Ambiguïteit • Disambiguërings-methodes: • 1./2. Pragmatisch/Semantisch: • Bepaal betekenis-representaties voor elk van de mogelijke interpretaties. Redeneer over wat iemand kan willen weten en over wat zinnig is in dit domein. • 2. Syntactisch: • Doe statistiek over syntactische structuren. • Merk op: distributie van syntactische structuren kan correleren met pragmatisch/semantische regelmatigheden

  10. Syntactische Ambiguïteit • Disambiguërings-methodes: • 1./2. Pragmatisch/Semantisch: • Bepaal betekenis-representaties voor elk van de mogelijke interpretaties. Redeneer over wat iemand kan willen weten en over wat zinnig is in dit domein. • 2. Syntactisch: • Doe statistiek over syntactische structuren. • Merk op: distributie van syntactische structuren correleert met pragmatisch/semantische regelmatigheden, vooral als we ook informatie over specifieke lexicale items meenemen.

  11. Kansrekening: Basics. [Russell & Norvig, pp. 466-478.]

  12. Kansrekening: Basics. Het begrip kans veronderstelt een partitie van een ruimte van mogelijkheden. Een kans beschrijft de relatieve grootte van een deel van die ruimte. B.v.: een meting met k mogelijke uitkomsten: P(1) + P(2) + . . . + P(k) = 1.

  13. Kansrekening: Basics. Joint probabilities. Als A en B uitkomsten zijn van 2 verschillende onafhankelijke metingen, dan is de kans op A en B: P(A & B) = P(A)  P(B)

  14. Kansrekening: Basics. Conditionele waarschijnlijkheden. De kans op A gegeven B schrijven we als: P(A|B)

  15. Kansrekening: Basics. Algemeen geldt: P(A & B) = P(A|B)  P(B) P(A & B) = P(B|A)  P(A) Als A en B onafhankelijk zijn, dan is P(A|B) = P(A) P(B|A) = P(B)dus P(A & B) = P(A)  P(B)

  16. Statistische syntactische desambiguëring.

  17. Statistische syntactische desambiguëring. Eenvoudigste idee: Probabilistische Contextvrije Grammatica (PCFG)

  18. Probabilistische Contextvrije Grammatica (PCFG) Voeg aan elke herschrijfregel (A ) een conditionele kans toe: P(A  | A)

  19. Probabilistische Contextvrije Grammatica (PCFG) Voeg aan elke herschrijfregel (A ) een conditionele kans toe: P(A  | A) Eis:  P(A ) = 1

  20. CFG: 4-tupel <N, , P, S> • N: eindige verzameling non-terminale symbolen (b.v.: {S, NP, VP, noun, article, ...}) • : eindige verzameling terminale symbolen(b.v.: {the, a, boy, wumpus, ...}) • N   =  • S: startsymbool;S  N • P: eindige verzameling herschrijfregels { A, .....} • A  N,   (N  )* • Cf. Jurafsky & Martin: Hoofdstuk 9 (Context-Free Grammars for English), p. 331

  21. PCFG: 5-tupel <N, , P, S, D> • N: eindige verzameling non-terminale symbolen (b.v.: {S, NP, VP, noun, article, ...}) • : eindige verzameling terminale symbolen(b.v.: {the, a, boy, wumpus, ...}) • N   =  • S: startsymbool;S  N • P: eindige verzameling herschrijfregels { A, .....} • A  N,   (N  )*D: functie die aan elke regel p  P een getal tussen 0 en 1 toekent. A  N P(A ) = 1 • Cf. Jurafsky & Martin: Hoofdstuk 12, pp. 448/449

  22. PCFG Kans op een parse-tree = Product van de kansen van alle toegepaste regels

  23. Example PCFG

  24. P = .15 * .40 * .05 * .05 * .35 * .75 * .40 * .40 *.40 *.30 * .40 *.50 = 1.5 * 10-6 P = .15 * .40 * .40 * .05 * .05 * .75 * .40 * .40 *.40 *.30 * .40 *.50 = 1.7 * 10-6 Statistische Desambiguëring: Kies de boom met de hoogste waarschijnlijkheid

  25. Kans op een zin = Som van de kansen van de verschillende bomen van die zin. (Toepassing: Spraakherkenning.)

  26. Hoe bepaal je de kansen van de CFG-regels? • Schatting op basis van de relatieve frequenties in een "treebank" (syntactisch geannoteerd corpus). • "Expectation Maximization": Gegeven een "plat" corpus (collectie zinnen): stel de waarschijnlijkheden zodanig in, dat de kans om dat corpus te genereren zo groot mogelijk is.

  27. Beperking van PCFG's: De toepassingen van de herschrijfregels worden behandeld als statistisch onafhankelijk.

  28. Een PCFG kent aan deze beide analyses altijd dezelfde waarschijnlijkheid toe!

  29. Oplossing: • PCFG's met verrijkte labels die niet-locale informatie coderen • Stochastic Tree Substitution Grammars

  30. Lexicalized PCFG's: Head-features (Collins et al.)

  31. VP(dumped) VBD(dumped) NP(sacks) PP(into) waarschijnlijk NP(sacks) NP(sacks) PP(into) onwaarschijnlijk VP(dumped) VBD(dumped) NP(sacks) PP(with) niet heel waarschijnlijk NP(sacks) NP(sacks) PP(with) heelwaarschijnlijk Lexicalized PCFG's: Head-features

  32. Data-Oriented Parsing (DOP)(Scha, Bod, Sima'an) Gebruik een geannoteerd corpus ("treebank"). Lees een Stochastic Tree Substitution Grammar rechtstreeks af uit het corpus. (PPT-presentatie van Guy De Pauw, Universiteit Antwerpen)

  33. Data-Oriented Parsing (DOP) Gebruik een geannoteerd corpus. Gebruik een Stochastic Tree Substitution Grammar Lees deze STSG rechtstreeks af uit het corpus (PPT van Guy De Pauw, Universiteit Antwerpen)

  34. Treebank

  35. Sentence to be parsed: Peter killed the bear Data-Oriented Parsing 1 parse-tree; meerdere afleidingen

  36. An annotated corpus defines a Stochastic Tree Substitution Grammar Probability of a Derivation: Product of the Probabilities of the Subtrees

  37. An annotated corpus defines a Stochastic Tree Substitution Grammar Probability of a Derivation: Product of the Probabilities of the Subtrees Probability of a Parse: Sum of the Probabilities of its Derivations

  38. An annotated corpus defines a Stochastic Tree Substitution Grammar Probability of a Derivation: Product of the Probabilities of the Subtrees Probability of a Parse: Sum of the Probabilities of its Derivations Disambiguation: Choose the Most Probable Parse

  39. Human parsing continued.

  40. Human parsing continued. • Center-embedding (J&M, § 13.4)

  41. Human parsing continued. • Center-embedding (J&M, § 13.4) • Garden-path sentences (J&M, § 12.5)

  42. Garden-path sentences "The horse raced past the barn

  43. Garden-path sentences "The horse raced past the barn fell."

  44. Garden-path sentences "The complex houses

  45. Garden-path sentences "The complex houses graduate students."

  46. Garden-path sentences "The student forgot the solution

  47. Garden-path sentences "The student forgot the solution was in the back of the book."

More Related