SlideShare a Scribd company logo
Distributed Representations of 
Sentences and Documents 
DL勉強会 
2014/12/01 
小町研究室B4 堺澤勇也
動機 
 多くの機会学習アルゴリズムは固定長の素性ベク 
トル表現を要求する 
 最も一般的なはBOWである(Vocab次元) 
 簡単で頑健なのでよく使われる 
 しかし、BOWは二つの問題点がある 
 語順が失われる 
 単語の意味を無視する 
 A is better than B とB is better than A は同じになる
提案手法: Paragraph Vector 
 文・パラグラフ・ドキュメントのような可変長の 
テキストの一部から固定長の素性表現を学習する 
教師なし学習アルゴリズム 
 各ドキュメントを密ベクトルで表現する
 Word Vector 
Algorithms 
 PV-DM: A Distributed Memory model 
 PV-DBOW: Distributed Bag Of Words 
提案手法 
word2vec
Learning Vector Representation of Words 
W:文書単語行列 
コンテキスト中の他の単語が与えられたとき、次にくる単語を予測1 – of – V のベクトル→
学習 
下の式が最大になるようにトレーニングされる 
この予測タスクは、マルチクラス分類を通して行われるので、 
softmax関数を使って下の式を得ることが出来る 
yは下の式で計算することが出来る 
パラメータb、U がSGDによって学習される 
h はWから抽出された単語ベクトルの連結もしくは平均から構築される 
学習には確率的勾配法を使う
効果 
 似た意味を持つ単語は、ベクトル空間上で近い位 
置に置かれ、そうじゃない場合は遠い位置に置か 
れるようになる 
 “powerful”と“strong”は近い距離にくる 
 “powerful”と“Paris”は遠い距離にいる
PV-DM: A Distributed Memory model 
1 – of – V のベクトル→ 
CBOWのように、パラグラフの情報と単語周辺(この図では 
単語の前のみ)から文脈を推定させて分散表現を学習する
PV-DVによって作られた分散表 
現 
 sumやaverageではなくconcatenateなので語順が保 
たれる 
 BOWでなくなってしまう語順の情報(この論文で 
は繰り返し批判)を持つことを可能にした 
 図ではaverageのことも書かれているが、この実験 
ではconcatenateのみ考えている
PV-DM: A Distributed Memory model 
Concatenate のみを扱っている
 Paragraph ID とParagraph Matrix を使うと。。。 
 現在のコンテキストから失われた情報を表現できる 
 Paragraph のトピックを保持出来る 
→ memory model 
 それにより、予測性能がより良くなる 
 新しいParagraphが出てきたら、他のパラメーター 
は固定して学習する
PV-DBOW: Distributed Bag Of Words 
Skip gramのように、パラグラフの情報から文脈中の 
単語を推定出来るように学習する
 Task: 感情分析 
実験1 
 映画のレビュー文章を見て、ポジティブかネガティ 
ブかを判定する 
 Dataset: Stanford sentiment treebank 
 11855件の映画のレビュー文章が1文づつ与えられる 
 各文は0.0 (very negative) ~ 1.0 (very positive)の間でラ 
ベル付けされている
Protocol 
PV - DM 
PV -DBOW 
Logistic 
regression 
400 dim 
400 dim 
Positive 
or 
Negative 
concatenate 
Window = 8 
学習データのパラグラフは8544個
実験結果 
BOW or BOn-gram 
RNN(構文解析を必要とする手法提案手法 
提案手法は性能がよく、構文解析なども必要としない!!
 Task: 感情分析 
実験2 
 映画のレビュー文章を見て、ポジティブかネガティ 
ブかを判定する 
 Dataset: IMDB 
 100000件の映画のレビュー文章が複数文で与えられ 
る 
 各文はnegative、positive でラベル付けされている 
 実験1は入力が1文に対して、実験2は複数文
Protocol 
PV - DM 
PV -DBOW 
neural 
network 
400 dim 
400 dim 
Positive 
or 
Negative 
concatenate 
Window = 10 
Logistic 
regression 
間にニューラルネットが挟んである理由 
→線形ロジスティクス分類より非線形(ニューラルネット)を使った方がいい結果が出NNは隠れ層が50ノードあることは書いてあるがそれ以上については言及されていな
実験結果 
RBM 
NBSVM 
提案手法 
↑PV-DM + PV-DBOW PV-DM only: 7.63%
 Task: 情報検索 
実験3 
 同じクエリで与えられた二つのスニペットペアに対 
して、三つ目のスニペットが同じクエリから与えら 
れたかどうか判別する 
 Dataset: snippet 
 検索エンジンで1000000の有名なクエリから与えられ 
る上位10個のsnippet 
 snippet: 検索エンジンによる検索結果の一部として表 
示される、Webページの要約文のこと
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 you 
from +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... 
同じクエリ 
ランダム
実験結果
時間コスト 
 Expensive ではある 
 ただ、テストの時には並列処理可能で16 コアで 
25000段落(平均230単語)が30分だった 
 学習のときの時間については言及なし
まとめ 
 BOWは語順の情報が失われてしまう 
 提案手法は語順の情報が保持されるのでBOWより 
優れてる!! 
 PV-DMだけでも良い結果得られるけど、PV-DBOW 
を加えることでより良い結果になった

More Related Content

What's hot

日本語テキスト音声合成のための句境界予測モデルの検討
日本語テキスト音声合成のための句境界予測モデルの検討日本語テキスト音声合成のための句境界予測モデルの検討
日本語テキスト音声合成のための句境界予測モデルの検討
Kosuke Futamata
 
読解支援@2015 07-13
読解支援@2015 07-13読解支援@2015 07-13
読解支援@2015 07-13
sekizawayuuki
 
A semantics aware-transformer_model_of_relation_linking_for_knowledge_base_qu...
A semantics aware-transformer_model_of_relation_linking_for_knowledge_base_qu...A semantics aware-transformer_model_of_relation_linking_for_knowledge_base_qu...
A semantics aware-transformer_model_of_relation_linking_for_knowledge_base_qu...
Ace12358
 
ACL読み会@PFI “How to make words with vectors: Phrase generation in distributio...
ACL読み会@PFI “How to make words with vectors: Phrase generation in distributio...ACL読み会@PFI “How to make words with vectors: Phrase generation in distributio...
ACL読み会@PFI “How to make words with vectors: Phrase generation in distributio...
Yuya Unno
 
A semantics aware-transformer_model_of_relation_linking_for_knowledge_base_qu...
A semantics aware-transformer_model_of_relation_linking_for_knowledge_base_qu...A semantics aware-transformer_model_of_relation_linking_for_knowledge_base_qu...
A semantics aware-transformer_model_of_relation_linking_for_knowledge_base_qu...
Ace12358
 
A bayesian approach to multimodal visual dictionary learningの紹介
A bayesian approach to multimodal visual dictionary learningの紹介A bayesian approach to multimodal visual dictionary learningの紹介
A bayesian approach to multimodal visual dictionary learningの紹介
Hitoshi Nishimura
 

What's hot (19)

Learning Composition Models for Phrase Embeddings
Learning Composition Models for Phrase EmbeddingsLearning Composition Models for Phrase Embeddings
Learning Composition Models for Phrase Embeddings
 
日本語テキスト音声合成のための句境界予測モデルの検討
日本語テキスト音声合成のための句境界予測モデルの検討日本語テキスト音声合成のための句境界予測モデルの検討
日本語テキスト音声合成のための句境界予測モデルの検討
 
Acl yomikai, 1016, 20110903
Acl yomikai, 1016,  20110903Acl yomikai, 1016,  20110903
Acl yomikai, 1016, 20110903
 
2016word embbed
2016word embbed2016word embbed
2016word embbed
 
読解支援@2015 07-13
読解支援@2015 07-13読解支援@2015 07-13
読解支援@2015 07-13
 
TensorFlow math ja 05 word2vec
TensorFlow math ja 05 word2vecTensorFlow math ja 05 word2vec
TensorFlow math ja 05 word2vec
 
A semantics aware-transformer_model_of_relation_linking_for_knowledge_base_qu...
A semantics aware-transformer_model_of_relation_linking_for_knowledge_base_qu...A semantics aware-transformer_model_of_relation_linking_for_knowledge_base_qu...
A semantics aware-transformer_model_of_relation_linking_for_knowledge_base_qu...
 
[ACL2018読み会資料] Sharp Nearby, Fuzzy Far Away: How Neural Language Models Use C...
[ACL2018読み会資料] Sharp Nearby, Fuzzy Far Away: How Neural Language Models Use C...[ACL2018読み会資料] Sharp Nearby, Fuzzy Far Away: How Neural Language Models Use C...
[ACL2018読み会資料] Sharp Nearby, Fuzzy Far Away: How Neural Language Models Use C...
 
Hangyo emnlp paperreading2016
Hangyo emnlp paperreading2016Hangyo emnlp paperreading2016
Hangyo emnlp paperreading2016
 
ACL読み会@PFI “How to make words with vectors: Phrase generation in distributio...
ACL読み会@PFI “How to make words with vectors: Phrase generation in distributio...ACL読み会@PFI “How to make words with vectors: Phrase generation in distributio...
ACL読み会@PFI “How to make words with vectors: Phrase generation in distributio...
 
A semantics aware-transformer_model_of_relation_linking_for_knowledge_base_qu...
A semantics aware-transformer_model_of_relation_linking_for_knowledge_base_qu...A semantics aware-transformer_model_of_relation_linking_for_knowledge_base_qu...
A semantics aware-transformer_model_of_relation_linking_for_knowledge_base_qu...
 
Decoupled Neural Interfaces using Synthetic Gradients
Decoupled Neural Interfaces using Synthetic GradientsDecoupled Neural Interfaces using Synthetic Gradients
Decoupled Neural Interfaces using Synthetic Gradients
 
EMNLP 2015 読み会 @ 小町研 "Morphological Analysis for Unsegmented Languages using ...
EMNLP 2015 読み会 @ 小町研 "Morphological Analysis for Unsegmented Languages using ...EMNLP 2015 読み会 @ 小町研 "Morphological Analysis for Unsegmented Languages using ...
EMNLP 2015 読み会 @ 小町研 "Morphological Analysis for Unsegmented Languages using ...
 
CluBERT: A Cluster-Based Approach for Learning Sense Distributions in Multipl...
CluBERT: A Cluster-Based Approach for Learning Sense Distributions in Multipl...CluBERT: A Cluster-Based Approach for Learning Sense Distributions in Multipl...
CluBERT: A Cluster-Based Approach for Learning Sense Distributions in Multipl...
 
A bayesian approach to multimodal visual dictionary learningの紹介
A bayesian approach to multimodal visual dictionary learningの紹介A bayesian approach to multimodal visual dictionary learningの紹介
A bayesian approach to multimodal visual dictionary learningの紹介
 
A Unified Model for Word Sense Representation and Disambiguation
A Unified Model for Word Sense Representation and DisambiguationA Unified Model for Word Sense Representation and Disambiguation
A Unified Model for Word Sense Representation and Disambiguation
 
WSDM2018 読み会 Latent cross making use of context in recurrent recommender syst...
WSDM2018 読み会 Latent cross making use of context in recurrent recommender syst...WSDM2018 読み会 Latent cross making use of context in recurrent recommender syst...
WSDM2018 読み会 Latent cross making use of context in recurrent recommender syst...
 
Sentence-State LSTM for Text Representation
Sentence-State LSTM for Text RepresentationSentence-State LSTM for Text Representation
Sentence-State LSTM for Text Representation
 
Semantic_Matching_AAAI16_論文紹介
Semantic_Matching_AAAI16_論文紹介Semantic_Matching_AAAI16_論文紹介
Semantic_Matching_AAAI16_論文紹介
 

Viewers also liked

word embeddings and applications to machine translation and sentiment analysis
word embeddings and applications to machine translation and sentiment analysisword embeddings and applications to machine translation and sentiment analysis
word embeddings and applications to machine translation and sentiment analysis
Mostapha Benhenda
 
Distributed representation of sentences and documents
Distributed representation of sentences and documentsDistributed representation of sentences and documents
Distributed representation of sentences and documents
Abdullah Khan Zehady
 
Statistical Semantic入門 ~分布仮説からword2vecまで~
Statistical Semantic入門 ~分布仮説からword2vecまで~Statistical Semantic入門 ~分布仮説からword2vecまで~
Statistical Semantic入門 ~分布仮説からword2vecまで~
Yuya Unno
 
Machine Learning From Movie Reviews - Long Form
Machine Learning From Movie Reviews - Long FormMachine Learning From Movie Reviews - Long Form
Machine Learning From Movie Reviews - Long Form
Jennifer Dunne
 
المعارض والمؤتمرات شهر يونيو
المعارض والمؤتمرات شهر يونيوالمعارض والمؤتمرات شهر يونيو
المعارض والمؤتمرات شهر يونيو
Palestinian Business Forum
 

Viewers also liked (20)

Deep learning for natural language embeddings
Deep learning for natural language embeddingsDeep learning for natural language embeddings
Deep learning for natural language embeddings
 
CNN for Sentiment Analysis on Italian Tweets
CNN for Sentiment Analysis on Italian TweetsCNN for Sentiment Analysis on Italian Tweets
CNN for Sentiment Analysis on Italian Tweets
 
word embeddings and applications to machine translation and sentiment analysis
word embeddings and applications to machine translation and sentiment analysisword embeddings and applications to machine translation and sentiment analysis
word embeddings and applications to machine translation and sentiment analysis
 
Distributed representation of sentences and documents
Distributed representation of sentences and documentsDistributed representation of sentences and documents
Distributed representation of sentences and documents
 
Word2vec 4 all
Word2vec 4 allWord2vec 4 all
Word2vec 4 all
 
Practical Sentiment Analysis
Practical Sentiment AnalysisPractical Sentiment Analysis
Practical Sentiment Analysis
 
Can Deep Learning solve the Sentiment Analysis Problem
Can Deep Learning solve the Sentiment Analysis ProblemCan Deep Learning solve the Sentiment Analysis Problem
Can Deep Learning solve the Sentiment Analysis Problem
 
意味表現の学習
意味表現の学習意味表現の学習
意味表現の学習
 
単語・句の分散表現の学習
単語・句の分散表現の学習単語・句の分散表現の学習
単語・句の分散表現の学習
 
Statistical Semantic入門 ~分布仮説からword2vecまで~
Statistical Semantic入門 ~分布仮説からword2vecまで~Statistical Semantic入門 ~分布仮説からword2vecまで~
Statistical Semantic入門 ~分布仮説からword2vecまで~
 
リクルート式 自然言語処理技術の適応事例紹介
リクルート式 自然言語処理技術の適応事例紹介リクルート式 自然言語処理技術の適応事例紹介
リクルート式 自然言語処理技術の適応事例紹介
 
Machine Learning From Movie Reviews - Long Form
Machine Learning From Movie Reviews - Long FormMachine Learning From Movie Reviews - Long Form
Machine Learning From Movie Reviews - Long Form
 
What is word2vec?
What is word2vec?What is word2vec?
What is word2vec?
 
Mt on leadership and its effects on employees performance
Mt on   leadership and its effects on employees performanceMt on   leadership and its effects on employees performance
Mt on leadership and its effects on employees performance
 
المعارض والمؤتمرات شهر يونيو
المعارض والمؤتمرات شهر يونيوالمعارض والمؤتمرات شهر يونيو
المعارض والمؤتمرات شهر يونيو
 
Bebepolis
BebepolisBebepolis
Bebepolis
 
What color do you like
What color do you likeWhat color do you like
What color do you like
 
Convenience platform: Zero Budget Marketing.
Convenience platform: Zero Budget Marketing.Convenience platform: Zero Budget Marketing.
Convenience platform: Zero Budget Marketing.
 
Uso del scr
Uso del scrUso del scr
Uso del scr
 
Cig tm future
Cig tm futureCig tm future
Cig tm future
 

Distributed Representations of Sentences and Documents

  • 1. Distributed Representations of Sentences and Documents DL勉強会 2014/12/01 小町研究室B4 堺澤勇也
  • 2. 動機  多くの機会学習アルゴリズムは固定長の素性ベク トル表現を要求する  最も一般的なはBOWである(Vocab次元)  簡単で頑健なのでよく使われる  しかし、BOWは二つの問題点がある  語順が失われる  単語の意味を無視する  A is better than B とB is better than A は同じになる
  • 3. 提案手法: Paragraph Vector  文・パラグラフ・ドキュメントのような可変長の テキストの一部から固定長の素性表現を学習する 教師なし学習アルゴリズム  各ドキュメントを密ベクトルで表現する
  • 4.  Word Vector Algorithms  PV-DM: A Distributed Memory model  PV-DBOW: Distributed Bag Of Words 提案手法 word2vec
  • 5. Learning Vector Representation of Words W:文書単語行列 コンテキスト中の他の単語が与えられたとき、次にくる単語を予測1 – of – V のベクトル→
  • 6. 学習 下の式が最大になるようにトレーニングされる この予測タスクは、マルチクラス分類を通して行われるので、 softmax関数を使って下の式を得ることが出来る yは下の式で計算することが出来る パラメータb、U がSGDによって学習される h はWから抽出された単語ベクトルの連結もしくは平均から構築される 学習には確率的勾配法を使う
  • 7. 効果  似た意味を持つ単語は、ベクトル空間上で近い位 置に置かれ、そうじゃない場合は遠い位置に置か れるようになる  “powerful”と“strong”は近い距離にくる  “powerful”と“Paris”は遠い距離にいる
  • 8. PV-DM: A Distributed Memory model 1 – of – V のベクトル→ CBOWのように、パラグラフの情報と単語周辺(この図では 単語の前のみ)から文脈を推定させて分散表現を学習する
  • 9. PV-DVによって作られた分散表 現  sumやaverageではなくconcatenateなので語順が保 たれる  BOWでなくなってしまう語順の情報(この論文で は繰り返し批判)を持つことを可能にした  図ではaverageのことも書かれているが、この実験 ではconcatenateのみ考えている
  • 10. PV-DM: A Distributed Memory model Concatenate のみを扱っている
  • 11.  Paragraph ID とParagraph Matrix を使うと。。。  現在のコンテキストから失われた情報を表現できる  Paragraph のトピックを保持出来る → memory model  それにより、予測性能がより良くなる  新しいParagraphが出てきたら、他のパラメーター は固定して学習する
  • 12. PV-DBOW: Distributed Bag Of Words Skip gramのように、パラグラフの情報から文脈中の 単語を推定出来るように学習する
  • 13.  Task: 感情分析 実験1  映画のレビュー文章を見て、ポジティブかネガティ ブかを判定する  Dataset: Stanford sentiment treebank  11855件の映画のレビュー文章が1文づつ与えられる  各文は0.0 (very negative) ~ 1.0 (very positive)の間でラ ベル付けされている
  • 14. Protocol PV - DM PV -DBOW Logistic regression 400 dim 400 dim Positive or Negative concatenate Window = 8 学習データのパラグラフは8544個
  • 15. 実験結果 BOW or BOn-gram RNN(構文解析を必要とする手法提案手法 提案手法は性能がよく、構文解析なども必要としない!!
  • 16.  Task: 感情分析 実験2  映画のレビュー文章を見て、ポジティブかネガティ ブかを判定する  Dataset: IMDB  100000件の映画のレビュー文章が複数文で与えられ る  各文はnegative、positive でラベル付けされている  実験1は入力が1文に対して、実験2は複数文
  • 17. Protocol PV - DM PV -DBOW neural network 400 dim 400 dim Positive or Negative concatenate Window = 10 Logistic regression 間にニューラルネットが挟んである理由 →線形ロジスティクス分類より非線形(ニューラルネット)を使った方がいい結果が出NNは隠れ層が50ノードあることは書いてあるがそれ以上については言及されていな
  • 18. 実験結果 RBM NBSVM 提案手法 ↑PV-DM + PV-DBOW PV-DM only: 7.63%
  • 19.  Task: 情報検索 実験3  同じクエリで与えられた二つのスニペットペアに対 して、三つ目のスニペットが同じクエリから与えら れたかどうか判別する  Dataset: snippet  検索エンジンで1000000の有名なクエリから与えられ る上位10個のsnippet  snippet: 検索エンジンによる検索結果の一部として表 示される、Webページの要約文のこと
  • 20. 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 you from +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... 同じクエリ ランダム
  • 22. 時間コスト  Expensive ではある  ただ、テストの時には並列処理可能で16 コアで 25000段落(平均230単語)が30分だった  学習のときの時間については言及なし
  • 23. まとめ  BOWは語順の情報が失われてしまう  提案手法は語順の情報が保持されるのでBOWより 優れてる!!  PV-DMだけでも良い結果得られるけど、PV-DBOW を加えることでより良い結果になった

Editor's Notes

  1. この論文では、”powerful”と”strong”・”Pairs”は等しく遠いと説明されている 本来なら”powerful”と”strong”は近い距離にいてほしい
  2. Word vector の考えに共感してそれをパラグラフを使って出来るように拡張 これも予測タスクに対して使えるようにしている
  3. Word vector の考えに共感してそれをパラグラフを使って出来るように拡張 これも予測タスクに対して使えるようにしている