sempre semantic parsing with execution
play

SEMPRE: Semantic Parsing with Execution Percy Liang Stanford - PowerPoint PPT Presentation

SEMPRE: Semantic Parsing with Execution Percy Liang Stanford University CS224U May 18, 2015 Goals Show how you can use SEMPRE for question answering on Free- base. Highlight the many applications of SEMPRE. 1 Outline Review of


  1. SEMPRE: Semantic Parsing with Execution Percy Liang Stanford University CS224U May 18, 2015

  2. Goals • Show how you can use SEMPRE for question answering on Free- base. • Highlight the many applications of SEMPRE. 1

  3. Outline Review of semantic parsing MichelleObama Using SEMPRE for Freebase QA Gender Female USState PlacesLived 1992.10.03 Spouse Type StartDate Event21 Event8 Hawaii ContainedBy Location Type UnitedStates Marriage ContainedBy ContainedBy Chicago BarackObama PlaceOfBirth Honolulu Location PlacesLived Event3 Type DateOfBirth Profession Type Person 1961.08.04 Politician City Other applications 2

  4. Question answering via semantic parsing Which states’ capitals are also their largest cities? 3

  5. Question answering via semantic parsing Which states’ capitals are also their largest cities? semantic parsing µx. Type.USState ⊓ Capital . argmax ( Type.City ⊓ ContainedBy .x, Area ) 3

  6. Question answering via semantic parsing Which states’ capitals are also their largest cities? semantic parsing µx. Type.USState ⊓ Capital . argmax ( Type.City ⊓ ContainedBy .x, Area ) execute Arizona,Hawaii,Idaho,Indiana,Iowa,Oklahoma,Utah 3

  7. Question answering via semantic parsing Which states’ capitals are also their largest cities? semantic parsing execute Arizona,Hawaii,Idaho,Indiana,Iowa,Oklahoma,Utah 3

  8. General framework [utterance: user input] semantic parsing [program] execute [behavior: user output] 4

  9. Semantics? Percy teaches at Stanford. teachesAt ( Percy , Stanford ) 5

  10. Semantics? Semantic parsing is fundamentally a translation task... 6

  11. Semantics? Semantic parsing is fundamentally a translation task... How many people live in Seattle? count ( Type.Person ⊓ LiveIn . Seattle ) 6

  12. Semantics? Semantic parsing is fundamentally a translation task... How many people live in Seattle? R [ Population ] . Seattle 6

  13. Semantics? Semantic parsing is fundamentally a translation task... How many people live in Seattle? R [ Number ] . ( R [ Population ] . Seattle ⊓ Year.2015 ) 6

  14. Semantics? Semantic parsing is fundamentally a translation task... How many people live in Seattle? R [ Number ] . arg max( R [ Population ] . Seattle ⊓ Year . ≤ . 2015 , Year ) ...into a low-level language. 6

  15. Probabilistic framework x people who have lived in Chicago parameters θ z Type.Person ⊓ PlacesLived.Location.Chicago context { BarackObama,MichelleObama,... } w y 7

  16. [Bollacker, 2008; Google, 2013] Freebase 100M entities (nodes) 1B assertions (edges) MichelleObama Gender Female USState PlacesLived 1992.10.03 Spouse Type StartDate Event21 Event8 Hawaii ContainedBy Location Type UnitedStates Marriage ContainedBy ContainedBy Chicago BarackObama Honolulu PlaceOfBirth Location PlacesLived Event3 Type DateOfBirth Profession Type Person 1961.08.04 Politician City 8

  17. [Liang, 2013] Logical forms: lambda DCS Type.Person ⊓ PlacesLived.Location.Chicago 9

  18. [Liang, 2013] Logical forms: lambda DCS Type.Person ⊓ PlacesLived.Location.Chicago o Type PlacesLived Person ? Location Chicago 9

  19. [Liang, 2013] Logical forms: lambda DCS Type.Person ⊓ PlacesLived.Location.Chicago MichelleObama o Gender Female USState PlacesLived 1992.10.03 Spouse Type Type StartDate PlacesLived Event21 Event8 Hawaii ContainedBy Person ? Location Type UnitedStates Marriage ContainedBy ContainedBy Chicago BarackObama PlaceOfBirth Honolulu Location Location PlacesLived Event3 Type DateOfBirth Profession Type Chicago Person 1961.08.04 Politician City 9

  20. [Liang, 2013] Logical forms: lambda DCS Type.Person ⊓ PlacesLived.Location.Chicago MichelleObama o Gender Female USState PlacesLived 1992.10.03 Spouse Type Type StartDate PlacesLived Event21 Event8 Hawaii ContainedBy Person ? Location Type UnitedStates Marriage ContainedBy ContainedBy Chicago BarackObama PlaceOfBirth Honolulu Location PlacesLived Location Event3 Type DateOfBirth Profession Type Chicago Person 1961.08.04 Politician City 9

  21. Lambda DCS Entity Chicago 10

  22. Lambda DCS Entity Chicago Join PlaceOfBirth . Chicago 10

  23. Lambda DCS Entity Chicago Join PlaceOfBirth . Chicago Intersect Type.Person ⊓ PlaceOfBirth . Chicago 10

  24. Lambda DCS Entity Chicago Join PlaceOfBirth . Chicago Intersect Type.Person ⊓ PlaceOfBirth . Chicago Aggregation count ( Type.Person ⊓ PlaceOfBirth . Chicago ) 10

  25. Lambda DCS Entity Chicago Join PlaceOfBirth . Chicago Intersect Type.Person ⊓ PlaceOfBirth . Chicago Aggregation count ( Type.Person ⊓ PlaceOfBirth . Chicago ) Superlative argmin ( Type.Person ⊓ PlaceOfBirth . Chicago , DateOfBirth ) 10

  26. Lambda DCS Entity Chicago Join PlaceOfBirth . Chicago Intersect Type.Person ⊓ PlaceOfBirth . Chicago Aggregation count ( Type.Person ⊓ PlaceOfBirth . Chicago ) Superlative argmin ( Type.Person ⊓ PlaceOfBirth . Chicago , DateOfBirth ) Anaphora µx. Type.Person ⊓ Children . Influence .x 10

  27. Lambda DCS Entity Chicago Join PlaceOfBirth . Chicago Intersect Type.Person ⊓ PlaceOfBirth . Chicago Aggregation count ( Type.Person ⊓ PlaceOfBirth . Chicago ) Superlative argmin ( Type.Person ⊓ PlaceOfBirth . Chicago , DateOfBirth ) Anaphora µx. Type.Person ⊓ Children . Influence .x Variable argmax ( Type.Person , R [ λx. count ( Parent.Parent .x )]) 10

  28. Comparison to lambda calculus Lambda calculus λx. Type ( x, Person ) ∧ ∃ e. PlacesLived ( x, e ) ∧ Location ( e, Chicago ) 11

  29. Comparison to lambda calculus Lambda calculus λx. Type ( x, Person ) ∧ ∃ e. PlacesLived ( x, e ) ∧ Location ( e, Chicago ) Lambda dependency-based compositional semantics (DCS) Type.Person ⊓ PlacesLived . Location . Chicago 11

  30. Probabilistic framework x people who have lived in Chicago parameters θ z Type.Person ⊓ PlacesLived.Location.Chicago context { BarackObama,MichelleObama,... } w y 12

  31. (Over)-generating derivations derivation 1 Grammar utterance derivation 2 ... 13

  32. (Over)-generating derivations derivation 1 Grammar utterance derivation 2 ... A Real Dumb Grammar (lexicon) Chicago ⇒ E : Chicago (lexicon) people ⇒ E : Type.Person (lexicon) live ⇒ E × E : PlacesLived ... (join) E × E : b E : u E : b.u ⇒ (intersect) E : u E : v E : u ⊓ v ⇒ 13

  33. Derivations Derivation: construction of logical form given utterance Type.Person ⊓ PlaceLived.Location.Chicago Type.Person who PlaceLived.Location.Chicago people have PlaceLived.Location in Chicago lived Chicago 14

  34. Derivations Derivation: construction of logical form given utterance Type.Person ⊓ PlaceLived.Location.Chicago Type.Person who PlaceLived.Location.Chicago lexicon people have PlaceLived.Location in Chicago lexicon lexicon lived Chicago 14

  35. Derivations Derivation: construction of logical form given utterance Type.Person ⊓ PlaceLived.Location.Chicago Type.Person who PlaceLived.Location.Chicago join lexicon people have PlaceLived.Location in Chicago lexicon lexicon lived Chicago 14

  36. Derivations Derivation: construction of logical form given utterance Type.Person ⊓ PlaceLived.Location.Chicago intersect Type.Person who PlaceLived.Location.Chicago join lexicon people have PlaceLived.Location in Chicago lexicon lexicon lived Chicago 14

  37. Floating parsers Type.Person ⊓ PlaceLived.Location.Chicago intersect Type.Person who PlaceLived.Location.Chicago join lexicon people have PlaceLived.Location in Chicago lexicon lexicon lived Chicago 15

  38. Floating parsers Type.Person ⊓ PlaceLived.Location.Chicago intersect Type.Person PlaceLived.Location.Chicago join PlaceLived.Location Chicago lexicon people who have lived in Chicago Key idea: detach logical form from sentence 15

  39. Floating parsers Type.Person ⊓ PlaceLived.Location.Chicago intersect Type.Person PlaceLived.Location.Chicago join PlaceLived.Location Chicago lexicon people who have lived in Chicago Key idea: detach logical form from sentence Pruning: use world knowledge / pragmatics — avoid empty sets, type errors, redundant operations 15

  40. Many possible derivations! x = people who have lived in Chicago 16

  41. Many possible derivations! x = people who have lived in Chicago ? set of candidate derivations D ( x ) 16

  42. Many possible derivations! x = people who have lived in Chicago ? set of candidate derivations D ( x ) Type.Person ⊓ PlaceLived.Location.Chicago intersect Type.Person who PlaceLived.Location.Chicago join lexicon people have PlaceLived.Location in Chicago lexicon lexicon lived Chicago 16

  43. Many possible derivations! x = people who have lived in Chicago ? set of candidate derivations D ( x ) Type.Org ⊓ PresentIn.ChicagoMusical intersect Type.Org who PresentIn.ChicagoMusical join lexicon PresentIn ChicagoMusical people have in lexicon lexicon lived Chicago 16

  44. Type.Person ⊓ PlaceLived.Location.Chicago intersect Type.Person who PlaceLived.Location.Chicago x : utterance join lexicon d : derivation people have PlaceLived.Location in Chicago lexicon lexicon lived Chicago Feature vector φ ( x, d ) ∈ R F : 17

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend