language generation via dag transduction · language generation via dag transduction yajie ye,...

69
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer Science and Technology Peking University July 17, 2018

Upload: others

Post on 14-Jul-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Language Generation via DAG Transduction

Yajie Ye, Weiwei Sun and Xiaojun Wan{yeyajie,ws,wanxiaojun}@pku.edu.cn

Institute of Computer Science and TechnologyPeking University

July 17, 2018

Page 2: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Overview

1 Background

2 Formal Models

3 Our DAG Transducer

4 Evaluation

Page 3: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Outline

1 Background

2 Formal Models

3 Our DAG Transducer

4 Evaluation

Page 4: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

A NLG system Architecture

Communicative Goal

DocumentPlanning

Document Plans

Microplanning

Sentence Plans

LinguisticRealisation

Surface Text

ReferenceEhud Reiter and Robert Dale, Building Natural LanguageGeneration Systems, Cambridge University Press, 2000.

Page 5: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

A NLG system Architecture

Communicative Goal

DocumentPlanning

Document Plans

Microplanning

Sentence Plans

LinguisticRealisation

Surface Text

In this paper, we study surface realization, i.e. mapping meaningrepresentations to natural language sentences.

Page 6: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Meaning Representation

• Logic form, e.g. lambda calculus

• Feature structures• This paper: Graphs!

Page 7: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Meaning Representation

• Logic form, e.g. lambda calculus• Feature structures

• This paper: Graphs!

Page 8: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Meaning Representation

• Logic form, e.g. lambda calculus• Feature structures• This paper: Graphs!

Page 9: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Graph-Structured Meaning Representation

Different kinds of graph-structured semantic representations:• Semantic Dependency Graphs (SDP)• Abstract Meaning Representations (AMR)• Dependency-based Minimal Recursion Semantics (DMRS)• Elementary Dependency Structures (EDS)

Page 10: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Graph-Structured Meaning Representation

Different kinds of graph-structured semantic representations:• Semantic Dependency Graphs (SDP)• Abstract Meaning Representations (AMR)• Dependency-based Minimal Recursion Semantics (DMRS)• Elementary Dependency Structures (EDS)

Page 11: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Graph-Structured Meaning Representation

Different kinds of graph-structured semantic representations:• Semantic Dependency Graphs (SDP)• Abstract Meaning Representations (AMR)• Dependency-based Minimal Recursion Semantics (DMRS)• Elementary Dependency Structures (EDS)

Page 12: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Graph-Structured Meaning Representation

Different kinds of graph-structured semantic representations:• Semantic Dependency Graphs (SDP)• Abstract Meaning Representations (AMR)• Dependency-based Minimal Recursion Semantics (DMRS)• Elementary Dependency Structures (EDS)

_want_v_1_the_q

_boy_n_1_the_q _believe_v_1 pronoun_q

_girl_n_1 pron

BV

BV

ARG1 ARG2

ARG1 ARG2 BV

Page 13: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Type-Logical Semantic Graph

EDS graphs are grounded under type-logical semantics. They areusually very flat and multi-rooted graphs.

_want_v_1_the_q

_boy_n_1_the_q _believe_v_1 pronoun_q

_girl_n_1 pron

BV

BV

ARG1 ARG2

ARG1 ARG2 BV

The boy wants the girl to believe him.

Page 14: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Previous Work

1 Seqence-to-seqence Models. (AMR-to-text)

2 Synchronous Node Replacement Grammar. (AMR-to-text)3 Other Unification grammar-based methods

ReferenceIoannis Konstas, Srinivasan Iyer, Mark Yatskar, Yejin Choi, andLuke Zettlemoyer. 2017. Neural AMR: Sequence-to-sequencemodels for parsing and generation.

Page 15: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Previous Work

1 Seqence-to-seqence Models. (AMR-to-text)2 Synchronous Node Replacement Grammar. (AMR-to-text)

3 Other Unification grammar-based methods

ReferenceLinfeng Song, Xiaochang Peng, Yue Zhang, Zhiguo Wang, andDaniel Gildea. 2017. AMR-to-text generation with synchronousnode replacement grammar.

Page 16: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Previous Work

1 Seqence-to-seqence Models. (AMR-to-text)2 Synchronous Node Replacement Grammar. (AMR-to-text)3 Other Unification grammar-based methods

ReferenceCarroll, John and Oepen, Stephan 2005. High efficiency realizationfor a wide-coverage unification grammar

Page 17: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Outline

1 Background

2 Formal Models

3 Our DAG Transducer

4 Evaluation

Page 18: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Formalisms for Strings, Trees and Graphs

Chomsky hierarchy Grammar Abstract machinesType-0 - Turing machineType-1 Context-sensitive Linear-bounded

- Tree-adjoining Embedded pushdownType-2 Context-free Nondeterministic pushdownType-3 Regular Finite

Manipulating Graphs: Graph Grammar and DAG Automata.

Page 19: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Existing System

David Chiang, Frank Drewes, Daniel Gildea, Adam Lopez andGiorgio Satta. Weighted DAG Automata for Semantic Graphs.

the longest NLP paper that I’ve ever read

Page 20: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

DAG Automata

A weighted DAG automaton is a tuple

M = ⟨Σ,Q, δ,K⟩

σ

q1

q2

q3

. . . ◦

qm

◦ ◦ . . . ◦

σ

◦ ◦ ◦ . . . ◦

r1

r2

. . . ◦

rn

ω

{q1, · · · , qm} σ/ω−−→ {r1, · · · , rn}

Page 21: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

DAG Automata

σ

q1

q2

q3

. . . ◦

qm

◦ ◦ . . . ◦

σ

◦ ◦ ◦ . . . ◦

r1

r2

. . . ◦

rn

ω

• A run of M on DAG D = ⟨V,E, ℓ⟩ is an edge labeling functionρ : E → Q.

• The weight of ρ is the product of all weight of localtransitions:

δ(ρ) =⊗v∈V

δ

[ρ(in(v)) ℓ(v)−−→ ρ(out(v))

]

Page 22: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

DAG Automata: Toy Example

States:

John wants to go.

_want_v_1

_go_v_1proper_q

named(John)

Recognition Rules:

{} _want_v_1−−−−−−−→ { , }

{} proper_q−−−−−−→ { }

{ } _go_v_1−−−−−→ { }

{ } _go_v_1−−−−−→ { }

{ , , } named(John)−−−−−−−→ {}

Page 23: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

DAG Automata: Toy Example

States:

John wants to go.

_want_v_1

_go_v_1proper_q

named(John)

Recognition Rules:

{} _want_v_1−−−−−−−→ { , }

{} proper_q−−−−−−→ { }

{ } _go_v_1−−−−−→ { }

{ } _go_v_1−−−−−→ { }

{ , , } named(John)−−−−−−−→ {}

Page 24: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

DAG Automata: Toy Example

States:

John wants to go.

_want_v_1

_go_v_1proper_q

named(John)

Recognition Rules:

{} _want_v_1−−−−−−−→ { , }

{} proper_q−−−−−−→ { }

{ } _go_v_1−−−−−→ { }

{ } _go_v_1−−−−−→ { }

{ , , } named(John)−−−−−−−→ {}

Page 25: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

DAG Automata: Toy Example

States:

John wants to go.

_want_v_1

_go_v_1proper_q

named(John)

Recognition Rules:

{} _want_v_1−−−−−−−→ { , }

{} proper_q−−−−−−→ { }

{ } _go_v_1−−−−−→ { }

{ } _go_v_1−−−−−→ { }

{ , , } named(John)−−−−−−−→ {}

Page 26: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

DAG Automata: Toy Example

States:

John wants to go.

_want_v_1

_go_v_1proper_q

named(John)

Failed !

Recognition Rules:

{} _want_v_1−−−−−−−→ { , }

{} proper_q−−−−−−→ { }

{ } _go_v_1−−−−−→ { }

{ } _go_v_1−−−−−→ { }

{ , , } named(John)−−−−−−−→ {}

Page 27: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

DAG Automata: Toy Example

States:

John wants to go.

_want_v_1

_go_v_1proper_q

named(John)

Recognition Rules:

{} _want_v_1−−−−−−−→ { , }

{} proper_q−−−−−−→ { }

{ } _go_v_1−−−−−→ { }

{ } _go_v_1−−−−−→ { }

{ , , } named(John)−−−−−−−→ {}

Page 28: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

DAG Automata: Toy Example

States:

John wants to go.

_want_v_1

_go_v_1proper_q

named(John)

Recognition Rules:

{} _want_v_1−−−−−−−→ { , }

{} proper_q−−−−−−→ { }

{ } _go_v_1−−−−−→ { }

{ } _go_v_1−−−−−→ { }

{ , , } named(John)−−−−−−−→ {}

Page 29: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

DAG Automata: Toy Example

States:

John wants to go.

_want_v_1

_go_v_1proper_q

named(John)

Accept !

Recognition Rules:

{} _want_v_1−−−−−−−→ { , }

{} proper_q−−−−−−→ { }

{ } _go_v_1−−−−−→ { }

{ } _go_v_1−−−−−→ { }

{ , , } named(John)−−−−−−−→ {}

Page 30: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Existing System

Daniel Quernheim and Kevin Knight. 2012. Towards probabilisticacceptors and transducers for feature structures

Page 31: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

DAG-to-Tree Transducerq

WANT

BELIEVE

BOY GIRL

Page 32: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

DAG-to-Tree Transducerq

S

qnomb want s qinfbWANT

BELIEVE

BOY GIRL

BELIEVE

BOY GIRL

Page 33: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

DAG-to-Tree Transducerq

S

qnomb want s qinfb

S

qnomb want s INF

qaccg to believe qaccb

WANT

BELIEVE

BOY GIRL

BELIEVE

BOY GIRL

BOY GIRL

Page 34: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

DAG-to-Tree Transducerq

S

qnomb want s qinfb

S

qnomb want s INF

qaccg to believe qaccb

S

INF

NP NP NP

t he b oy want s t he gir l t o b elieve him

WANT

BELIEVE

BOY GIRL

BELIEVE

BOY GIRL

BOY GIRL

Page 35: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

DAG-to-Tree Transducer

q

WANT

BE LIE VE

BOY G IR L

S

qnomb want s qinfb

BE LIE VE

BOY G IR L

S

qnomb want s INF

qaccg to believe qaccb

BOY G IR L

S

INF

NP NP NP

t he b oy want s t he gir l t o b elieve him

Challenges for DAG-to-tree transduction on EDS graphs:• Cannot easily reverse the directions of edges• Cannot easily handle multiple roots

Page 36: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Outline

1 Background

2 Formal Models

3 Our DAG Transducer

4 Evaluation

Page 37: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Our DAG-to-program transducerThe basic idea:

• Rewritting: directly generating a new data structure pieceby piece, during recognizing an input DAG.

• Obtaining target structures based on side effects of theDAG recognition.

States:

_want_v_1

_go_v_1proper_q

named(John)

John wants to go.

The output of our transducer is aprogram:

Page 38: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Our DAG-to-program transducerThe basic idea:

• Rewritting: directly generating a new data structure pieceby piece, during recognizing an input DAG.

• Obtaining target structures based on side effects of theDAG recognition.

States:

_want_v_1

_go_v_1proper_q

named(John)

John wants to go.

The output of our transducer is aprogram:

Page 39: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Our DAG-to-program transducerThe basic idea:

• Rewritting: directly generating a new data structure pieceby piece, during recognizing an input DAG.

• Obtaining target structures based on side effects of theDAG recognition.

States:

_want_v_1

_go_v_1proper_q

named(John)

John wants to go.

The output of our transducer is aprogram:

S = x21 + want + x11

Page 40: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Our DAG-to-program transducerThe basic idea:

• Rewritting: directly generating a new data structure pieceby piece, during recognizing an input DAG.

• Obtaining target structures based on side effects of theDAG recognition.

States:

_want_v_1

_go_v_1proper_q

named(John)

John wants to go.

The output of our transducer is aprogram:

S = x21 + want + x11

x11 = to + go

Page 41: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Our DAG-to-program transducerThe basic idea:

• Rewritting: directly generating a new data structure pieceby piece, during recognizing an input DAG.

• Obtaining target structures based on side effects of theDAG recognition.

States:

_want_v_1

_go_v_1proper_q

named(John)

John wants to go.

The output of our transducer is aprogram:

S = x21 + want + x11

x11 = to + gox41 = ϵ

Page 42: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Our DAG-to-program transducerThe basic idea:

• Rewritting: directly generating a new data structure pieceby piece, during recognizing an input DAG.

• Obtaining target structures based on side effects of theDAG recognition.

States:

_want_v_1

_go_v_1proper_q

named(John)

John wants to go.

The output of our transducer is aprogram:

S = x21 + want + x11

x11 = to + gox41 = ϵ

x21 = x41 + John

Page 43: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Our DAG-to-program transducerThe basic idea:

• Rewritting: directly generating a new data structure pieceby piece, during recognizing an input DAG.

• Obtaining target structures based on side effects of theDAG recognition.

States:

_want_v_1

_go_v_1proper_q

named(John)

John wants to go.

The output of our transducer is aprogram:

S = x21 + want + x11

x11 = to + gox41 = ϵ

x21 = x41 + John

=⇒ S = John want to go

Page 44: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Transducation RulesRecognition Part Generation Part

A valid DAG Automata transition Statement template(s)

{} _want_v_1−−−−−−→ { , } S = v + L + v

Page 45: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Transducation RulesRecognition Part Generation Part

A valid DAG Automata transition Statement template(s)

{} _want_v_1−−−−−−→ { , } S = v + L + v

We use parameterized states:

label(number,direction)

The range of direction: unchanged, empty, reversed.

Page 46: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Transducation RulesRecognition Part Generation Part

A valid DAG Automata transition Statement template(s)

{} _want_v_1−−−−−−→ { , } S = v + L + v

We use parameterized states:

label(number,direction)

The range of direction: unchanged, empty, reversed.

{} _want_v_1−−−−−−→ {VP(1,u), NP(1,u)} S = vNP(1,u) + L + vVP(1,u)

Page 47: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Toy ExampleQ = {DET(1,r), Empty(0,e), VP(1,u), NP(1,u)}Rule For Recognition For Generation1 {} proper_q−−−−−→ {DET(1,r)} vDET(1,r) = ϵ

2 {} _want_v_1−−−−−−→ {VP(1,u), NP(1,u)} S = vNP(1,u) + L + vVP(1,u)

3 {VP(1,u)} _go_v_1−−−−−→ {Empty(0,e)} vVP(1,u) = to + L4 {NP(1,u), DET(1,r)} named−−−→ {} vNP(1,u) = vDET(1,r) + L

_want_v_1

_go_v_1

proper_q

named(John)

e3

e1

e2

e4

Recognition: To find anedge labeling function ρ. Thered dashed edges make up anintermediate graph T(ρ).

Page 48: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Toy ExampleQ = {DET(1,r), Empty(0,e), VP(1,u), NP(1,u)}Rule For Recognition For Generation1 {} proper_q−−−−−→ {DET(1,r)} vDET(1,r) = ϵ

2 {} _want_v_1−−−−−−→ {VP(1,u), NP(1,u)} S = vNP(1,u) + L + vVP(1,u)

3 {VP(1,u)} _go_v_1−−−−−→ {Empty(0,e)} vVP(1,u) = to + L4 {NP(1,u), DET(1,r)} named−−−→ {} vNP(1,u) = vDET(1,r) + L

_want_v_1

_go_v_1

proper_q

named(John)

e3

VP(1,u) e1

e2 NP(1,u)

e4

Recognition: To find anedge labeling function ρ. Thered dashed edges make up anintermediate graph T(ρ).

Page 49: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Toy ExampleQ = {DET(1,r), Empty(0,e), VP(1,u), NP(1,u)}Rule For Recognition For Generation1 {} proper_q−−−−−→ {DET(1,r)} vDET(1,r) = ϵ

2 {} _want_v_1−−−−−−→ {VP(1,u), NP(1,u)} S = vNP(1,u) + L + vVP(1,u)

3 {VP(1,u)} _go_v_1−−−−−→ {Empty(0,e)} vVP(1,u) = to + L4 {NP(1,u), DET(1,r)} named−−−→ {} vNP(1,u) = vDET(1,r) + L

_want_v_1

_go_v_1

proper_q

named(John)

Empty(0,e) e3

VP(1,u) e1

e2 NP(1,u)

e4

Recognition: To find anedge labeling function ρ. Thered dashed edges make up anintermediate graph T(ρ).

Page 50: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Toy ExampleQ = {DET(1,r), Empty(0,e), VP(1,u), NP(1,u)}Rule For Recognition For Generation1 {} proper_q−−−−−→ {DET(1,r)} vDET(1,r) = ϵ

2 {} _want_v_1−−−−−−→ {VP(1,u), NP(1,u)} S = vNP(1,u) + L + vVP(1,u)

3 {VP(1,u)} _go_v_1−−−−−→ {Empty(0,e)} vVP(1,u) = to + L4 {NP(1,u), DET(1,r)} named−−−→ {} vNP(1,u) = vDET(1,r) + L

_want_v_1

_go_v_1

proper_q

named(John)

Empty(0,e) e3

VP(1,u) e1

e2 NP(1,u)

e4 DET(1,r)

Recognition: To find anedge labeling function ρ. Thered dashed edges make up anintermediate graph T(ρ).

Page 51: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Toy ExampleQ = {DET(1,r), Empty(0,e), VP(1,u), NP(1,u)}Rule For Recognition For Generation1 {} proper_q−−−−−→ {DET(1,r)} vDET(1,r) = ϵ

2 {} _want_v_1−−−−−−→ {VP(1,u), NP(1,u)} S = vNP(1,u) + L + vVP(1,u)

3 {VP(1,u)} _go_v_1−−−−−→ {Empty(0,e)} vVP(1,u) = to + L4 {NP(1,u), DET(1,r)} named−−−→ {} vNP(1,u) = vDET(1,r) + L

_want_v_1

_go_v_1

proper_q

named(John)

Empty(0,e) e3

VP(1,u) e1

e2 NP(1,u)

e4 DET(1,r)

Recognition: To find anedge labeling function ρ. Thered dashed edges make up anintermediate graph T(ρ).

Accept !

Page 52: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Toy ExampleQ = {DET(1,r), Empty(0,e), VP(1,u), NP(1,u)}Rule For Recognition For Generation1 {} proper_q−−−−−→ {DET(1,r)} vDET(1,r) = ϵ

2 {} _want_v_1−−−−−−→ {VP(1,u), NP(1,u)} S = vNP(1,u) + L + vVP(1,u)

3 {VP(1,u)} _go_v_1−−−−−→ {Empty(0,e)} vVP(1,u) = to + L4 {NP(1,u), DET(1,r)} named−−−→ {} vNP(1,u) = vDET(1,r) + L

S = vNP(1,u) + L + vVP(1,u)

S = x21 + want + x11

Instantiation: replace vl(j,d)of edge ei with variable xijand L with the output stringin the statement templates.

Page 53: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

DAG Transduction based-NLG

A general framework for DAG transduction based-NLG:

Semantic Graph

DAG Transducer

Sequential Lemmas

Seq2seq Model

Surface string

Page 54: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Outline

1 Background

2 Formal Models

3 Our DAG Transducer

4 Evaluation

Page 55: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Inducing Transduction Rules

_steep_a_1<21:28>

_decline_n_1<5:12>

focus_d

mofy<37:48>

comp pronoun_q

pron<49:51>

_say_v_to<52:57>

proper_q _the_q<0:4>

_even_x_deg<16:20>

_in_p_temp<34:36>

e4

e3

e2

e5 e12

e1

e10e9

e7

e9

e6

e11

“the decline is even steeper than in September”, he said.

Findingintermediate

treeAssigning spans Assigning labels

Generatingstatementtemplates

Page 56: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Inducing Transduction Rules

_steep_a_1<21:28>

_decline_n_1<5:12>

focus_d

mofy<37:48>

comp pronoun_q

pron<49:51>

_say_v_to<52:57>

proper_q _the_q<0:4>

_even_x_deg<16:20>

_in_p_temp<34:36>

e4

e3

e2

e5 e12

e1

e10e9

e7

e9

e6

e11

“the decline is even steeper than in September”, he said.

Findingintermediate

treeAssigning spans Assigning labels

Generatingstatementtemplates

Page 57: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Inducing Transduction Rules

_steep_a_1<21:28>

_decline_n_1<5:12>

focus_d

mofy<37:48>

comp pronoun_q

pron<49:51>

_say_v_to<52:57>

proper_q _the_q<0:4>

_even_x_deg<16:20>

_in_p_temp<34:36>

e4{<34:48>}

e3{<0:48>}

e2{<0:48>}e5

{<16:20>,<29:48>} e12

e1{<16:20>}

e10{<0:4>}e9 {}

e7 {}

e9{<37:48>}

e6{<49:51>}

e11 {<0:12>}

“the decline is even steeper than in September”, he said.

Findingintermediate

treeAssigning spans Assigning labels

Generatingstatementtemplates

Page 58: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Inducing Transduction Rules

_steep_a_1<21:28>

_decline_n_1<5:12>

focus_d

mofy<37:48>

comp pronoun_q

pron<49:51>

_say_v_to<52:57>

proper_q _the_q<0:4>

_even_x_deg<16:20>

_in_p_temp<34:36>

e4{PP<34:48>}

e3{S<0:48>}

e2{S<0:48>}e5

{ADV<16:20>,PP<29:48>} e12

e1{ADV<16:20>}

e10{DET<0:4>}e9 {}

e7 {}

e9{NP<37:48>}

e6{NP<49:51>}

e11 {NP<0:12>}

“the decline is even steeper than in September”, he said.

Findingintermediate

treeAssigning spans Assigning labels

Generatingstatementtemplates

Page 59: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Inducing Transduction Rules

_steep_a_1<21:28>

_decline_n_1<5:12>

focus_d

mofy<37:48>

comp pronoun_q

pron<49:51>

_say_v_to<52:57>

proper_q _the_q<0:4>

_even_x_deg<16:20>

_in_p_temp<34:36>

e4{PP<34:48>}

e3{S<0:48>}

e2{S<0:48>}e5

{ADV<16:20>,PP<29:48>} e12

e1{ADV<16:20>}

e10{DET<0:4>}e9 {}

e7 {}

e9{NP<37:48>}

e6{NP<49:51>}

e11 {NP<0:12>}

“the decline is even steeper than in September”, he said.

Findingintermediate

treeAssigning spans Assigning labels

Generatingstatementtemplates

Page 60: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Inducing Transduction Rules

_steep_a_1<21:28>

_decline_n_1<5:12>

focus_d

mofy<37:48>

comp pronoun_q

pron<49:51>

_say_v_to<52:57>

proper_q _the_q<0:4>

_even_x_deg<16:20>

_in_p_temp<34:36>

e4{PP<34:48>}

e3{S<0:48>}

e2{S<0:48>}e5

{ADV<16:20>,PP<29:48>} e12

e1{ADV<16:20>}

e10{DET<0:4>}e9 {}

e7 {}

e9{NP<37:48>}

e6{NP<49:51>}

e11 {NP<0:12>}

“the decline is even steeper than in September”, he said.

{ADV(1,r)} comp−−−→ {PP(1,u), ADV_PP(2,r)}vADV_PP(1,r) = vADV(1,r)vADV_PP(2,r) = than + vPP(1,u)

Page 61: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Inducing Transduction Rules

_steep_a_1<21:28>

_decline_n_1<5:12>

focus_d

mofy<37:48>

comp pronoun_q

pron<49:51>

_say_v_to<52:57>

proper_q _the_q<0:4>

_even_x_deg<16:20>

_in_p_temp<34:36>

e4{PP<34:48>}

e3{S<0:48>}

e2{S<0:48>}e5

{ADV<16:20>,PP<29:48>} e12

e1{ADV<16:20>}

e10{DET<0:4>}e9 {}

e7 {}

e9{NP<37:48>}

e6{NP<49:51>}

e11 {NP<0:12>}

“the decline is even steeper than in September”, he said.

{PP(1,u)} _in_p_temp−−−−−−−→ {NP(1,u)}vPP(1,u) = in + vNP(1,u)

Page 62: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

NLG via DAG transduction

Experimental set-up• Data: DeepBank + Wikiwoods• Decoder: Beam search (beam size = 128)• About 37,000 induced rules are directly obtained from

DeepBank training dataset by a group of heuristic rules.• Disambiguation: global linear model

Transducer Lemmas Sentences Coverageinduced rules 89.44 74.94 67%

Page 63: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Fine-to-coarse Transduction

To deal with data sparseness problem, we use some heuristic rulesto generate extened rules by slightly changing an induced rule.Given a induced rule:

{NP, ADJ} X−→ {} vNP = vADJ + L

New rule generated by deleting:

{NP} X−→ {} vNP = L

Page 64: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Fine-to-coarse Transduction

To deal with data sparseness problem, we use some heuristic rulesto generate extened rules by slightly changing an induced rule.Given a induced rule:

{NP, ADJ} X−→ {} vNP = vADJ + L

New rule generated by copying:

{NP, ADJ1, ADJ2}X−→ {} vNP = vADJ1 + vADJ2 + L

Page 65: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

NLG via DAG transduction

Experimental set-up• Data: DeepBank + Wikiwoods• Decoder: Beam search (beam size = 128)• About 37,000 induced rules and 440,000 exteneded rules• Disambiguation: global linear model

Transducer Lemmas Sentences Coverageinduced rules 89.44 74.94 67%induced and exteneded rules 88.41 74.03 77%

Page 66: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Fine-to-coarse transduction

σ

q1

q2

q3

. . . ◦

qm

◦ ◦ . . . ◦

σ

◦ ◦ ◦ . . . ◦

r1

r2

. . . ◦

rn

ω

During decoding, when neither induced nor extended rule isapplicable, we use markov model to create a dynamic ruleon-the-fly:

P({r1, · · · , rn}|C) = P(r1|C)

n∏i=2

P(ri|C)P(ri|ri−1,C)

• C = ⟨{q1, · · · , qm},D⟩ represents the context.• r1, · · · , rn denotes the outgoing states.

Page 67: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

NLG via DAG transduction

Experimental set-up• Data: DeepBank + Wikiwoods• Decoder: Beam search (beam size = 128)• Other tool: OpenNMT

Transducer Lemmas Sentences Coverageinduced rules 89.44 74.94 67%induced and exteneded rules 88.41 74.03 77%induced, exteneded and dynamic rules 82.04 68.07 100%DFS-NN 50.45 100%AMR-NN 33.8 100%AMR-NRG 25.62 100%

Page 68: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

Conclusion and Future Work

English Resouce Semantics is fantastic!

Conclusion• Formalism works for graph-to-string mapping, not surprisingly

or surprisinglyFuture work

• Is the decoder perfect? No, not even close• Is the disambiguation model a neural one? No, graph

embedding is non-trivial.

Page 69: Language Generation via DAG Transduction · Language Generation via DAG Transduction Yajie Ye, Weiwei Sun and Xiaojun Wan {yeyajie,ws,wanxiaojun}@pku.edu.cn Institute of Computer

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

QUESTIONS?COMMENTS?