23
Distributed Representations of Sentences and Documents DL勉強会 2014/12/01 小町研究室 B4 堺澤 勇也

Distributed Representations of Sentences and Documents

Embed Size (px)

Citation preview

Page 1: Distributed Representations of Sentences and Documents

Distributed Representations of Sentences and Documents

DL勉強会

2014/12/01

小町研究室 B4 堺澤 勇也

Page 2: Distributed Representations of Sentences and Documents

多くの機会学習アルゴリズムは固定長の素性ベクトル表現を要求する

最も一般的なはBOWである(Vocab次元)

簡単で頑健なのでよく使われる

しかし、BOWは二つの問題点がある

語順が失われる

単語の意味を無視する

A is better than B と B is better than A は同じになる

動機

Page 3: Distributed Representations of Sentences and Documents

文・パラグラフ・ドキュメントのような可変長のテキストの一部から固定長の素性表現を学習する教師なし学習アルゴリズム

各ドキュメントを密ベクトルで表現する

提案手法: Paragraph Vector

Page 4: Distributed Representations of Sentences and Documents

Word Vector

PV-DM: A Distributed Memory model

PV-DBOW: Distributed Bag Of Words

Algorithms

提案手法

word2vec

Page 5: Distributed Representations of Sentences and Documents

Learning Vector Representation of Words

コンテキスト中の他の単語が与えられたとき、次にくる単語を予測する

W:文書単語行列

1 – of – V のベクトル →

Page 6: Distributed Representations of Sentences and Documents

学習

下の式が最大になるようにトレーニングされる

この予測タスクは、マルチクラス分類を通して行われるので、softmax関数を使って下の式を得ることが出来る

yは下の式で計算することが出来る

パラメータ b、 UがSGDによって学習されるh はWから抽出された単語ベクトルの連結もしくは平均から構築される

学習には確率的勾配法を使う

Page 7: Distributed Representations of Sentences and Documents

似た意味を持つ単語は、ベクトル空間上で近い位置に置かれ、そうじゃない場合は遠い位置に置かれるようになる

“powerful”と“strong”は近い距離にくる

“powerful”と“Paris”は遠い距離にいる

効果

Page 8: Distributed Representations of Sentences and Documents

PV-DM: A Distributed Memory model

CBOWのように、パラグラフの情報と単語周辺(この図では単語の前のみ)から文脈を推定させて分散表現を学習する

1 – of – V のベクトル →

Page 9: Distributed Representations of Sentences and Documents

sumやaverageではなくconcatenateなので語順が保たれる

BOWでなくなってしまう語順の情報(この論文では繰り返し批判)を持つことを可能にした

図ではaverageのことも書かれているが、この実験ではconcatenateのみ考えている

PV-DVによって作られた分散表現

Page 10: Distributed Representations of Sentences and Documents

PV-DM: A Distributed Memory model

Concatenate のみを扱っている

Page 11: Distributed Representations of Sentences and Documents

Paragraph ID と Paragraph Matrix を使うと。。。

現在のコンテキストから失われた情報を表現できる

Paragraph のトピックを保持出来る

→ memory model

それにより、予測性能がより良くなる

新しい Paragraphが出てきたら、他のパラメーターは固定して学習する

Page 12: Distributed Representations of Sentences and Documents

PV-DBOW: Distributed Bag Of Words

Skip gramのように、パラグラフの情報から文脈中の単語を推定出来るように学習する

Page 13: Distributed Representations of Sentences and Documents

Task: 感情分析

映画のレビュー文章を見て、ポジティブかネガティブかを判定する

Dataset: Stanford sentiment treebank

11855件の映画のレビュー文章が1文づつ与えられる

各文は0.0 (very negative) ~ 1.0 (very positive)の間でラベル付けされている

実験1

Page 14: Distributed Representations of Sentences and Documents

Protocol

PV - DM

PV -DBOW

Logisticregression

400 dim

400 dim

Positiveor

Negative

concatenateWindow = 8

学習データのパラグラフは8544個

Page 15: Distributed Representations of Sentences and Documents

実験結果

BOW or BOn-gram

RNN(構文解析を必要とする手法)

提案手法

提案手法は性能がよく、構文解析なども必要としない!!

Page 16: Distributed Representations of Sentences and Documents

Task: 感情分析

映画のレビュー文章を見て、ポジティブかネガティブかを判定する

Dataset: IMDB

100000件の映画のレビュー文章が複数文で与えられる

各文は negative、positive でラベル付けされている

実験1は入力が1文に対して、実験2は複数文

実験2

Page 17: Distributed Representations of Sentences and Documents

Protocol

PV - DM

PV -DBOW

neuralnetwork

400 dim

400 dim

Positiveor

Negative

concatenateWindow = 10

Logisticregression

間にニューラルネットが挟んである理由→線形ロジスティクス分類より非線形(ニューラルネット)を使った方がいい結果が出たため

NNは隠れ層が50ノードあることは書いてあるがそれ以上については言及されていない

Page 18: Distributed Representations of Sentences and Documents

実験結果

RBM

NBSVM

提案手法

↑PV-DM + PV-DBOW PV-DM only: 7.63%

Page 19: Distributed Representations of Sentences and Documents

Task: 情報検索

同じクエリで与えられた二つのスニペットペアに対して、三つ目のスニペットが同じクエリから与えられたかどうか判別する

Dataset: snippet

検索エンジンで1000000の有名なクエリから与えられる上位10個のsnippet

snippet: 検索エンジンによる検索結果の一部として表示される、Webページの要約文のこと

実験3

Page 20: Distributed Representations of Sentences and Documents

sample

Paragraph 1: calls from ( 000 ) 000 - 0000 . 3913 calls reported from this number .according to 4 re- ports the identity of this caller is american airlines .

Paragraph 2: do you want to find out who called youfrom +1 000 - 000 - 0000 , +1 0000000000 or ( 000 ) 000 - 0000 ?see reports and share information you have about this caller

Paragraph 3: allina health clinic patients for your convenience , you can pay your allina health clinic bill online . pay your clinic bill now , question and answers...

同じクエリ

ランダム

Page 21: Distributed Representations of Sentences and Documents

実験結果

Page 22: Distributed Representations of Sentences and Documents

Expensive ではある

ただ、テストの時には並列処理可能で16 コアで25000段落(平均230単語)が30分だった

学習のときの時間については言及なし

時間コスト

Page 23: Distributed Representations of Sentences and Documents

BOWは語順の情報が失われてしまう

提案手法は語順の情報が保持されるのでBOWより優れてる!!

PV-DMだけでも良い結果得られるけど、PV-DBOWを加えることでより良い結果になった

まとめ