最近のtransition based parsing

74
最近の Transition-based Parsing PFI セミナー 2013/8/5

Upload: nozyh

Post on 10-May-2015

1.601 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: 最近のTransition based parsing

最近の Transition-based Parsing

PFI セミナー 2013/8/5

Page 2: 最近のTransition based parsing

自己紹介

‣ 能地宏 / @nozyh

‣ 2011年夏インターン~アルバイト

‣ 専門:自然言語処理・計算言語学- 言語獲得- 構文解析

‣ - 2013/3 : 東大・情報理工‣ 2013/4 - : 総合研究大学院大学・情報学専攻 (D1)- 普段は NII にいます

Page 3: 最近のTransition based parsing

今日の話

‣ 自然言語の構文解析- 構文解析とは何か?- 係り受け解析の現状

‣ transition-based parsing - Arc-standard,Arc-eager- 様々な亜種 (dynamic oracle, dynamic transition, non-monotonic, etc)

Page 4: 最近のTransition based parsing

対象者と聞き方

‣ 自然言語処理の研究をしていない人(構文解析に失望している人?)- 現在自然言語処理で最高精度の構文解析がどういう仕組みで動いているのか雰囲気を掴んでもらえれば…- 難しい数学はほとんど出てきません

‣ 自然言語処理の研究者- Transition-based の様々な亜種・工夫について,今年の ACL, CoNLL(ただいま開催中@ブルガリア)まで- State-of-the-art の網羅というより,考え方中心です- 最新手法までのまとめとして

Page 5: 最近のTransition based parsing

構文解析(係り受け解析)入門

‣ 海野さんの分かりやすいスライドがあります‣ こちらは主に Chart-based の手法を説明‣ 今回は,それと対になる Transition-based の手法を主に説明

http://www.slideshare.net/unnonouno/ss-5724050

Page 6: 最近のTransition based parsing

係り受け = 依存文法

‣ 例により説明がすくない…(英語は充実)

Page 7: 最近のTransition based parsing

解析してみよう

1. (日本語の場合)形態素解析2. 文節に区切る(チャンキング)3. 文節間に係り関係を付与

構造は語と従属部との関係として定義される

構造 は 語 と 従属 部 と の 関係 として 定義 さ れる名 助 名 助 名 名 助 助 名 助 名 動 動

※ 日本語は普通、矢印の向きがこれと逆ですが、他の言語に合わせます

Page 8: 最近のTransition based parsing

head と dependent

‣ head: 主辞‣ dependent: head にかかる句‣ dependent は head を修飾する‣ イメージ: head+dependent を head のみに置き換えても文が成り立つ‣ 動詞が一番重要 => 文全体の head は動詞

名 助構造 は

名 助語 と

名 名 助 助従属 部 と の 名 助

関係 として名 動 動定義 さ れる

Page 9: 最近のTransition based parsing

head と dependent

‣ head: 主辞‣ dependent: head にかかる句‣ dependent は head を修飾する‣ イメージ: head+dependent を head のみに置き換えても文が成り立つ‣ 動詞が一番重要 => 文全体の head は動詞

名 助構造 は

名 名 助 助従属 部 と の 名 助

関係 として名 動 動定義 さ れる

head名 助語 と

dependent

Page 10: 最近のTransition based parsing

head と dependent

‣ head: 主辞‣ dependent: head にかかる句‣ dependent は head を修飾する‣ イメージ: head+dependent を head のみに置き換えても文が成り立つ‣ 動詞が一番重要 => 文全体の head は動詞

名 助構造 は

名 助関係 として

名 動 動定義 さ れる

名 助語 と

名 名 助 助従属 部 と の

dependent

head

Page 11: 最近のTransition based parsing

英語では、単語単位で木をつくる

“Jubatus” is a processing platform for analyzing large-scale datasets which are increasing in the current big data era .

is

“Jubatus”a processing

platform

foranalyzing

large-scale

datasets

which

are

increasing

・・・

Page 12: 最近のTransition based parsing

そもそも定義が曖昧な部分も

‣ head とは何か- 闇が広がっている・・・- 教師なし構文解析は、自分の信じるheadの性質 (メタなhead) をモデルに組み込む問題- しかし評価が問題(今日は教師ありしか扱いません)

ex. 並列構造の解析... includes dogs , cats and rats ...

言語学者により解釈が異なる (!)

Main familyPrague family (code fP)

[14 treebanks]Moscow family (code fM)

[5 treebanks]Stanford family (code fS)

[6 treebanks]Choice of head

Head on left (code hL)[10 treebanks]

Head on right (code hR)[14 treebanks]

Mixed head (code hM) [1 treebank] A mixture of hL and hR

520

(Popel, et al. 2013)

Page 13: 最近のTransition based parsing

なぜ構文解析するのか

‣ 構文木は、(浅い意味で)文の意味関係を捉えている

‣ そこから様々な情報を抽出して利用- 機械翻訳:現在主流の Tree-to-string は,source 側の構文解析が必要     構文解析を間違えると翻訳も間違える

- 情報抽出:主語と目的語の関係を見つけたい

‣ 今は色々なアプリケーションで構文解析の精度がボトルネック- 歴史は古いが重要(’90)- 本当に重要な問題を解いているかは疑問(?)

Page 14: 最近のTransition based parsing

基本の枠組み

‣ ツリーバンク : 言語学者が作った,構文“木” の集合- 訓練データとして用いる- 非常に高コスト- 英語のデータは Penn Treebank (Marcus et al., 1993) をずっと使っている (5万文程度)

ツリーバンク

モデル(分類器)

教師あり学習

“Jubatus” is a processing platform ...

未知のデータを解析

head が予測出来た単語の割合で評価する(文毎の正解率ではない)

Page 15: 最近のTransition based parsing

State-of-the-art90.3Yamada and Matsumoto ’03

90.5McDonald ’05

McDonald and Pereia ’06 91.5

Sagae and Lavie ’06 92.7

93.0Koo and Collins ’10

92.9Zhang and Nivre ’11

93.39Bohnet and Kuhn ’12

93.12Hayashi et al. ’13

Charniak and Johnson ’05 93.7

Petrov et al. ’06 92.8

多くの結果は http://www.lumii.lv/nodalida2011/slides/nivre.pdf から引用

Transition-basedGraph-basedHybridPCFG-based

計算時間も重要PCFG-based は遅い

Page 16: 最近のTransition based parsing

係り受け解析に対する二つの手法

‣ DP で探索(Eisner法): (海野さんの資料など参照)‣ Maximum Spanning Tree 法 :

Graph-basedPeople write Java with tears

分類問題y

x =

: 単語間の係り関係

y = arg maxy

w · �(x, y) �(x, y) : 素性関数

People write Java with tears

People write Java with tears

People write Java with tears

w · � = 10, 000

w · � = 8, 400

w · � = 1, 200

O(n3) �O(n2)

Page 17: 最近のTransition based parsing

係り受け解析に対する二つの手法

‣ 今日はこちらをメインに話します‣ Graph-based と異なる考えだが,両者の性能はほとんど同じ- McDonald and Nivre (2010), Goldberg and Elhadad (2010) などで様々な比較

Transition-basedPeople write Java with tearsx =

逐次的な分類器の適応で解く:(以下の図はイメージ)

People

People write

500

writePeople

-100

People write Java1000

People write Java

50People write Java with

1200

People write Java with

500

O(n)

Page 18: 最近のTransition based parsing

(余談)最近の流行はHybrid法

‣ Graph-based と Transition-based のいいとこどり,もしくは他のコアな機械学習技術との組み合わせ

‣ Nivre and McDonald (2008)- Transition-based で一度解析し,その結果を Graph-based の素性に利用‣ Koo et al. (2010)- Dual decomposition で,二つの最適化問題を解く (c.f. 岡野原さんのブログ記事)- MST + 3rd-order non-projective chart parsing‣ Rush and Petrov (2012)- Multi-pass pruning + 3rd-order Eisner‣ Hayashi et al. (2013)- Dynamic programming shift-reduce + Packed forest reranking

Page 19: 最近のTransition based parsing

以降は Transition-based のみを扱います

‣ 基本の二つのモデルの紹介- Arc-standard, Arc-eager (Nivre, 2004)

‣ 問題点とその解決法- Beam search (Zhang and Clark, 2008)- DP (Huang and Sagae, 2010)- Dynamic oracle (Goldberg and Nivre, 2012)- Non-monotonic transition (Honnibal, Goldberg and Johnson, 2013 CoNLL)- Dynamic transition (Sartorio, Satta and Nivre, 2013 ACL)

Page 20: 最近のTransition based parsing

Arc-standardPeople write Java with tears

People write Java with tears

Stack

Actions

Buffer (Input)

Shift: Bufferの先頭をStackに移動LeftReduce: スタックの先頭2つをくっつける(右がhead)RightReduce: スタックの先頭2つをくっつける(左がhead)

SHLR

SH

Page 21: 最近のTransition based parsing

Arc-standardPeople write Java with tears

write Java with tears

ActionsShift: Bufferの先頭をStackに移動LeftReduce: スタックの先頭2つをくっつける(右がhead)RightReduce: スタックの先頭2つをくっつける(左がhead)

SHLR

SH

People

SH

Stack Buffer (Input)

Page 22: 最近のTransition based parsing

Arc-standardPeople write Java with tears

Java with tears

ActionsShift: Bufferの先頭をStackに移動LeftReduce: スタックの先頭2つをくっつける(右がhead)RightReduce: スタックの先頭2つをくっつける(左がhead)

SHLR

SH

People

SH

write

L

Stack Buffer (Input)

Page 23: 最近のTransition based parsing

Arc-standardPeople write Java with tears

Java with tears

ActionsShift: Bufferの先頭をStackに移動LeftReduce: スタックの先頭2つをくっつける(右がhead)RightReduce: スタックの先頭2つをくっつける(左がhead)

SHLR

SHPeople

SH

write

L SH

Stack Buffer (Input)

Page 24: 最近のTransition based parsing

Arc-standardPeople write Java with tears

with tears

ActionsShift: Bufferの先頭をStackに移動LeftReduce: スタックの先頭2つをくっつける(右がhead)RightReduce: スタックの先頭2つをくっつける(左がhead)

SHLR

SH SH LPeople

write

SH

Java

R

Stack Buffer (Input)

Page 25: 最近のTransition based parsing

Arc-standardPeople write Java with tears

with tears

ActionsShift: Bufferの先頭をStackに移動LeftReduce: スタックの先頭2つをくっつける(右がhead)RightReduce: スタックの先頭2つをくっつける(左がhead)

SHLR

SH SH LPeople

write

SHJava

R SH

Stack Buffer (Input)

Page 26: 最近のTransition based parsing

Arc-standardPeople write Java with tears

tears

ActionsShift: Bufferの先頭をStackに移動LeftReduce: スタックの先頭2つをくっつける(右がhead)RightReduce: スタックの先頭2つをくっつける(左がhead)

SHLR

SH SH L SH RPeople

write

JavaSH

with

SH

Stack Buffer (Input)

Page 27: 最近のTransition based parsing

Arc-standardPeople write Java with tears

tears

ActionsShift: Bufferの先頭をStackに移動LeftReduce: スタックの先頭2つをくっつける(右がhead)RightReduce: スタックの先頭2つをくっつける(左がhead)

SHLR

SH SH L SH RPeople

write

JavaSH

with

SH R

Stack Buffer (Input)

Page 28: 最近のTransition based parsing

Arc-standardPeople write Java with tears

tears

ActionsShift: Bufferの先頭をStackに移動LeftReduce: スタックの先頭2つをくっつける(右がhead)RightReduce: スタックの先頭2つをくっつける(左がhead)

SHLR

SH SH L SH RPeople

write

JavaSH

with

SH R R

Stack Buffer (Input)

Page 29: 最近のTransition based parsing

Arc-standardPeople write Java with tears

ActionsShift: Bufferの先頭をStackに移動LeftReduce: スタックの先頭2つをくっつける(右がhead)RightReduce: スタックの先頭2つをくっつける(左がhead)

SHLR

SH SH L SH RPeople

write

JavaSH SH R

tears

withR

Stack Buffer (Input)

Page 30: 最近のTransition based parsing

Arc-standard はボトムアップ

‣ write → with というリンクは存在するが…- ここで R を選ぶと,with → tears というリンクは作られない

tears

SH SH L SH RPeople

write

JavaSH

with

?

Stack Buffer (Input)

Page 31: 最近のTransition based parsing

Arc-standard はボトムアップ

‣ write → with というリンクは存在するが…- ここで R を選ぶと,with → tears というリンクは作られない- with → tears ができあがってから,それを write と繋げないといけない

tears

SH SH L SH RPeople

write

JavaSH

withR

一度スタックから外れた語は,子を持てない

Stack Buffer (Input)

Page 32: 最近のTransition based parsing

Arc-eagerPeople write Java with tears

People write Java with tears

Stack

Actions

Buffer (Input)

SH Shift: Bufferの先頭をStackに移動LA LeftArc: Bufferの先頭に,Stackの先頭をくっつけるRA RightArc: Stackの先頭に,Bufferの先頭をくっつける.Bufferの先頭をStackに移動RE Reduce: Stackの先頭をとりのぞく

SH

Page 33: 最近のTransition based parsing

Arc-eagerPeople write Java with tears

write Java with tears

Stack

Actions

Buffer (Input)

SH Shift: Bufferの先頭をStackに移動LA LeftArc: Bufferの先頭に,Stackの先頭をくっつけるRA RightArc: Stackの先頭に,Bufferの先頭をくっつける.Bufferの先頭をStackに移動RE Reduce: Stackの先頭をとりのぞく

SH

People

LA

Page 34: 最近のTransition based parsing

Arc-eagerPeople write Java with tears

write Java with tears

Stack

Actions

Buffer (Input)

SH Shift: Bufferの先頭をStackに移動LA LeftArc: Bufferの先頭に,Stackの先頭をくっつけるRA RightArc: Stackの先頭に,Bufferの先頭をくっつける.Bufferの先頭をStackに移動RE Reduce: Stackの先頭をとりのぞく

SH

People

LA SH

Page 35: 最近のTransition based parsing

Arc-eagerPeople write Java with tears

Java with tears

Stack

Actions

Buffer (Input)

SH Shift: Bufferの先頭をStackに移動LA LeftArc: Bufferの先頭に,Stackの先頭をくっつけるRA RightArc: Stackの先頭に,Bufferの先頭をくっつける.Bufferの先頭をStackに移動RE Reduce: Stackの先頭をとりのぞく

SH LA SH

People

write

RA

Page 36: 最近のTransition based parsing

Arc-eagerPeople write Java with tears

with tears

Stack

Actions

Buffer (Input)

SH Shift: Bufferの先頭をStackに移動LA LeftArc: Bufferの先頭に,Stackの先頭をくっつけるRA RightArc: Stackの先頭に,Bufferの先頭をくっつける.Bufferの先頭をStackに移動RE Reduce: Stackの先頭をとりのぞく

SH LA SH

People

write

RA

Java

RE

Page 37: 最近のTransition based parsing

Arc-eagerPeople write Java with tears

with tears

Stack

Actions

Buffer (Input)

SH Shift: Bufferの先頭をStackに移動LA LeftArc: Bufferの先頭に,Stackの先頭をくっつけるRA RightArc: Stackの先頭に,Bufferの先頭をくっつける.Bufferの先頭をStackに移動RE Reduce: Stackの先頭をとりのぞく

SH LA SH

People

write

RA

Java

RE RA

Page 38: 最近のTransition based parsing

Arc-eagerPeople write Java with tears

tears

Stack

Actions

Buffer (Input)

SH Shift: Bufferの先頭をStackに移動LA LeftArc: Bufferの先頭に,Stackの先頭をくっつけるRA RightArc: Stackの先頭に,Bufferの先頭をくっつける.Bufferの先頭をStackに移動RE Reduce: Stackの先頭をとりのぞく

SH LA SH RA RE

People

write

Java

RA

with

RA

Page 39: 最近のTransition based parsing

Arc-eagerPeople write Java with tears

tears

Stack

Actions

Buffer (Input)

SH Shift: Bufferの先頭をStackに移動LA LeftArc: Bufferの先頭に,Stackの先頭をくっつけるRA RightArc: Stackの先頭に,Bufferの先頭をくっつける.Bufferの先頭をStackに移動RE Reduce: Stackの先頭をとりのぞく

SH LA SH RA RE

People

write

Java

RA

with

RA

Page 40: 最近のTransition based parsing

Arc-standard との違い

‣ Arc-standard は,右も左もボトムアップ‣ Arc-eager は,左はボトムアップ,右はボトムダウン

‣ ボトムダウン:親から子へどんどん繋げていく‣ ボトムアップ:子が全て出来てから,親に繋げる

with tears

Stack Buffer (Input)

SH LA SH

People

write

RA

Java

RE RA?

Page 41: 最近のTransition based parsing

Arc-standard との違い

‣ Arc-standard は,右も左もボトムアップ‣ Arc-eager は,左はボトムアップ,右はボトムダウン

‣ ボトムダウン:親から子へどんどん繋げていく‣ ボトムアップ:子が全て出来てから,親に繋げる

tears

Stack Buffer (Input)

SH LA SH RA RE

People

write

Java

RA

with

Page 42: 最近のTransition based parsing

その他:構造上の違い

with tears

SH SH L

People

write

SH

Java

?

ここでの問題は,“with tears” がwrite か Java のどちらに係るか⇒ Arc-standard は,この時点で その決断を行う必要がある

Arc-standard

with tears

SH SH L

People

write

SHJava

R

Right-reduce Shift

tears

SH SH LPeople

write

SH

Java

SH

with

このリンクは作れない このリンクは作れない

ここが確定してしまう

Page 43: 最近のTransition based parsing

その他:構造上の違い

‣ Zhang and Nivre (2011) : Arc-eager + 豊富な素性で State-of-the-art

with tears

People

write Java ここでの問題は,“with tears” がwrite か Java のどちらに係るか⇒ Arc-eager では,write → Java をつくった後で決められる⇒ 得られた構造を素性に組み込める

Arc-eager

SH LA SH RA

S0S0h w

素性関数

11

・・・

S0 Java w with

S0h write w with

Buffer の先頭の head と次の単語との関係Arc-standard では利用不可能

Page 44: 最近のTransition based parsing

Transition-based の問題点:局所性

‣ 局所的な分類のみなので,大域的な最適解に辿り着けない‣ 以降はこの解決策をいくつか紹介

I saw Jack and Jill fall

Arc-eager

saw

I

Jack and Jill fallRight-arc or Shift ?

素性関数はここまで見れない,つまり

saw

I

Jack and Jill

と同じに見えてしまう

Shift が正解

Right-arc が正解

Page 45: 最近のTransition based parsing

Beam search

‣ これまでの手法は,一つの解のみを保持‣ 分類器のスコア合計の k-best の候補を保持する- k に比例して計算量は増える- 正解が k-best から漏れなければ,たどり着く可能性がある‣ DP を組み合わせてより効率的に k-best を持つと性能向上 (Huang and Sagae ’10)

Zhang and Clark (2008)

SH LA SH

SH LA RA

O(kn)

SH RA SH

SH SH RA

saw

I

Jack

saw

I

Jack

RA

SH

RA

LA

10,000

8,500

8,200

5,000

RA

RA

12,000

9,900

LAsaw

IJack

fall

and Jill

saw

I Jack fall

and Jill

RA

3,4000

3,2000

Page 46: 最近のTransition based parsing

Dynamic oracle

‣ 訓練方法を工夫する‣ これまでの訓練方法- 正解の係り受け木から,対応する Shift-reduce のアクションを取り出す- これまでの解析が全て合っている,という前提の訓練事例しか作れない

Goldberg and Nivre (2012)

訓練文書In an Oct. 19 review of ...

SH SH SH RA LA LA RA …

変換するためのルールが存在buffer の先頭と次の単語にリンクがあればRA or LAを行う,など

RA

In an Oct. 19 review of

訓練の仕方

SH SH

SH SH SH RA LA LA RA …正解:

予測:

1. 現在のパラメータで分類2. 間違えた場合,パラメータの更新

3. 予測を正解に修正し,次の語を処理

Page 47: 最近のTransition based parsing

Dynamic oracle

‣ 訓練方法を工夫する‣ これまでの訓練方法- 正解の係り受け木から,対応する Shift-reduce のアクションを取り出す- これまでの解析が全て合っている,という前提の訓練事例しか作れない

Goldberg and Nivre (2012)

訓練文書In an Oct. 19 review of ...

SH SH SH RA LA LA RA …

変換するためのルールが存在buffer の先頭と次の単語にリンクがあればRA or LAを行う,など

In an

訓練の仕方

1. 現在のパラメータで分類

SH SH RA

SH SH SH RA LA LA RA …正解:

予測:

2. 間違えた場合,パラメータの更新

3. 予測を正解に修正し,次の語を処理

Oct. 19 review of

SH

Page 48: 最近のTransition based parsing

SH

Dynamic oracle

‣ 訓練方法を工夫する‣ これまでの訓練方法- 正解の係り受け木から,対応する Shift-reduce のアクションを取り出す- これまでの解析が全て合っている,という前提の訓練事例しか作れない

Goldberg and Nivre (2012)

訓練文書In an Oct. 19 review of ...

SH SH SH RA LA LA RA …

変換するためのルールが存在buffer の先頭と次の単語にリンクがあればRA or LAを行う,など

In an

訓練の仕方

1. 現在のパラメータで分類

SH SH

SH SH SH RA LA LA RA …正解:

予測:

2. 間違えた場合,パラメータの更新

3. 予測を正解に修正し,次の語を処理

19 review ofOct.

Page 49: 最近のTransition based parsing

Dynamic oracle

‣ 訓練方法を工夫する‣ これまでの訓練方法- 正解の係り受け木から,対応する Shift-reduce のアクションを取り出す- これまでの解析が全て合っている,という前提の訓練事例しか作れない‣ 実際にはデコード中に間違えてしまう- 途中で間違えた場合,そのエラーをなるべく伝搬させたくない- 間違えることも想定して,訓練事例を動的に生成- Searn (Daumé ’06) などと似た考え方

Goldberg and Nivre (2012)

“Jubatus” is a processing platform for analyzing ...

is

“Jubatus”

processing

a

platform ...

間違えた!けど訓練中にこんな状況になってないので,今後の最適解か分からない…

Page 50: 最近のTransition based parsing

Dynamic oracle

‣ 基本的なアイデア- 訓練データに対する分類の正解 (SH, RA, LA, RE) を,現在の予測器の状態に応じて動的に変えたい

‣ 学習アルゴリズム

Goldberg and Nivre (2012)

Algorithm 3 Online training with a dynamic oracle1: w 02: for I = 1! ITERATIONS do3: for sentence x with gold tree Ggold in corpus do4: c cs(x)5: while c is not terminal do6: tp arg maxt w ·!(c, t)7: ZERO_COST {t|o(t; c, Ggold) = true}8: to argmaxt2ZERO_COST w ·!(c, t)9: if tp 62 ZERO_COST then

10: w w+ !(c, to)� !(c, tp)11: tn CHOOSE_NEXT(I ,tp,ZERO_COST)12: c tn(c)13: return w

1: function CHOOSE_NEXTAMB(I ,t,ZERO_COST)2: if t 2 ZERO_COST then3: return t4: else5: return RANDOM_ELEMENT(ZERO_COST)

1: function CHOOSE_NEXTEXP(I ,t,ZERO_COST)2: if I > k and RAND() > p then3: return t4: else5: return CHOOSE_NEXTAMB(I ,t,ZERO_COST)

and non-optimal transitions (Algorithm 3 with CHOOSE_NEXTEXP). We evaluate the models on awide range of English data sets, as well as the data sets from the CoNLL 2007 shared task onmultilingual dependency parsing (Nivre et al., 2007).

The parser is a greedy transition-based parser using the arc-eager transition system of Nivre(2003, 2008) with the feature representations defined by Zhang and Nivre (2011). As ourprimary goal is to compare the training methods, and not to achieve the highest possiblescore for each data set, we use the exact same feature representations and training parametersacross all experiments. Specifically, we train an averaged perceptron model for 15 iterations.When using CHOOSE_NEXTEXP, we set k = 2 and p = 0.1, meaning that the algorithm allowsnon-optimal transitions in 90% of the cases, starting from the third training iteration. Note thatmany of these transitions will nevertheless be correct, as the first training iterations already putthe model in a good region of the parameter space.

The English model is trained on Sections 2–21 of the Penn-WSJ Treebank (Marcus et al., 1993),converted to Stanford basic dependencies (de Marneffe et al., 2006), with part-of-speechtags assigned by a structured-perceptron tagger trained on the same corpus with 4-fold jack-knifing. We use Section 22 to tune parameters, and we evaluate on the following data sets,which are also converted to the same dependency scheme, and pos-tagged using the same

968

Shift-reduce の初期状態

現在の分類器で予測

それまでの遷移から,今後loss が増えない遷移の仕方を動的に探す⇒ 以外と簡単に探せる

実際の遷移を行う間違えた場合も(わざと)たまにそちらを選ぶ

Page 51: 最近のTransition based parsing

Non-monotonic

‣ これまでの遷移は monotonic- 一度決めた係り関係は,途中で変化しない- これによるエラー伝搬を防ぐため,beam-search などを導入した

‣ Non-monotonic な遷移を可能にする- 途中で行った遷移を,後から “修正する” という動作を加える- その時点では情報が少なくて間違えても,後から適宜修正する

Honnibal, Goldberg and Johnson (2013, CoNLL)

Page 52: 最近のTransition based parsing

Non-monotonic Left-arcHonnibal, Goldberg and Johnson (2013, CoNLL)

I saw Jack and Jill fall

saw

I

Jack and Jill fallさきほど取り扱った例正解は SH だが…

分類器からは見えない

SH LA SH ?

Page 53: 最近のTransition based parsing

Non-monotonic Left-arcHonnibal, Goldberg and Johnson (2013, CoNLL)

I saw Jack and Jill fall

saw

I

Jack and Jill fallさきほど取り扱った例正解は SH だが…RA を選択分類器からは見えない

SH LA SH RA

Page 54: 最近のTransition based parsing

Non-monotonic Left-arcHonnibal, Goldberg and Johnson (2013, CoNLL)

I saw Jack and Jill fall

saw

I

and Jill fallさきほど取り扱った例正解は SH だが…RA を選択

SH LA SH RA

Jack

Page 55: 最近のTransition based parsing

Non-monotonic Left-arcHonnibal, Goldberg and Johnson (2013, CoNLL)

I saw Jack and Jill fall

fallさきほど取り扱った例正解は SH だが…RA を選択

SH LA SH RA RA RE RA RE

saw

I

Jack

and Jill この部分は正解と一致する

LA

Page 56: 最近のTransition based parsing

Non-monotonic Left-arc

‣ 一度間違えて作った係り関係を,後で修正する‣ Reduce に対しても,似たような動作を定義できる

‣ 難しい部分を,後から修正することで先延ばしにする‣ 後半のほうが,これまで作った部分木から豊富な素性を抽出できる

Honnibal, Goldberg and Johnson (2013, CoNLL)

I saw Jack and Jill fall

fallさきほど取り扱った例正解は SH だが…RA を選択

SH LA SH RA RA RE RA RE

saw

I

LA

Jack

and Jill

Page 57: 最近のTransition based parsing

Non-monotonic Oracle の作り方

‣ Dynamic oracle (Goldberg and Nivre 2012) を用いる

‣ Non-monotonic は,途中で発生した間違いをうまく修正することが売り‣ そのような間違いが訓練中に発生しないと意味がない

‣ ZERO_COST のアクションの探索方法を,今回のシステムに拡張する

Honnibal, Goldberg and Johnson (2013, CoNLL)

Page 58: 最近のTransition based parsing

Dynamic transition

‣ “with tears” は,write にかかるか,Java にかかるか- write にかかる ⇒ SH

- Java にかかる ⇒ RA- with tears という部分木はできていない状態で決めないといけない

‣ 本質的に難しい部分は後伸ばしにしたい- Non-monotonic とモチベーションは同じ- 探索範囲を広げるように,スタックの状態を変更する

with tears

People

write Java

SH LA SH RA

Sartorio, Satta and Nivre (2013, ACL)Arc-eager

Page 59: 最近のTransition based parsing

Dynamic transitionSartorio, Satta and Nivre (2013, ACL)

People write Java with tears

People write Java with tears

Stack

Actions

Buffer (Input)

SH ShiftLA(k) LeftArc(k)RA(k) RightArc(k)

SH

Page 60: 最近のTransition based parsing

Dynamic transitionSartorio, Satta and Nivre (2013, ACL)

People write Java with tears

write Java with tears

Stack

Actions

Buffer (Input)

SH ShiftLA(k) LeftArc(k)RA(k) RightArc(k)

SH

People

SH

Page 61: 最近のTransition based parsing

Dynamic transitionSartorio, Satta and Nivre (2013, ACL)

People write Java with tears

Java with tears

Stack

Actions

Buffer (Input)

SH ShiftLA(k) LeftArc(k)RA(k) RightArc(k)

SH

People

SH

write

LA(0)

Page 62: 最近のTransition based parsing

Dynamic transitionSartorio, Satta and Nivre (2013, ACL)

People write Java with tears

Java with tears

Stack

Actions

Buffer (Input)

SH ShiftLA(k) LeftArc(k)RA(k) RightArc(k)

SH

People

SH LA(0)

write

SH

Page 63: 最近のTransition based parsing

Dynamic transitionSartorio, Satta and Nivre (2013, ACL)

People write Java with tears

with tears

Stack

Actions

Buffer (Input)

SH ShiftLA(k) LeftArc(k)RA(k) RightArc(k)

SH SH LA(0)

People

write

SH

Java

RA(0)

Page 64: 最近のTransition based parsing

Dynamic transitionSartorio, Satta and Nivre (2013, ACL)

People write Java with tears

with tears

Stack

Actions

Buffer (Input)

SH ShiftLA(k) LeftArc(k)RA(k) RightArc(k)

SH SH LA(0)

People

write

SH

Java

RA(0) SH

Page 65: 最近のTransition based parsing

Dynamic transitionSartorio, Satta and Nivre (2013, ACL)

People write Java with tears

tears

Stack

Actions

Buffer (Input)

SH ShiftLA(k) LeftArc(k)RA(k) RightArc(k)

SH SH LA(0) SH RA(0)

People

write

Java

SH

with

SH

Page 66: 最近のTransition based parsing

Dynamic transitionSartorio, Satta and Nivre (2013, ACL)

People write Java with tears

tears

Stack

Actions

Buffer (Input)

SH ShiftLA(k) LeftArc(k)RA(k) RightArc(k)

SH SH LA(0) SH RA(0)

People

write

Java

SH

with

SH RA(0)

Page 67: 最近のTransition based parsing

Dynamic transitionSartorio, Satta and Nivre (2013, ACL)

People write Java with tears

tears

Stack

Actions

Buffer (Input)

SH ShiftLA(k) LeftArc(k)RA(k) RightArc(k)

SH SH LA(0) SH RA(0)

People

write

Java

SH

with

SH RA(0)

RA(0)

RA(1)

RA(0)

この部分木から素性を抽出して予測を行える

Page 68: 最近のTransition based parsing

Dynamic transitionSartorio, Satta and Nivre (2013, ACL)

People write Java with tearsStack

Actions

Buffer (Input)

SH ShiftLA(k) LeftArc(k)RA(k) RightArc(k)

SH SH LA(0) SH RA(0)

People

write

Java

SH SH RA(0)tears

with

RA(0)

Page 69: 最近のTransition based parsing

Dynamic transition

‣ 基本的に,単語を stack に移動してから処理をする‣ 処理単位を単語ではなく木とし,木同士をくっつける

‣ 探索範囲が広がる‣ 一つの係り関係に辿り着けるアクションの組み合わせが増える‣ ここでも Dynamic oracle で最適な oracle を訓練時に選択しながら学習

Sartorio, Satta and Nivre (2013, ACL)

Stack StackRA(0)

RA(1)RA(2)

RA(3)

LA(0)

LA(1)LA(2)

LA(3)

Page 70: 最近のTransition based parsing

Tree-based model

‣ 基本となる考えは,既存研究あり- 片方のみ dynamic system(RA(k)のみ)

‣ これを左右に一般化したのが本モデル

Kitagawa and Tanaka-Ishii (2010)

He

watched

most probablehead candidate

birdsHe

thewith thehead candidates

across

river

the

birds

wj

telescope

Figure 1: Example of a tournament.

function mphc(ti, tj), and its details are ex-plained in §3.2.

2. Select a transition: Choose a transition,by using an oracle, from among the follow-ing three possibilities (explained in detail in§3.3):

Left-Arc Make wj the head of wi and popti, where ti is at the stack top (denotedas �|ti, with the tail being �), when thebuffer head is tj (denoted as tj |�).

Right-Arc Make the MPHC the head of wj ,and pop the MPHC.

Shift Push the tree tj located at the bufferhead onto the stack top.

These transitions correspond to three possibilitiesfor the relation between ti and tj : (1) a word of tiis a dependent of a word of tj ; (2) a word of tj is adependent of a word of ti; or (3) the two trees arenot related.The formulations of these transitions in the

lower block of Table 1 correspond to Nivre’s tran-sitions of the same name, except that here a tran-sition is applied to a tree. This enhancement fromwords to trees allows removal of both the Reducetransition and certain preconditions.

3.2 Selection of Most Probable HeadCandidate

By usingmphc(ti, tj), a word located far from wj

(the head of tj) can be selected as the head can-didate in ti. This selection process decreases thenumber of errors resulting from greedy decisionconsidering only a few candidates.Various procedures can be considered for im-

plementing mphc(ti, tj). One way is to apply thetournament procedure to the words in ti. The tour-nament procedure was originally introduced forparsing methods in Japanese by (Iwatate et al.,

The biped

was

sold

separately by

robot

his company

ti t j

mphc ),( ji tt

Right-Arc

The biped

was

sold

separately by

robot

his company

ti t j

Figure 2: Example of the transition Right.

2008). Since the Japanese language has the head-final property, the tournament model itself consti-tutes parsing, whereas for parsing a general pro-jective language, the tournament model can onlybe used as part of a parsing algorithm.Figure 1 shows a tournament for the example

of “with,” where the word “watched” finally wins.Although only the words on the left-hand side oftree tj are searched, this does not mean that thetree-based method considers only one side of a de-pendency relation. For example, when we applythe tree-based parsing to Yamada’s method, thesearch problems on both sides are solved.To implement mphc(ti, tj), a binary classifier

is built to judge which of two given words is moreappropriate as the head for another input word.This classifier concerns three words, namely, thetwo words l (left) and r (right) in ti, whose ap-propriateness as the head is compared for the de-pendent wj . All word pairs of l and r in ti arecompared repeatedly in a “tournament,” and thesurvivor is regarded as the MPHC of wj .The classifier is generated through learning of

training examples for all ti and wj pairs, eachof which generates examples comparing the truehead and other (inappropriate) heads in ti. Ta-ble 2 lists the features used in the classifier. Here,lex(X) and pos(X) mean the surface form and partof speech of X , respectively. X left means thedependents of X located on the left-hand side ofX , while Xright means those on the right. Also,Xhead means the head of X . The feature designconcerns three additional words occurring afterwj , as well, denoted as wj+1, wj+2, wj+3.

3.3 Transition Selection

A transition is selected by a three-class classifierafter deciding the MPHC, as explained in §3.1.Table 1 lists the three transitions and one precon-

191

Page 71: 最近のTransition based parsing

性能比較 (WSJ)

‣ Dynamic は Arc-eager の 2.8倍程度遅い(分類問題のクラスが多いから)‣ Non-monotonic はほとんど変わらない

‣ 今回紹介した手法は,state-of-the-art ではなく,完全に一本の探索のみでどこまで性能が出るか,を追求したもの

Arc-standard Nivre ’04 90.02Arc-eager Nivre ’04 90.18beam(8) Zhang and Nivre ’11 92.4beam(64) Zhang and Nivre ’11 92.9

Non-monotonic Honnibal et al. ’13 91.0Dynamic Sartorio et al. ’13 91.3

O(n)

O(n)

O(n)

O(n)

O(kn)

O(kn)

Page 72: 最近のTransition based parsing

まとめ

‣ 係り受け解析に対する3つのアプローチ- Transition-based : (基本)線形時間で処理,しかし局所的な探索- Graph-based : 大域的な探索を行うが,(モデルを複雑にすると)処理が遅い- Hybrid : 色々いいところを組み合わせ.State-of-the-art を目指すならこちら?

‣ Transition-based の枠組みで,どこまで性能を伸ばせるか?- beam search : 有効だが,beam幅に比例した計算がかかる- Dynamic oracle : 訓練例の作り方を工夫.後の研究の基礎に- Non-monotonic : 難しい箇所を後から修正できる- Dynamic system : スタックの構成要素を単語から木にして,探索範囲を広げる

Page 73: 最近のTransition based parsing

おまけ:cognitive plausibility

‣ 人間の文章理解との類似性- 人間は,文を読みながら(話を聞きながら),読み返すことなく文の意味を理解することができる- Transition-based parsing は,単語を一語ずつスタックに入れて処理する

‣ スタック = 人間が文を解釈しているときの記憶状態?‣ 人間の解釈の仕方に近いような transition system ?

‣ Arc-eager は解釈モデルとして妥当ではない,という考えも- Nivre (2004), Demberg et al. (2013) など

‣ Shift-reduce の枠組みは,係り関係を線形に構築する枠組みを提供する- これを通して人間の文の解釈の仕組みが理解できるかも?

Page 74: 最近のTransition based parsing

ご清聴ありがとうございました