Querying unNorMaLiZED and Inc mpl te Knowledge Bases Percy Liang - - PowerPoint PPT Presentation

querying unnormalized and inc mpl te knowledge bases
SMART_READER_LITE
LIVE PREVIEW

Querying unNorMaLiZED and Inc mpl te Knowledge Bases Percy Liang - - PowerPoint PPT Presentation

Querying unNorMaLiZED and Inc mpl te Knowledge Bases Percy Liang Stanford University Automated Knowledge Base Construction (AKBC) 2016 June 17, 2016 Computing the answer What is the second most populous city in California? 1 Computing the


slide-1
SLIDE 1

Querying unNorMaLiZED and Inc mpl te Knowledge Bases

Percy Liang Stanford University Automated Knowledge Base Construction (AKBC) 2016 June 17, 2016

slide-2
SLIDE 2

Computing the answer

What is the second most populous city in California?

1

slide-3
SLIDE 3

Computing the answer

What is the second most populous city in California?

semantic parsing

argmax(Type.City ⊓ ContainedBy.CA, Population, 2)

1

slide-4
SLIDE 4

Computing the answer

What is the second most populous city in California?

semantic parsing

argmax(Type.City ⊓ ContainedBy.CA, Population, 2)

execute

San Diego

1

slide-5
SLIDE 5

Computing the answer

Which states’ capitals are also their largest cities by area?

2

slide-6
SLIDE 6

Computing the answer

Which states’ capitals are also their largest cities by area?

semantic parsing

µx.Type.USState ⊓ Capital.argmax(Type.City ⊓ ContainedBy.x, Area)

2

slide-7
SLIDE 7

Computing the answer

Which states’ capitals are also their largest cities by area?

semantic parsing

µx.Type.USState ⊓ Capital.argmax(Type.City ⊓ ContainedBy.x, Area)

execute

Arizona,Hawaii,Idaho,Indiana,Iowa,Oklahoma,Utah

2

slide-8
SLIDE 8

Computing the answer

Which states’ capitals are also their largest cities by area?

semantic parsing

µx.Type.USState ⊓ Capital.argmax(Type.City ⊓ ContainedBy.x, Area)

execute

Arizona,Hawaii,Idaho,Indiana,Iowa,Oklahoma,Utah

Strongly leverages KB structure!

2

slide-9
SLIDE 9

Freebase

100M entities (nodes) 1B assertions (edges)

BarackObama Person

Type

Politician

Profession

1961.08.04

DateOfBirth

Honolulu

PlaceOfBirth

Hawaii

ContainedBy

City

Type

UnitedStates

ContainedBy

USState

Type

Event8

Marriage

MichelleObama

Spouse Type

Female

Gender

1992.10.03

StartDate

Event3

PlacesLived

Chicago

Location

Event21

PlacesLived Location ContainedBy

[Bollacker, 2008; Google, 2013] 3

slide-10
SLIDE 10

Freebase

100M entities (nodes) 1B assertions (edges)

BarackObama Person

Type

Politician

Profession

1961.08.04

DateOfBirth

Honolulu

PlaceOfBirth

Hawaii

ContainedBy

City

Type

UnitedStates

ContainedBy

USState

Type

Event8

Marriage

MichelleObama

Spouse Type

Female

Gender

1992.10.03

StartDate

Event3

PlacesLived

Chicago

Location

Event21

PlacesLived Location ContainedBy

[Bollacker, 2008; Google, 2013] 3

slide-11
SLIDE 11

hiking trails near Palo Alto dishes at Oren’s Hummus ACL 2014 papers

BarackObama Person

Type

Politician

Profession

1961.08.04

DateOfBirth

Honolulu

PlaceOfBirth

Hawaii

ContainedBy

City

Type

UnitedStates

ContainedBy

USState

Type

Event8

Marriage

MichelleObama

Spouse Type

Female

Gender

1992.10.03

StartDate

Event3

PlacesLived

Chicago

Location

Event21

PlacesLived Location ContainedBy

4

slide-12
SLIDE 12

hiking trails near Palo Alto dishes at Oren’s Hummus ACL 2014 papers

BarackObama Person Type Politician Profession 1961.08.04 DateOfBirth Honolulu PlaceOfBirth Hawaii ContainedBy City Type UnitedStates ContainedBy USState Type Event8 Marriage MichelleObama Spouse Type Female Gender 1992.10.03 StartDate Event3 PlacesLived Chicago Location Event21 PlacesLived Location ContainedBy

Fewer than 10% of WebQuestions answerable via Freebase

4

slide-13
SLIDE 13

Obtaining better KBs

5

slide-14
SLIDE 14

Obtaining better KBs

KBC

5

slide-15
SLIDE 15

Obtaining better KBs

KBC QA

5

slide-16
SLIDE 16

Obtaining better KBs

KBC QA

5

slide-17
SLIDE 17

Philosophy

Focus on the end-to-end task of question answering. Let that end goal drive learning and construction of intermediate knowl- edge representations.

6

slide-18
SLIDE 18

Philosophy

Focus on the end-to-end task of question answering. Let that end goal drive learning and construction of intermediate knowl- edge representations. KBC/QA

6

slide-19
SLIDE 19

Outline

On web pages On tables In vector space

7

slide-20
SLIDE 20

Simple semantic parsing on web pages

Panupong (Ice) Pasupat ACL 2014

8

slide-21
SLIDE 21

Semantic parsing on the web

Input:

  • query x

hiking trails near Baltimore

  • web page w

9

slide-22
SLIDE 22

Semantic parsing on the web

Input:

  • query x

hiking trails near Baltimore

  • web page w

9

slide-23
SLIDE 23

Semantic parsing on the web

Input:

  • query x

hiking trails near Baltimore

  • web page w

9

slide-24
SLIDE 24

Semantic parsing on the web

Input:

  • query x

hiking trails near Baltimore

  • web page w

Output:

  • list of entities y

[Avalon Super Loop, Patapsco Valley State Park, ...]

9

slide-25
SLIDE 25

Logical forms: XPath expressions

html head body table tr td td td td h1 table tr th th tr td td ... tr td td

z = /html[1]/body[1]/table[2]/tr/td[1]

[Sahuguet and Azavant, 1999; Liu et al., 2000; Crescenzi et al., 2001] 10

slide-26
SLIDE 26

Logical forms: XPath expressions

html head body table tr td td td td h1 table tr th th tr td td ... tr td td

z = /html[1]/body[1]/table[2]/tr/td[1] A low-level KB

[Sahuguet and Azavant, 1999; Liu et al., 2000; Crescenzi et al., 2001] 10

slide-27
SLIDE 27

Framework

x w hiking trails near Baltimore

html head ... body ...

11

slide-28
SLIDE 28

Framework

x w Generation Z hiking trails near Baltimore

html head ... body ...

(|Z| ≈ 8500)

11

slide-29
SLIDE 29

Framework

x w Generation Z Model z hiking trails near Baltimore

html head ... body ...

(|Z| ≈ 8500) /html[1]/body[1]/table[2]/tr/td[1]

11

slide-30
SLIDE 30

Framework

x w Generation Z Model z Execution y hiking trails near Baltimore

html head ... body ...

(|Z| ≈ 8500) /html[1]/body[1]/table[2]/tr/td[1] [Avalon Super Loop, Patapsco Valley State Park, ...]

11

slide-31
SLIDE 31

Dataset

airlines of italy natural causes of global warming lsu football coaches bf3 submachine guns badminton tournaments foods high in dha technical colleges in south carolina songs on glee season 5 singers who use auto tune san francisco radio stations

12

slide-32
SLIDE 32

Dataset

airlines of italy natural causes of global warming lsu football coaches

12

slide-33
SLIDE 33

Dataset statistics

2773 examples 2269 unique queries 894 unique headwords ← long tail! 1483 unique web domains ← long tail! (= wrapper induction)

13

slide-34
SLIDE 34

Results

Baseline (Most frequent extraction predicates) Accuracy Accuracy @ 5 10 20 30 40 50 60 70

10.3 40.5 55.8

14

slide-35
SLIDE 35

Correct prediction

Query: disney channel movies

/html[1]/body/div[2]/div/div/div[3]/div[1]/div/div/div/div/b

15

slide-36
SLIDE 36

Ranking error

Query: doctors at emory

/html/body/div[3]/div[4]/table/tbody/tr/td[2]

Need better understanding of entities/categories

16

slide-37
SLIDE 37

Coverage error

Query: hedge funds in new york

/html/body/div[3]/div[3]/div[4]/.../table/tbody/tr/td[2]/a

Need compositionality

17

slide-38
SLIDE 38

Outline

On web pages On tables In vector space

18

slide-39
SLIDE 39

Semantic parsing on tables

Panupong (Ice) Pasupat ACL 2015, ACL 2016

19

slide-40
SLIDE 40

In what city did Piotr’s last 1st place finish occur?

20

slide-41
SLIDE 41

How long did it take this competitor to finish the 4x400 meter relay at Universiade in 2005?

20

slide-42
SLIDE 42

Where was the competition held immediately before the one in Turkey?

20

slide-43
SLIDE 43

How many times has this competitor placed 5th or better in competition?

20

slide-44
SLIDE 44

Dataset

Statistics:

  • 22000 question/answers
  • 2100 tables
  • 6.3 columns and 27.5 rows per table

21

slide-45
SLIDE 45

Dataset

Statistics:

  • 22000 question/answers
  • 2100 tables
  • 6.3 columns and 27.5 rows per table

Challenges:

  • High logical complexity (conjunction, disjunction, superlatives,

comparatives, aggregation, arithmetic)

  • Tables are unnormalized
  • Train and test tables are distinct; need to generalize!

21

slide-46
SLIDE 46

Knowledge representation

Add normalization / auxiliary edges (custom functions), push resolution to semantic parsing

22

slide-47
SLIDE 47

Model

Greece held its last Summer Olympics in which year? 2004

23

slide-48
SLIDE 48

Model

Greece held its last Summer Olympics in which year? R[Date].R[Year].argmax(Country.Greece, Index) 2004

23

slide-49
SLIDE 49

Results

IR: Train classifer to pick answer directly from table. WQ: Use logical complexity of our previous Freebase work.

IR WQ Full 10 20 30 40 50

answer accuracy

12.7 24.3 37.1

24

slide-50
SLIDE 50

Oracle accuracy

Can the system even generate a set of candidates containing the answer? How many times did Greece hold the summer olympics? 2

25

slide-51
SLIDE 51

Oracle accuracy

Can the system even generate a set of candidates containing the answer? How many times did Greece hold the summer olympics? 2 Method LF accuracy ACL 2015 53.5% ACL 2016 (dynamic prog. on denotations) 76.0%

25

slide-52
SLIDE 52

Error analysis

Unhandled operations (19%):

  • Was there more gold medals won than silver?
  • Which movies were number 1 for at least two consecutive weeks?
  • How many titles had the same author listed as the illustrator?

26

slide-53
SLIDE 53

Error analysis

Unhandled operations (19%):

  • Was there more gold medals won than silver?
  • Which movies were number 1 for at least two consecutive weeks?
  • How many titles had the same author listed as the illustrator?

Table normalization:

  • In what city did Piotr’s last 1st place finish occur? ...[Bangkok,

Thailand]...

  • How long does the show defcon 3 last? ...[2pm-3pm]...

26

slide-54
SLIDE 54

Error analysis

Unhandled operations (19%):

  • Was there more gold medals won than silver?
  • Which movies were number 1 for at least two consecutive weeks?
  • How many titles had the same author listed as the illustrator?

Table normalization:

  • In what city did Piotr’s last 1st place finish occur? ...[Bangkok,

Thailand]...

  • How long does the show defcon 3 last? ...[2pm-3pm]...

Lexical mismatch:

  • Mexican ⇒ Mexico, airplane ⇒ Model

26

slide-55
SLIDE 55

Outline

On web pages On tables In vector space

27

slide-56
SLIDE 56

Compositional Queries in Vector Space

Kelvin Guu John Miller

EMNLP 2015 28

slide-57
SLIDE 57

Focus on path queries

TadLincoln/Parents/Location

29

slide-58
SLIDE 58

Focus on path queries

TadLincoln/Parents/Location Strength: compositionality

29

slide-59
SLIDE 59

Focus on path queries

TadLincoln/Parents/Location Strength: compositionality Weaknesses: can’t handle fact incompleteness, hypotheticals abraham lincoln/daughter/ethnicity

29

slide-60
SLIDE 60

Vector space relation modeling

Score(entity1, relation, entity2)

30

slide-61
SLIDE 61

Vector space relation modeling

Score(entity1, relation, entity2) Prior work:

  • Tensor factorization [Nickel et al., 2011]
  • Neural Tensor Network [Socher et al., 2013]
  • TransE [Bordes et al., 2013]
  • Universal schema [Riedel et al., 2013]
  • General framework + comparison [Yang et al., 2015]
  • Compositional embedding of paths [Neelakantan et al., 2015]

30

slide-62
SLIDE 62

Vector space relation modeling

Score(entity1, relation, entity2) Prior work:

  • Tensor factorization [Nickel et al., 2011]
  • Neural Tensor Network [Socher et al., 2013]
  • TransE [Bordes et al., 2013]
  • Universal schema [Riedel et al., 2013]
  • General framework + comparison [Yang et al., 2015]
  • Compositional embedding of paths [Neelakantan et al., 2015]

Strength: handles incompleteness Weakness: no compositionality

30

slide-63
SLIDE 63

Goal

Compositionality + Handle Incompleteness

31

slide-64
SLIDE 64

Path queries in vector space

32

slide-65
SLIDE 65

Path queries in vector space

32

slide-66
SLIDE 66

Path queries in vector space: example

x⊤

tad lincoln

Wlocation Wparents xspringfield

33

slide-67
SLIDE 67

Experimental setup: models

Bilinear [Nickel et al., 2012]: Tr(v) = v⊤Wr

34

slide-68
SLIDE 68

Experimental setup: models

Bilinear [Nickel et al., 2012]: Tr(v) = v⊤Wr Bilinear-Diag [Yang et al., 2015]: Tr(v) = v⊤diag(wr) TransE [Bordes et al., 2013]: Tr(v) = v + wr

34

slide-69
SLIDE 69

Experimental setup: datasets

(paths length 1-5 generated randomly)

35

slide-70
SLIDE 70

Experimental setup: training

SINGLE: standard training

abraham lincoln/location ⇒ springfield stephen curry/birthdate ⇒ 1988 ... ...

36

slide-71
SLIDE 71

Experimental setup: training

SINGLE: standard training

abraham lincoln/location ⇒ springfield stephen curry/birthdate ⇒ 1988 ... ...

COMP: compositional training

abraham lincoln/location ⇒ springfield stephen curry/birthdate ⇒ 1988 ... ...

36

slide-72
SLIDE 72

Experimental setup: training

SINGLE: standard training

abraham lincoln/location ⇒ springfield stephen curry/birthdate ⇒ 1988 ... ...

COMP: compositional training

abraham lincoln/location ⇒ springfield stephen curry/birthdate ⇒ 1988 ... ... tad lincoln/parents/location ⇒ springfield stephen curry/wife/birthdate ⇒ 1989 ... ...

36

slide-73
SLIDE 73

Experiments: knowledge base completion

abraham lincoln/location ⇒ springfield

37

slide-74
SLIDE 74

Experiments: knowledge base completion

abraham lincoln/location ⇒ springfield

Compositional training improves KBC! Surprising it works: train on paths, test on single edges...

37

slide-75
SLIDE 75

Experiments: knowledge base completion

abraham lincoln/location ⇒ springfield

Compositional training improves KBC! Surprising it works: train on paths, test on single edges... Think of it as a form of path regularization

37

slide-76
SLIDE 76

Final remarks

38

slide-77
SLIDE 77

KBC + QA

  • Knowledge bases provide structure for difficult aggregation ques-

tions (computing the answer)

39

slide-78
SLIDE 78

KBC + QA

  • Knowledge bases provide structure for difficult aggregation ques-

tions (computing the answer)

  • Focus on end task of question answering; knowledge bases are just

caching

39

slide-79
SLIDE 79

KBC + QA

  • Knowledge bases provide structure for difficult aggregation ques-

tions (computing the answer)

  • Focus on end task of question answering; knowledge bases are just

caching Question-dependent KB

39

slide-80
SLIDE 80

Question-dependent KB

  • Multiple levels of compositionality (think n-gram backoff)

dog-friendly hiking trails near Palo Alto

40

slide-81
SLIDE 81

Question-dependent KB

  • Multiple levels of compositionality (think n-gram backoff)

[dog-friendly] [hiking trails near Palo Alto]

40

slide-82
SLIDE 82

Question-dependent KB

  • Multiple levels of compositionality (think n-gram backoff)

[dog-friendly] [hiking trails] [near Palo Alto]

40

slide-83
SLIDE 83

Question-dependent KB

  • Multiple levels of compositionality (think n-gram backoff)

[dog-friendly] [hiking trails] [near Palo Alto]

/body/div[2]/(CLICK)/body/div/(SEARCH)/body/div[3]

Query a low-level KB

40

slide-84
SLIDE 84

What about unstructured text?

41

slide-85
SLIDE 85

Reading comprehension dataset

42

slide-86
SLIDE 86

Reading comprehension dataset

  • 107,785 question/answer pairs
  • 536 articles
  • Answer is span of paragraph

42

slide-87
SLIDE 87

Reading comprehension dataset

  • 107,785 question/answer pairs
  • 536 articles
  • Answer is span of paragraph

Method F1 Sliding window 20.0%

  • Log. reg

51.0% Human 86.8%

42

slide-88
SLIDE 88

Reading comprehension dataset

  • 107,785 question/answer pairs
  • 536 articles
  • Answer is span of paragraph

Method F1 Sliding window 20.0%

  • Log. reg

51.0% Human 86.8% stanford-qa.com

42

slide-89
SLIDE 89

Code and data worksheets.codalab.org Collaborators

Panupong Pasupat Kelvin Guu John Miller

Funding

Google Microsoft DARPA

Thank you!

43