56
Solving geometry problems: combining text and diagram interpretation Minjoon Seo 1 , Hannaneh Hajishirzi 1 , Ali Farhadi 1,2 , Oren Etzioni 2 , Clint Malcolm 1 Sep. 20 EMNLP 2015 1 2 1

Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

  • Upload
    others

  • View
    16

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Solving  geometry  problems:  combining  text  and  diagram  

interpretation

Minjoon   Seo1,  Hannaneh Hajishirzi1,  Ali  Farhadi1,2,  Oren  Etzioni2,  Clint  Malcolm1

Sep.  20EMNLP  2015

1 2

1

Page 2: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Geometry  Word  Problems

In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to chord BD. What is the length of BD?

a) 2 b) 4 c) 6d) 8 e) 10

EB D

A

O

5

2

C

2

Page 3: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Why  geometry  problems?  

• Solving  geometry  word  problems  is  challenging  in  AI• Part  of  broader  scope  of  solving  math  word  problems  (Kushman et  al.,  2014;  Hosseini et  al.,  2014;  Roy  et  al.,  2015;  Dai  et  al.,  2015;  Shi  et  al.,  2015)

• Interesting  interplay  between  natural  language  and  vision

Page 4: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Why  geometry  problems?  

• Solving  geometry  word  problems  is  challenging  in  AI• Part  of  broader  scope  of  solving  math  word  problems  (Kushman et  al.,  2014;  Hosseini et  al.,  2014;  Roy  et  al.,  2015;  Dai  et  al.,  2015;  Shi  et  al.,  2015)

• Interesting  interplay  between  natural  language  and  vision

In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to chord BD. What is the length of BD?

a) 2 b) 4 c) 6d) 8 e) 10

Page 5: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Why  geometry  problems?  

• Solving  geometry  word  problems  is  challenging  in  AI• Part  of  broader  scope  of  solving  math  word  problems  (Kushman et  al.,  2014;  Hosseini et  al.,  2014;  Roy  et  al.,  2015;  Dai  et  al.,  2015;  Shi  et  al.,  2015)

• Interesting  interplay  between  natural  language  and  vision

5

EB D

A

O

5

2

C

Page 6: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Why  geometry  problems?  

• Solving  geometry  word  problems  is  challenging  in  AI• Part  of  broader  scope  of  solving  math  word  problems  (Kushman et  al.,  2014;  Hosseini et  al.,  2014;  Roy  et  al.,  2015;  Dai  et  al.,  2015;  Shi  et  al.,  2015)

• Interesting  interplay  between  natural  language  and  vision• Closely  related  to  language  &  vision  and  grounded  language  acquisition• Requires  semantic  understanding  of  each  modality  

• Has  well-­‐defined  metric• Interesting  to  NLP:  unique  characteristics  of  the  geometry  word  problems.  

Page 7: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Challenge  #1  Interaction  between  Text  and  Diagram

• Previous  work  in  semantic  parsing  and  relation  extraction  does  not  consider  another  modality   (Zettlemoyer and  Collins,  2005;  Kate  and  Mooney,  2007;  Poon  and  Domingos,  2009;  Kwiatkowski   et  al.,  2013;  Flanigan et  al.,  2014;  Reddy  et  al.,  2014;  Berant et  al.,  2014; Cowie and  Lehnert,  1996;  Culotta and  Sorensen,  2004)

7

In  the  diagram  at  the  right,   the  line is  tangent  to  the  circle.

A

B

O

C

Page 8: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Challenge  #2:Lexical  Ambiguity

8

8

A

B

O

CLine  OC  bisects line  AB,  and  line  OC  bisects angle  AOB.

Page 9: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Challenge  #3:Implication

9

Circle  O  has  a  radius  of  5.EB D

A

O

5

2

C

Equals(RadiusOf(O), 5)

Page 10: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Challenge  #4:Syntactic  Complication

10

A

BC

D

AB  and  CD  are  perpendicular.

AB  and  CD  are  perpendicular  to  EF.

A

BC

DE

F

Page 11: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

11

B

D E

A C

In  triangle  ABC,  line  DE  is  parallel  with  line  AC,  DB  equals  4,  AD  is  8,  and  DE  is  5.  Find  AC.(a)  9      (b)  10    (c)  12.5      (d)  15      (e)  17

IsTriangle(ABC)  ∧Parallel(AC,  DE) ∧Equals(LengthOf(DB),  4)  ∧Equals(LengthOf(AD),  8)  ∧Equals(LengthOf(DE),  5)  ∧Find(LengthOf(AC))

PointLiesOnLine(D,  AB)  ∧PointLiesOnLine(E,  BC)

(d)  15

GeoS:  Overview

Page 12: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

GeoS:  Overview

Diagram

Text

facts

factsanswer

(1)

(2)

(3)

(1) Diagram  understanding  (Seo  et  al.,  2014)(2) Text  parsing  (3) Solving

12

Help

Page 13: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Diagram-­‐aided  text  parsingIn  triangle  ABC,  line  DE  is  parallel  with  line  AC,  DB  equals  4,  AD  is  8,  and  DE  is  5.  Find  AC.(a)  9      (b)  10    (c)  12.5      (d)  15      (e)  17

B

D E

A C

IsTriangle(ABC) ∧ Parallel(AC,  DE) ∧Equals(LengthOf(DB),  4)    ∧   Equals(LengthOf(AD),  8)  ∧Equals(LengthOf(DE),  5)  ∧   Find(LengthOf(AC))

13

TextInput

Logicalform

Difficult  to  directly  map  text  to  a  long  logical  form!

Page 14: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Diagram-­‐aided  text  parsingIn  triangle  ABC,  line  DE  is  parallel  with  line  AC,  DB  equals  4,  AD  is  8,  and  DE  is  5.  Find  AC.(a)  9      (b)  10    (c)  12.5      (d)  15      (e)  17

B

D E

A C

IsTriangle(ABC)Parallel(AC,  DE)Parallel(AC,  DB)Equals(LengthOf(DB),  4)Equals(LengthOf(AD),  8)Equals(LengthOf(DE),  5)Equals(4,  LengthOf(AD))…

Over-­‐generated  literals0.960.910.740.970.940.940.31…

Text  scores1.000.990.02n/an/an/an/a…

Diagram  scores

Selected  subset

14

TextInput

Logicalform

Our  method

IsTriangle(ABC) ∧ Parallel(AC,  DE) ∧Equals(LengthOf(DB),  4)    ∧   Equals(LengthOf(AD),  8)  ∧Equals(LengthOf(DE),  5)  ∧   Find(LengthOf(AC))

Page 15: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Step  1.  Literal  over-­‐generationIn  triangle  ABC,  line  DE  is  parallel  with  line  AC,  DB  equals  4,  AD  is  8,  and  DE  is  5.  Find  AC.(a)  9      (b)  10    (c)  12.5      (d)  15      (e)  17

B

D E

A C

IsTriangle(ABC)Parallel(AC,  DE)Parallel(AC,  DB)Equals(LengthOf(DB),  4)Equals(LengthOf(AD),  8)Equals(LengthOf(DE),  5)Equals(4,  LengthOf(AD))…

Over-­‐generated  literals

15

Page 16: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Step  1.  Generating  literals

“Lines  AB  and  CD  are  perpendicular  to  EF”

IsLine(AB)IsLine(CD)IsLine(EF)Perpendicular(AB, CD)Perpendicular(CD, EF)Perpendicular(AB, EF)

16

Page 17: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Step  1.  Generating  literals

“Lines  AB  and  CD  are  perpendicular  to  EF”

IsLine(AB)IsLine(CD)IsLine(EF)Perpendicular(AB, CD)Perpendicular(CD, EF)Perpendicular(AB, EF)

Red  literals  are  false.

17

Page 18: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Concepts

Lines      AB      and      CD      are      perpendicular      to      EF

AB

Perpendicular

CD EF

IsLine

18

Page 19: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Lexicon

• We  built  lexicon  from  training  data  and  textbooks• Lexicon  maps  geometry-­‐related  words  (or  phrases)  to  concepts• Some  concepts  are  obtained  via  simple  regular  expressions• Single  word  can  map  to  two  or  more  concepts

Word  or phrase Concept“Perpendicular” Perpendicular

“Lies  on” PointLiesOnLine,PointLiesOnCircle

“CD” line, arc

“ABC” triangle, angle

19

Page 20: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Relations

Lines      AB      and      CD      are      perpendicular      to      EF

AB

Perpendicular

CD EF

IsLine

20

Page 21: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Relations

Lines      AB      and      CD      are      perpendicular      to      EF

AB

Perpendicular

CD EF

IsLineUnary  relation

IsLine(EF)21

Page 22: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Relations

Lines      AB      and      CD      are      perpendicular      to      EF

AB

Perpendicular

CD EF

IsLineBinary  relation

Perpendicular(AB, CD)22

Page 23: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Step  2.  Text  scores  of  literalsIn  triangle  ABC,  line  DE  is  parallel  with  line  AC,  DB  equals  4,  AD  is  8,  and  DE  is  5.  Find  AC.(a)  9      (b)  10    (c)  12.5      (d)  15      (e)  17

B

D E

A C

IsTriangle(ABC)Parallel(AC,  DE)Parallel(AC,  DB)Equals(LengthOf(DB),  4)Equals(LengthOf(AD),  8)Equals(LengthOf(DE),  5)Equals(4,  LengthOf(AD))…

Over-­‐generated  literals0.960.910.740.970.940.940.31…

Text  scores

23

Page 24: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Relation  score

Lines      AB      and      CD      are      perpendicular      to      EF

AB

Perpendicular

CD EF

IsLine0.78

24

Page 25: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Relation  classification

• Supervision:  annotated  logical  forms• Training  data:  all  possible  relations  from  training  questions• Relations  found  in  annotations:  positive• All  others:  negative

• Logistic  regression  with  L2  regularization• Features:• Stanford  dependency  parse• Part  of  speech  tags• Type  of  concept  (line,  circle,  triangle,  predicate,  etc.)

25

IsLine->ABIsLine->CDIsLine->EFPerpendicular->AB, CDPerpendicular->CD, EFPerpendicular->AB, EF

Page 26: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Text  scores  of  literals

Equals

RadiusOf

O 5

0.94

0.87

𝒜$%&$ 𝑙 =)log𝑃.(𝑦1 = 1|𝑟1, 𝑡)

𝑙

𝜃

𝑦1𝑟1𝑡

LiteralLabel  for  edgeEdge  (relation)Question  text

Logistic  regression  parameters  to  be  learned“Circle  O  has  radius  of  5”

26

Page 27: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Step  3.  Diagram  scores  of  literalsIn  triangle  ABC,  line  DE  is  parallel  with  line  AC,  DB  equals  4,  AD  is  8,  and  DE  is  5.  Find  AC.(a)  9      (b)  10    (c)  12.5      (d)  15      (e)  17

B

D E

A C

IsTriangle(ABC)Parallel(AC,  DE)Parallel(AC,  DB)Equals(LengthOf(DB),  4)Equals(LengthOf(AD),  8)Equals(LengthOf(DE),  5)Equals(4,  LengthOf(AD))…

Over-­‐generated  literals0.960.910.740.970.940.940.31…

Text  scores1.000.990.02n/an/an/an/a…

Diagram  scores

27

Page 28: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Step  3.  Diagram  scores  of  literals

B

D E

A C

TEXT DIAGRAMParallel(AC, DB) 0.74 0.02

28

“AC  and  DB  are  parallel  with  DE  and  AD,  respectively.”

Page 29: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Step  3.  Diagram  scores  of  literals

B

D E

A C

29

TEXT DIAGRAMParallel(AC, DB) 0.74 0.02Parallel(AC, DE) 0.78 0.99

“AC  and  DB  are  parallel  with  DE  and  AD,  respectively.”

Page 30: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Step  3.  Diagram  scores  of  literals

B

D E

A C

Diagram  understanding  in  geometry  questions  (Seo  et  al.,  2014)

30

TEXT DIAGRAMParallel(AC, DB) 0.74 0.02Parallel(AC, DE) 0.78 0.99

“AC  and  DB  are  parallel  with  DE  and  AD,  respectively.”

Page 31: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Step  4.  Subset  selectionIn  triangle  ABC,  line  DE  is  parallel  with  line  AC,  DB  equals  4,  AD  is  8,  and  DE  is  5.  Find  AC.(a)  9      (b)  10    (c)  12.5      (d)  15      (e)  17

B

D E

A C

IsTriangle(ABC)Parallel(AC,  DE)Parallel(AC,  DB)Equals(LengthOf(DB),  4)Equals(LengthOf(AD),  8)Equals(LengthOf(DE),  5)Equals(4,  LengthOf(AD))…

Over-­‐generated  literals0.960.910.740.970.940.940.31…

Text  scores1.000.990.02n/an/an/an/a…

Diagram  scores

Selected  subset

31

IsTriangle(ABC) ∧ Parallel(AC,  DE) ∧Equals(LengthOf(DB),  4)    ∧   Equals(LengthOf(AD),  8)  ∧Equals(LengthOf(DE),  5)  ∧   Find(LengthOf(AC))

Page 32: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Step  4.  Subset  selection

IsTriangle(ABC)Parallel(AC,  DE)Parallel(AC,  DB)Equals(LengthOf(DB),  4)Equals(LengthOf(AD),  8)Equals(LengthOf(DE),  5)Equals(4,  LengthOf(AD))Equals(LengthOf(AC),  4)Parallel(DE,  DB)Equals(LengthOf(DB,  8)Find(LengthOf(AC))Find(LengthOf(DE))Find(LengthOf(DB))…

IsTriangle(ABC)Parallel(AC,  DE)Equals(LengthOf(DB),  4)Equals(LengthOf(AD),  8)Equals(LengthOf(DE),  5)Find(LengthOf(AC))

𝐿 𝐿∗

𝐿∗ = argmax?@⊂?

ℱ(𝐿C)

ℱ 𝐿C = 𝜆𝒜 𝐿C, 𝑡, 𝑑 +ℋ(𝐿C, 𝑡)

Affinity(diagram+text)

Coherence(covers  all  facts,no  conflict) 32

• High   text  and  diagram  scores• Cover  all  facts  in  text• Literals  don’t   conflict

Page 33: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

0ptimization  algorithm

𝐿∗ = argmax?@⊂?

𝜆𝒜 𝐿C, 𝑡, 𝑑 +ℋ(𝐿C, 𝑡)  

affinity coherence

Bad  news:  combinatorial  optimization  is  NP-­‐hardGood  news:  objective  function  is  submodular

Greedy  algorithm efficiently  finds  a  solution  with  bounded  distance  to  the  optimum.

Starting  from  empty  set,  greedily  add  the  next  best  literal  to  the  set.

𝑙H = argmaxIJ∈?∖?@

ℱ 𝐿C ∪ 𝑙H − ℱ(𝐿C)

33

Page 34: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Solving

Diagram

Text

facts

factsanswer

(1)

(2)

(3)Help

34

Page 35: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Numerical  solver

Literal Equation

Equals(LengthOf(AB),d) (Ax-­‐Bx)2+(Ay-­‐By)2-­‐d2 =  0

Parallel(AB,  CD) (Ax-­‐Bx)(Cy-­‐Dy)-­‐(Ay-­‐By)(Cx-­‐Dx)  =  0

PointLiesOnLine(B,  AC) (Ax-­‐Bx)(By-­‐Cy)-­‐(Ay-­‐By)(Bx-­‐Cx)  =  0

Perpendicular(AB,CD) (Ax-­‐Bx)(Cx-­‐Dx)+(Ay-­‐By)(Cy-­‐Dy)   =  0

• Find  the  solution  to  the  equation  system• Use  off-­‐the-­‐shelf  numerical  minimizers  (Wales  and  Doye,  1997;  Kraft,  1988)

• Numerical  solver  can  choose  not to  answer  question

35

• Translate  literals  to  numeric  equations

Page 36: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Dataset

• Training  questions   (67  questions,  121  sentences)• Seo  et  al.,  2014• High  school  geometry  questions

• Test  questions (119  questions,  215  sentences)• We  collected  them• SAT  (US  college  entrance  exam)  geometry  questions

• We  manually  annotated  the  text  parse  of  all  questions

• Dataset  is  publicly  available  at:geometry.allenai.org

36

Page 37: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Experiment  1:  answering  questions  

0

10

20

30

40

50

60

GeoS  (our  system)

SAT  Score  (%)

***  0.25  penalty  for  incorrect  answer

37

Page 38: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Experiment  1:  answering  questions  

0

10

20

30

40

50

60

Text  only Diagram  only

GeoS

SAT  Score  (%)

***  0.25  penalty  for  incorrect  answer

38

Page 39: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Experiment  1:  answering  questions  

0

10

20

30

40

50

60

Text  only Diagram  only

Rule-­‐based GeoS

SAT  Score  (%)

***  0.25  penalty  for  incorrect  answer

39

Page 40: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Experiment  1:  answering  questions  

0

10

20

30

40

50

60

Text  only Diagram  only

Rule-­‐based GeoS Student  average

SAT  Score  (%)

***  0.25  penalty  for  incorrect  answer

40

Page 41: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Experiment  2:  Improving  dependency  parsing

E

C

B D

A

“BD  is  perpendicular  to  AC  at  point  E.”

Obtain  top-­‐k  dependency  parses,  and  re-­‐rank  them  based  on  GeoS result

41

0102030405060708090

Stanford  dep  parse  only

With  GeoS

Page 42: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Demo  (geometry.allenai.org/demo)

42

Page 43: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Oracle  Studies

0

10

20

30

40

50

60

70

80

90

100

GeoS

GeoS Improvement Incorrect

43

Page 44: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Oracle  Studies

0

10

20

30

40

50

60

70

80

90

100

GeoS Oracle  TP+GeoS  DP

GeoS Improvement Incorrect

44

Page 45: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Oracle  Studies

0

10

20

30

40

50

60

70

80

90

100

GeoS Oracle  TP+GeoS  DP GeoS  TP+Oracle  DP

GeoS Improvement Incorrect

45

Page 46: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Oracle  Studies

0

10

20

30

40

50

60

70

80

90

100

GeoS Oracle  TP+GeoS  DP GeoS  TP+Oracle  DP Oracle  TP+Oracle  DP

GeoS Improvement Incorrect

46

Page 47: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Failure  Modes

In#the#figure#at#the#le-,#the#smaller#circles#

each#have#radius#3.#They#are#tangent#to#the#

larger#circle#at#points#A#and#C,#and#are#tangent#

to#each#other#at#point#B,#which#is#the#center#of#

the#larger#circle.#What#is#the#perimeter#of#the#

shaded#region?#

In#the#figure#at#the#le-,#a#shaded#

polygon#which#has#equal#angles#is#

parCally#covered#with#a#sheet#of#

blank#paper.#If#x+y=80,#how#many#

sides#does#the#polygon#have?##

(a)#6*pi###(b)#8*pi###(c)#9*pi###(d)#8*pi###(e)#15*pi#

(a)#10###(b)#9####(c)#8####(d)#7###(e)#6#

(a)#

(b)#

Fails&to&resolve&“they”&to&“each&other”&

Requires&complex&reasoning:&&Cannot&understand&that&the&polygon&is&“hidden”&

47

Page 48: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Summary

• First  end-­‐to-­‐end  system  for  solving  high  school  geometry  problems

• Achieved  55%  on  official  and  practice  SAT  geometry  questions

• Text  parsing  in  the  presence  of  diagram

48

Page 49: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Future  work

• Expand  text  parsing  algorithm  to  other  grounded  language  acquisition  domains

• Improvements  in  solving  geometry  problems:• Increase  data  size• Weakly-­‐supervised  learning• More  interaction  between  text  and  diagram• More  transparent  solver• Numerical  solver  is  black  box• Logical  solver:  gives  more  feedback  from  the  solution

49

Page 50: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Thank  you!

For  more  information,  please  visit:

geometry.allenai.org

50

Page 51: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Two-­‐stage  parsing

Natural  Language

Formal  LanguageIntermediate  Representation

Easy

Hard!

51

(Kwiatkowski  et  al.,  2013)

“Circle  O  has  radius  of  5”

Equals(RadiusOf(O), 5)

Bridged(RadiusOf(O), 5)

Page 52: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Two-­‐stage  parsing:  examples

Natural  language “Circle  O  has  a  radius  of  5.”Intermediate Bridged(RadiusOf(O), 5)Formal  language Equals(RadiusOf(O), 5)

Natural  language “AM  and  CM  bisect  BAC  and  BCA.”Intermediate Bisects(AM, BAC) ∧

CC(AM, CM) ∧ CC(BAC, BCA)Formal  language Bisects(AM,BAC) ∧

Bisects(CM, BCA)

52

Page 53: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Affinity  score  function

• Each  literal  has  text  score  and  diagram  score• Affinity  score  is  the  sum  of  text  and  diagram  scores  of  literals

𝒜(𝐿C, 𝑡, 𝑑) = ) 𝒜$%&$ 𝑙HC, 𝑡 +𝒜O1PQRPS 𝑙HC, 𝑑IJ@∈?@

53

Page 54: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Coherence  score  function

“DE  is  parallel  with  AB,  and  EF  equals  5.”

Parallel(DE, EF)Equals(AB, 5)Equals(EF, 5)

Parallel(DE, AB)

Parallel(DE, EF)Equals(AB, 5)

Parallel(DE, AB)Equals(EF, 5)

High  coverage,  high   redundancy

Low  coverage,  low  redundancy

High  coverage,  low  redundancy High  coverage,  low  redundancy

ℋ 𝐿C, 𝑡 = 𝑁 𝐿C − 𝑅(𝐿C)

coverage redundancy 54

Page 55: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Numerical  solver

AB  is  perpendicular   to  BC,  AB  =  3  and  BC  =  4.What  is  the  length  of  AB?

a)  3      b)  4      c)  5      d)  6      e)  7

Perpendicular(AB, BC)Equals(LengthOf(AB), 3)Equals(LengthOf(BC, 4)Equals(LengthOf(AC), What)

A

B C

• 2  variables  for  each  point  (x,  y)• 1  variable  for  unknown  (What)• One  equation  for  each  literal• Simultaneously  satisfy  4  equations  with  7 variables  (3  variables  are  free  due  to  translation  and  rotation)

55

Page 56: Solving(geometry(problems:( combining(text(and(diagram ...Geometry(Word(Problems In the diagram at the right, circle O has a radius of 5, and CE = 2. Diameter AC is perpendicular to

Experiment  2:  semantic  parsing  

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

F1  Score

Text  only Rule-­‐based GeoS

56