• 検索結果がありません。

Grahamさんの資料 Project MT (Machine Translation) 首都大学東京 自然言語処理研究室(小町研) neubigyoto slides

N/A
N/A
Protected

Academic year: 2018

シェア "Grahamさんの資料 Project MT (Machine Translation) 首都大学東京 自然言語処理研究室(小町研) neubigyoto slides"

Copied!
51
0
0

読み込み中.... (全文を見る)

全文

(1)

1

ニューラルネットに

基づく機械翻訳

Graham Neubig

術大

(NAIST)

(2)

2

I am giving a talk at Kyoto University

(3)

3

F

= “I am giving a talk”

P(

e

1

=

|

F

) = 0.8

P(

e

1

=

|

F

) = 0.03

P(

e

1

=

|

F

) = 0.01

...

P(

e

2

=

|

F

,

e

1

) = 0.9

P(

e

2

=

|

F

,

e

1

) = 0.09

...

P(

e

3

=

|

F

,

e

1,2

) = 0.4 P(

e

3

=

|

F

,

e

1,2

) = 0.3

P(

e

3

=

|

F

,

e

1,2

) = 0.03

...

P(

e

4

=

|

F

,

e

1,3

) = 0.99

...

P(

e

5

=

|F,

e

1,4

) = 0.4

P(

e

5

=

|F,

e

1,4

) = 0.15

...

P(

e

5

=

って

|F,

e

1,4

) = 0.3 P(

e

5

=

って

|F,

e

1,4

) = 0.1

P(

e

6

=

(

)

|F,

e

1,5

) = 0.8

P(

e

6

=

|F,

e

1,5

) = 0.1

...

e

1

=

e

2

=

講演

e

3

=

e

4

=

して

います

e

5

=

(4)

4

つまり、機械翻訳は

として定式化することができる

確率

P

(

E

F

)=

i

=

1

I

+

1

P

(

e

i

F

,

e1

i

1

)

i

= 0

while

e

i

is not equal to “(

)”:

i

← i

+1

e

(5)

5

(6)

6

翻訳モデル・言語モデル

確率

P

(

E

F

)=

i

=

1

I

+

1

P

(

e

i

F

,

e1

i

1

)

言語

確率

P

(

E

)=

i

=

1

I

+

1

P

(

e

i

e

1

i

1

)

P

(

e

i

e

1

i

1

)

(7)

7

P

(

e

i

e

1

i

1

)=

c

(

e

1

i

)

c

(

e

1

i

1

)

講演

</s>

勤め

</s>

</s>

P(

| <s>

) = c(<s>

)/c(<s>

) = 1 / 2 =

0.5

(8)

8

数え上げの問題

頻度の低い現象

に弱い:

講演

</s>

勤め

</s>

</s>

P(

E

=

</s>

) = 0

勤め

</s>

P(

|<s>

勤め

) = 0/1 = 0

(9)

9

2-gram

モデル:

直前の

1

単語のみを利用

P

(

E

)=

i=

1

I

+

1

P

(

e

i

e

i

1

)

3-gram, 4-gram, 5-gram

なども

+

精度が向上

-

メモリ量、スパース性の問題が悪化

勤め

</s>

講演

</s>

勤め

</s>

</s>

(10)

10

対数線形言語モデル

[Chen+ 00]

(1)

より柔軟

な確率計算法

履歴の単語に基づいて全単語の

スコア

s

を計算

s

(

e

i

n

+

1

i

1

)=

b

+

k

=

1

n

1

w

k

,

e

ik

w

2,め先

=

w

1,

=

行う

3.0

2.5

-0.2

0.1

1.2

b

=

-0.2

-0.3

1.0

2.0

0.4

-6.0

-5.1

0.2

0.1

0.6

s =

-3.2

-2.9

1.0

2.2

2.2

(11)

11

確率計算のため、

スコアの指数を取り、正規化

p

(

e

i

=

x

e

i

n

+

1

i

1

)=

e

s

(

e

i

=

x

e

iin1+1

)

~

x

e

s

(

e

i

=~

x

e

in+1

i−1

)

ベクトルに対して行う際

softmax

関数

とも言う

s =

-3.2

-2.9

1.0

2.2

2.2

行う

p

(

e

i

e

i

n

+

1

i

1

)=

softmax

(

s

(

e

i

e

i

n

+

1

i

1

(12)

12

対数線形モデルの学習

確率的勾配降下法

(SGD)

を利用することが多い

学習データの各単語

e

i

に対して

パラメータ

w

をどの方

向に動かしたら正解の確率が良くなりそうかを計算

これを

学習率

α

にかけてパラメータを更新

δ=

d

d

w

p

(

e

i

e

i

n

+

1

i

1

)

(尤度の勾配 )

(13)

13

変数の相互作用をうまく表現できていない

勤め先 は 奈良 →

勤め先 は 同僚 →

勤め先 の 奈良 →

勤め先 の 同僚 →

単純と

足し合わせるだけでは表現不可

。解決策は?

「勤め先

は」などの単語列もパラメータ化:

w

2,1,め先,

=

2.0

-2.1

w

2,1,勤め先,の

=

-1.2

2.9

パラメータ数、メモリの爆発…

(14)

14

(15)

15

e

i-1

e

i-2

1

soft

max

W

1

W

2

b

p

i

e

i-1

e

i-2

は各単語に当たるだけが

1

one-hot

ベクトル

W

1

,

W

2

は重み行列、

b

は重みベクトル

e

i-1

=

{1, 0, 0, 0, 0, ...}

e

i-2

=

{0, 0, 0, 0, 1, ...}

勤め

p

i

=

softmax

(

b

+

k

=

1

n

1

(16)

16

ニューラルネット

e

i-1

e

i-2

1

tanh

W

1

W

2

b

h

i

入力と出力の間に、

非線形関数を計算する隠れ層

を追加

h

i

=

tanh

(

b

+

k

=

1

n

1

W

k

e

i

k

)

soft

max

p

i

W

h

p

i

=

softmax

(

W

h

h

i

)

tanh →

-4 -3 -2 -1 0

1

2

3

4

-1

(17)

17

「特徴量」が学習可能

例:

話者本人が主語の文脈

{

,

,

} {

,

}

両方が成り立てば、隠れ層の1ノード目は正の値

そうでなければ、負の値

数え上げなら、全パターンを覚える必要あり!

W

2

[1]=

W

1

[1]=

b

[1]=-1

-1

-1

1

1

-1

-1

1

1

1

-1

-1

-1

-1

-1

tanh(1)

tanh(-1)

(18)

18

[Nakamura+ 90, Bengio+ 06]

<s> <s> this is a pen </s>

低次元

隠れ層

で出力の類似性を考慮

単語表現

で文脈の類似性を考慮

文脈のすべての単語を直接考慮するため、未知語を

(19)

19

勾配を出力に近い方から逆順に伝搬

e

i-1

e

i-2

1

tanh

W

1

W

2

b

h

i

max

soft

p

i

W

h

δ

p

δ

h

比較し

直接計

(20)

20

(21)

21

ノードの一部の出力が入力として戻ってくる

理由:長距離に渡る依存性の「記憶」が可能

e

i-1

e

i-2

1

tanh

W

1

W

2

b

h

i

max

soft

p

i

W

h

(22)

22

系列モデルとしての

RNN

NET

NET

NET

NET

x

1

x

2

x

3

x

4

(23)

23

[Mikolov+ 10]

<s> <s> this is a pen </s>

以前の単語を「記憶」する

(24)

24

RNN

の勾配計算

NET

NET

NET

NET

x

1

x

2

x

3

x

4

y

1

y

2

y

3

y

4

δ

o,4

まず系列のネット結果全体を計算

後ろ

から

ラーを計算

δ

δ

o,3

δ

δ

o,2

δ

δ

(25)

25

NET

NET

NET

NET

x

1

x

2

x

3

x

4

y

1

y

2

y

3

y

4

δ

o,4

δ

δ

δ

δ

(26)

26

[Hochreiter+ 97]

線形関数を使った隠れ状態+ゲ

ートで勾配をコント

(27)

27

Encoder-Decoder

翻訳モデ

(28)

28

LSTM

ニューラルネット翻訳モデル

[Sutskever+ 14]

this is a pen </s>

これ

</s>

つまり、入力言語で

条件付

けられた言語モデル

P

(

e

1

I

f

1

J

)=

i

=

1

I

+

1

P

(

e

i

f

1

J

, e

1

i

1

)

(29)

29

訳文の

this

</s>

a

is

pen </s>

これ

入力

文をエンコ

ード

単語ずつ

これ

a

r

g

m

a

x

e

i

P

(

e

i

f

1

J

, e

1

i

1

(30)

30

詳細

入力を逆順にする(学習が容易に)

ム探索

モデルのアンサンブ

pen

</s>

is

a

this </s>

これ

(31)
(32)

32

日英における

現実

行会話

11.6

万文で学習

(33)

33

人手で評価し

ても

通用するか?

入力

:

バスタ

から

お湯

があ

てしまいました。

正解

:

the hot water overflowed from the bathtub .

PBMT

the hot water up the bathtub .

EncDec:the bathtub has overflowed .

現実

はい、ある

度は。

入力

:

コー

ーのクリー

入りをくだ

い。

正解

:

i 'll have some coffee with cream , please .

PBMT: cream of coffee , please .

(34)

34

ただし、問題はある

し:

入力

:

どのファンデーションが私の肌の色に近いですか。

正解

:

which foundation comes close to my natural skin color ?

PBMT:

which foundation near my natural skin color ?

EncDec: which foundation is my favorite foundation with a foundation ?

あきらめ:

入力

:

ギブ

けれ

正解

:

you 'll have to have a cast .

PBMT:

i have a

ギブス

.

(35)

35

注意型ニ

ューラルネット

(36)

36

可変長の文を一定のベクトルで表せるか?

yes?

[Sutskever+ 2014]

no?

[Pouget-Abadie+ 2014]

PBMT

(37)

37

[Bahdanau+ 15]

対象の文を

ンコー

(38)

38

現実

日英旅

行対話

11.6

文で学習

(39)

39

従来法との

み合わせ:

(40)

40

リラン

従来のシステ

から結果を出し、ニ

ューラ

ル翻訳のス

コアを

使

いながら

選択

出力

1

出力

2

出力

3

生成

スコア

(41)

41

語→フ

ランス語

(42)

42

おける日

本語を用いた実

BLEU

RIBES

HUMAN

en-ja

Baseline

36.6

79.6

49.8

Reranking

38.2

81.4

62.3

ja-en

Baseline

22.6

72.3

11.8

Reranking

25.4

75.0

35.5

zh-ja

Baseline

40.5

83.4

25.8

Reranking

43.0

84.8

35.8

ja-zh

Baseline

30.1

81.5

2.8

Reranking

31.6

83.3

7.0

ベースラ

ンは

情報

を用いる

テム

すべての言語、

動・人

手評価

で一

して大きな性能

(43)

43

入力:

另外,各国也

行了本国

售的食品的实

态调查

正解:

また,各国

でも

自国で販売し

ている

食品の実態調査が行われた。

Base:

また,各国

自国販売

食品の実態調査を行った。

Re

r

a

nk:

また,各国

でも本

販売さ

れる

食品の実態調査を行った

入力

:

在此,以研究教育

的“

风险

交流”

的实情

提,整

了如

目。

正解

:

ここでは

教育

ける「リスクコ

ュニ

ショ

ン」

のあり方を

検討

するための前

を以下の

目に

けて

理した。

Base:

ここでは

「リスクコ

ュニ

ショ

ン」の

教育

場研究

の実

を前

して

以下の

目について

理した。

Rer

ank:

ここでは

教育

ける「リスクコ

ュニ

ショ

ン」

の実

を前

(44)

44

(45)

45

学習の都合上、出力

えると大変

低頻度

に弱い→

未知語

理で対

[Luong+ 15]

率的な学習法

イズ

推定

(NCE)

[Vaswani+ 13]

学習データの

分割

(46)

46

語・形態論情報

の利用

は言語

構造

はいっ

い未考慮

情報

使

った

系列モデル

[

外山

+15]

情報

を考慮したニューラルネットは利用可?

(47)

47

細かく訳出結果を制御することは不可

(48)

48

参考資料・文

Kevin Duh: Deep Learning for Machine Translation

http://cl.naist.jp/~kevinduh/notes/cwmt14tutorial.pdf

● D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. In Proc. ICLR, 2015.

● Y. Bengio, H. Schwenk, J.-S. Sen ́ecal, F. Morin, and J.-L. Gauvain. Neural probabilistic language models. In Innovations in Machine Learning, 2006.

● S. F. Chen and R. Rosenfeld. A survey of smoothing techniques for me models. Speech and Audio Processing, IEEE Transactions on, 8(1):37–50, Jan 2000.

● S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997.

● S. Jean, K. Cho, R. Memisevic, and Y. Bengio. On using very large target vocabulary for neural machine translation. In Proc. ACL, 2015.

● N. Kalchbrenner and P. Blunsom. Recurrent continuous translation models. In Proc. EMNLP, pages 1700–1709, Seattle, Washington, USA, 2013. Association for Computational Linguistics.

● M.-T. Luong, I. Sutskever, Q. Le, O. Vinyals, and W. Zaremba. Addressing the rare word problem in neural machine translation. In Proc. ACL, 2015.

● T. Luong, R. Socher, and C. Manning. Better word representations with recursive neural networks for morphology. pages 104–113, 2013.

● T. Mikolov, M. Karafi ́at, L. Burget, J. Cernocky`, and S. Khudanpur. Recurrent neural network based language model. In Proc. InterSpeech, pages 1045–1048, 2010.

● M. Nakamura, K. Maruyama, T. Kawabata, and K. Shikano. Neural network approach to word category prediction for English texts. In Proc. COLING, 1990.

● R. Socher, C. C. Lin, C. Manning, and A. Y. Ng. Parsing natural scenes and natural language with recursive neural networks. pages 129–136, 2011.

● I. Sutskever, O. Vinyals, and Q. V. Le. Sequence to sequence learning with neural networks. In Proc. NIPS, pages 3104–3112, 2014.

(49)

49

(50)

50

NN

に関する考え方

(1980

年代ごろ

)

生理学的解釈を重視

(51)

51

h

t-1

x

t

1

tanh

w

r,h

w

r,x

b

r

h

t

tanh

x

t+1

1

w

r,h

w

r,x

b

r

h

t+1

softmax

w

o,h

b

o

1

p

t

softmax

b

o

1

w

o,h

p

t+1

参照

関連したドキュメント

These analysis methods are applied to pre- dicting cutting error caused by thermal expansion and compression in machine tools.. The input variables are reduced from 32 points to

「心理学基礎研究の地域貢献を考える」が開かれた。フォー

東京大学 大学院情報理工学系研究科 数理情報学専攻. hirai@mist.i.u-tokyo.ac.jp

Supersingular abelian varieties and curves, and their moduli spaces 11:10 – 12:10 Tomoyoshi Ibukiyama (Osaka University).. Supersingular loci of low dimensions and parahoric subgroups

3 Numerical simulation for the mteraction analysis between fluid and

In the present paper, the methods of independent component analysis ICA and principal component analysis PCA are integrated into BP neural network for forecasting financial time

Mochizuki, Topics Surrounding the Combinatorial Anabelian Geometry of Hyperbolic Curves III: Tripods and Tempered Fundamental Groups, RIMS Preprint 1763 (November 2012).

Kambe, Acoustic signals associated with vor- page texline reconnection in oblique collision of two vortex rings.. Matsuno, Interaction of an algebraic soliton with uneven bottom