SlideShare a Scribd company logo
Convolutional Neural Networks
for Sentiment Classification
何云超
yunchaohe@gmail.com
Word Vectors
• CNN中使用词向量的三种方法
• 作为网络参数,在模型训练中学习,随机初始化
• 使用词向量模型 (word2vec, GloVe等) 训练词向量,在模型训练中保持不
变
• 使用词向量模型 (word2vec, GloVe等) 训练词向量,用于网络初始化,在
模型训练中调整
Sentence Matrix
• 矩阵中的每一行或者每一列为一个词向
量
Convolutional Layer
• Wide Convolution
• Narrow Convolution
The red connections all
have the same weight.
s+m-1=7-5+1=3 s+m-1=7+5-1=11
Pooling Layer
• Max pooling: The idea is to capture the most important feature—one
with the highest value—for each feature map.
Dropout: A Simple Way to Prevent Neural
Networks from Overfitting
• Consider a neural net with one hidden layer.
• Each time we present a training example, we
randomly omit each hidden unit with probability
0.5.
• So we are randomly sampling from 2^H different
architectures.
• All architectures share weights.
• Dropout prevents units from co-adapting (共同作用)
too much.
H
Dropout: A Simple Way to Prevent Neural
Networks from Overfitting
CNN for Sentence Classification [1]
• Two channels
• CNN-rand
• CNN-non-static
• CNN-static
• CNN-multichannel
DCNN Overview [2]
• Convolutional Neural
Networks with Dynamic 𝑘-
Max Pooling
• Wide Convolution
• Dynamic 𝑘-Max Pooling
• 𝑙:当前卷积层数
• 𝐿:卷积曾总数
• 𝑠:句子长度
• 𝑘 𝑡𝑜𝑝:最高层卷积层参数
• Dynamic 𝑘-Max Pooling
• 𝑙:当前卷积层数
• 𝐿:卷积曾总数
• 𝑠:句子长度
• 𝑘 𝑡𝑜𝑝:最高层卷积层参数
• 例
• IF, 𝐿 = 3, 𝑠 = 18 𝑘 𝑡𝑜𝑝 = 3
• Then,
1
3 1
max(3, 18 ) max(3,12)=12
3
k
 
   
 
2
3 2
max(3, 18 ) max(3,6)=6
3
k
 
   
 
• Folding
• 问题:
• 卷积操作独立作用于每一行
• 同一行中建立了复杂的依赖
• 全连接层之前,不同行之间相
互独立
• 因此:
• Folding操做将每两行相加
• d行降低为d/2
• 每一行都依赖于下层中的两行
Semantic Clustering [3]
Sentence
Matrix
Semantic
Candidate
Units
Semantic
Units
m=2, 3, …, 句子长度/2
Semantic Cliques
Semantic Clustering
Sentence
Matrix
Semantic
Candidate
Units
Semantic
Units
m=2, 3, …, 句子长度/2
Semantic Cliques
Semantic
cliques
seq-CNN [4]
• 受启发于图像有RGB、CMYK多通道的思想,将句子视为图像,句
子中的单词视为像素,因此一个d维的词向量可以看成一个有d个
通道的像素
• 例 词汇表
句子
句向量
多通道
. . .
[0 0 0] [0 0 0] [1 0 0 ] [0 0 1] [0 1 0]
Enrich word vectors
• 使用了字符级的向量 (character-level embeddings),将词向量和字
符向量的合并在一起作为其向量表示。 [5]
• 使用传统的文本特征来扩展词向量,主要包括:大写单词数量、
表情符号、拉长的单词 (Elongated Units)、情感词数量、否定词、
标点符号、clusters、n-grams。[6]
MVCNN: Multichannel
Variable-Size Convolution [7]
• 不同word embeddings所含有的单
词不一样
• HLBL
• Huang
• GloVe
• SENNA
• Word2vec
• 对某些unknown words的处理
• Randomly initialized
• Projection: (mutual learning)
𝑎𝑟𝑔𝑚𝑖𝑛||𝑤𝑗 − 𝑤𝑗||2
MVCNN:Training
• Pretraining
• Unsupervised training
• Average of context word vectors as a
predicted representation of the
middle word
• To produce good initial values
• Training
• Logistic regression
References
[1] Kim, Y. (n.d.). Convolutional Neural Networks for Sentence Classification. Proceedings of the 2014 Conference on
Empirical Methods in Natural Language Processing (EMNLP).
[2] Kalchbrenner, N., Grefenstette, E., & Blunsom, P. (n.d.). A Convolutional Neural Network for Modelling Sentences.
Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers).
[3] Wang, P., Xu, J., Xu, B., Liu, C. L., Zhang, H., Wang, F., & Hao, H. (2015). Semantic Clustering and Convolutional
Neural Network for Short Text Categorization. In Proceedings of the 53rd Annual Meeting of the Association for
Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Vol. 2, pp. 352-
357).
[4] Johnson, R., & Zhang, T. (n.d.). Effective Use of Word Order for Text Categorization with Convolutional Neural
Networks. Proceedings of the 2015 Conference of the North American Chapter of the Association for Computational
Linguistics: Human Language Technologies.
[5] dos Santos, C. N., & Gatti, M. (2014). Deep convolutional neural networks for sentiment analysis of short texts. In
Proceedings of the 25th International Conference on Computational Linguistics (COLING), Dublin, Ireland.
[6] Tang, D., Wei, F., Qin, B., Liu, T., & Zhou, M. (2014, August). Coooolll: A deep learning system for twitter sentiment
classification. In Proceedings of the 8th International Workshop on Semantic Evaluation (SemEval 2014) (pp. 208-212).
[7] Wenpeng Yin, Hinrich Schütze. Multichannel Variable-Size Convolution for Sentence Classification. The 19th SIGNLL
Conference on Computational Natural Language Learning (CoNLL'2015, long paper). July 30-31, Peking, China.
谢谢聆听
Q&A
何云超 yunchaohe@gmail.com

More Related Content

PDF
Recurrent Convolutional Neural Networks for Text Classification
PPTX
Dcnn for text
PDF
(Deep) Neural Networks在 NLP 和 Text Mining 总结
PPTX
Scalable image recognition model with deep embedding
PPTX
Text Mining for Lexicography
PDF
Deep Learning for NLP Applications
PDF
Deep Learning for NLP: An Introduction to Neural Word Embeddings
PDF
Learning to understand phrases by embedding the dictionary
Recurrent Convolutional Neural Networks for Text Classification
Dcnn for text
(Deep) Neural Networks在 NLP 和 Text Mining 总结
Scalable image recognition model with deep embedding
Text Mining for Lexicography
Deep Learning for NLP Applications
Deep Learning for NLP: An Introduction to Neural Word Embeddings
Learning to understand phrases by embedding the dictionary

What's hot (20)

PDF
Deep Learning for Natural Language Processing: Word Embeddings
PPTX
What is word2vec?
PDF
Deep Learning for Information Retrieval
PDF
End-to-end Speech Recognition with Recurrent Neural Networks (D3L6 Deep Learn...
PDF
AINL 2016: Filchenkov
PDF
Deep Learning Architectures for NLP (Hungarian NLP Meetup 2016-09-07)
PDF
Deep learning for nlp
PDF
Zero shot learning through cross-modal transfer
PPTX
Using Text Embeddings for Information Retrieval
PDF
Anthiil Inside workshop on NLP
PDF
BIng NLP Expert - Dl summer-school-2017.-jianfeng-gao.v2
PPTX
Vectorland: Brief Notes from Using Text Embeddings for Search
PDF
Ted Willke - The Brain’s Guide to Dealing with Context in Language Understanding
PDF
Deep Learning & NLP: Graphs to the Rescue!
PDF
Information Retrieval with Deep Learning
PDF
Deep Learning for NLP (without Magic) - Richard Socher and Christopher Manning
PPTX
Deep Learning for Search
PPTX
A Simple Introduction to Word Embeddings
PDF
Engineering Intelligent NLP Applications Using Deep Learning – Part 2
PDF
Visual-Semantic Embeddings: some thoughts on Language
Deep Learning for Natural Language Processing: Word Embeddings
What is word2vec?
Deep Learning for Information Retrieval
End-to-end Speech Recognition with Recurrent Neural Networks (D3L6 Deep Learn...
AINL 2016: Filchenkov
Deep Learning Architectures for NLP (Hungarian NLP Meetup 2016-09-07)
Deep learning for nlp
Zero shot learning through cross-modal transfer
Using Text Embeddings for Information Retrieval
Anthiil Inside workshop on NLP
BIng NLP Expert - Dl summer-school-2017.-jianfeng-gao.v2
Vectorland: Brief Notes from Using Text Embeddings for Search
Ted Willke - The Brain’s Guide to Dealing with Context in Language Understanding
Deep Learning & NLP: Graphs to the Rescue!
Information Retrieval with Deep Learning
Deep Learning for NLP (without Magic) - Richard Socher and Christopher Manning
Deep Learning for Search
A Simple Introduction to Word Embeddings
Engineering Intelligent NLP Applications Using Deep Learning – Part 2
Visual-Semantic Embeddings: some thoughts on Language
Ad

Viewers also liked (20)

PDF
Convolutional Neural Networks (CNN)
PDF
Deep Convolutional Neural Networks - Overview
PDF
101: Convolutional Neural Networks
PPTX
CNN for Text Classification
PPTX
Lecture 29 Convolutional Neural Networks - Computer Vision Spring2015
PPTX
Deep Learning - Convolutional Neural Networks - Architectural Zoo
PDF
connected_issue_49_summer_2013
PPT
SNLI_presentation_2
PDF
ujava.org Deep Learning with Convolutional Neural Network
PPTX
Yunchao he icot2015
PDF
Understanding Convolutional Neural Networks
PDF
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
PDF
Learning Convolutional Neural Networks for Graphs
PPTX
Jeff Johnson, Research Engineer, Facebook at MLconf NYC
PDF
Scene classification using Convolutional Neural Networks - Jayani Withanawasam
PDF
Lukáš Vrábel - Deep Convolutional Neural Networks
PDF
Deep learning for music classification, 2016-05-24
PDF
Automatic Tagging using Deep Convolutional Neural Networks - ISMIR 2016
PPTX
Introduction to CNN
PDF
CNNs: from the Basics to Recent Advances
Convolutional Neural Networks (CNN)
Deep Convolutional Neural Networks - Overview
101: Convolutional Neural Networks
CNN for Text Classification
Lecture 29 Convolutional Neural Networks - Computer Vision Spring2015
Deep Learning - Convolutional Neural Networks - Architectural Zoo
connected_issue_49_summer_2013
SNLI_presentation_2
ujava.org Deep Learning with Convolutional Neural Network
Yunchao he icot2015
Understanding Convolutional Neural Networks
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
Learning Convolutional Neural Networks for Graphs
Jeff Johnson, Research Engineer, Facebook at MLconf NYC
Scene classification using Convolutional Neural Networks - Jayani Withanawasam
Lukáš Vrábel - Deep Convolutional Neural Networks
Deep learning for music classification, 2016-05-24
Automatic Tagging using Deep Convolutional Neural Networks - ISMIR 2016
Introduction to CNN
CNNs: from the Basics to Recent Advances
Ad

Similar to Convolutional neural networks for sentiment classification (20)

PPTX
Deep Neural Methods for Retrieval
PDF
AINL 2016: Nikolenko
PPTX
Advanced_NLP_with_Transformers_PPT_final 50.pptx
PDF
IRJET- Survey on Deep Learning Approaches for Phrase Structure Identification...
PPTX
Word embedding
PPTX
Natural Language Processing Advancements By Deep Learning: A Survey
PDF
Phrase Structure Identification and Classification of Sentences using Deep Le...
PDF
THE ABILITY OF WORD EMBEDDINGS TO CAPTURE WORD SIMILARITIES
PDF
THE ABILITY OF WORD EMBEDDINGS TO CAPTURE WORD SIMILARITIES
PDF
Survey on Text Prediction Techniques
PPTX
wordembedding.pptx
PPTX
NLP Introduction and basics of natural language processing
PDF
Suggestion Generation for Specific Erroneous Part in a Sentence using Deep Le...
PDF
LSTM Based Sentiment Analysis
PDF
A survey on phrase structure learning methods for text classification
PDF
is2015_poster
PPTX
Talk from NVidia Developer Connect
ODP
Tensorflow
PPTX
Networking lesson 4 chaoter 1 Module 4-1.pptx
Deep Neural Methods for Retrieval
AINL 2016: Nikolenko
Advanced_NLP_with_Transformers_PPT_final 50.pptx
IRJET- Survey on Deep Learning Approaches for Phrase Structure Identification...
Word embedding
Natural Language Processing Advancements By Deep Learning: A Survey
Phrase Structure Identification and Classification of Sentences using Deep Le...
THE ABILITY OF WORD EMBEDDINGS TO CAPTURE WORD SIMILARITIES
THE ABILITY OF WORD EMBEDDINGS TO CAPTURE WORD SIMILARITIES
Survey on Text Prediction Techniques
wordembedding.pptx
NLP Introduction and basics of natural language processing
Suggestion Generation for Specific Erroneous Part in a Sentence using Deep Le...
LSTM Based Sentiment Analysis
A survey on phrase structure learning methods for text classification
is2015_poster
Talk from NVidia Developer Connect
Tensorflow
Networking lesson 4 chaoter 1 Module 4-1.pptx

Recently uploaded (20)

PPTX
Computer network topology notes for revision
PPTX
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
PDF
Introduction to Data Science and Data Analysis
PPT
Miokarditis (Inflamasi pada Otot Jantung)
PPTX
STERILIZATION AND DISINFECTION-1.ppthhhbx
PPTX
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
PPTX
IBA_Chapter_11_Slides_Final_Accessible.pptx
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
PDF
Fluorescence-microscope_Botany_detailed content
PDF
Mega Projects Data Mega Projects Data
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PDF
Business Analytics and business intelligence.pdf
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
PPTX
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
PPT
ISS -ESG Data flows What is ESG and HowHow
PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PPT
Reliability_Chapter_ presentation 1221.5784
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PDF
annual-report-2024-2025 original latest.
PPTX
Introduction-to-Cloud-ComputingFinal.pptx
Computer network topology notes for revision
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
Introduction to Data Science and Data Analysis
Miokarditis (Inflamasi pada Otot Jantung)
STERILIZATION AND DISINFECTION-1.ppthhhbx
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
IBA_Chapter_11_Slides_Final_Accessible.pptx
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
Fluorescence-microscope_Botany_detailed content
Mega Projects Data Mega Projects Data
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
Business Analytics and business intelligence.pdf
STUDY DESIGN details- Lt Col Maksud (21).pptx
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
ISS -ESG Data flows What is ESG and HowHow
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
Reliability_Chapter_ presentation 1221.5784
Acceptance and paychological effects of mandatory extra coach I classes.pptx
annual-report-2024-2025 original latest.
Introduction-to-Cloud-ComputingFinal.pptx

Convolutional neural networks for sentiment classification

  • 1. Convolutional Neural Networks for Sentiment Classification 何云超 yunchaohe@gmail.com
  • 2. Word Vectors • CNN中使用词向量的三种方法 • 作为网络参数,在模型训练中学习,随机初始化 • 使用词向量模型 (word2vec, GloVe等) 训练词向量,在模型训练中保持不 变 • 使用词向量模型 (word2vec, GloVe等) 训练词向量,用于网络初始化,在 模型训练中调整
  • 4. Convolutional Layer • Wide Convolution • Narrow Convolution The red connections all have the same weight. s+m-1=7-5+1=3 s+m-1=7+5-1=11
  • 5. Pooling Layer • Max pooling: The idea is to capture the most important feature—one with the highest value—for each feature map.
  • 6. Dropout: A Simple Way to Prevent Neural Networks from Overfitting • Consider a neural net with one hidden layer. • Each time we present a training example, we randomly omit each hidden unit with probability 0.5. • So we are randomly sampling from 2^H different architectures. • All architectures share weights. • Dropout prevents units from co-adapting (共同作用) too much. H
  • 7. Dropout: A Simple Way to Prevent Neural Networks from Overfitting
  • 8. CNN for Sentence Classification [1] • Two channels • CNN-rand • CNN-non-static • CNN-static • CNN-multichannel
  • 9. DCNN Overview [2] • Convolutional Neural Networks with Dynamic 𝑘- Max Pooling • Wide Convolution • Dynamic 𝑘-Max Pooling • 𝑙:当前卷积层数 • 𝐿:卷积曾总数 • 𝑠:句子长度 • 𝑘 𝑡𝑜𝑝:最高层卷积层参数
  • 10. • Dynamic 𝑘-Max Pooling • 𝑙:当前卷积层数 • 𝐿:卷积曾总数 • 𝑠:句子长度 • 𝑘 𝑡𝑜𝑝:最高层卷积层参数 • 例 • IF, 𝐿 = 3, 𝑠 = 18 𝑘 𝑡𝑜𝑝 = 3 • Then, 1 3 1 max(3, 18 ) max(3,12)=12 3 k         2 3 2 max(3, 18 ) max(3,6)=6 3 k        
  • 11. • Folding • 问题: • 卷积操作独立作用于每一行 • 同一行中建立了复杂的依赖 • 全连接层之前,不同行之间相 互独立 • 因此: • Folding操做将每两行相加 • d行降低为d/2 • 每一行都依赖于下层中的两行
  • 13. Semantic Clustering Sentence Matrix Semantic Candidate Units Semantic Units m=2, 3, …, 句子长度/2 Semantic Cliques Semantic cliques
  • 15. Enrich word vectors • 使用了字符级的向量 (character-level embeddings),将词向量和字 符向量的合并在一起作为其向量表示。 [5] • 使用传统的文本特征来扩展词向量,主要包括:大写单词数量、 表情符号、拉长的单词 (Elongated Units)、情感词数量、否定词、 标点符号、clusters、n-grams。[6]
  • 16. MVCNN: Multichannel Variable-Size Convolution [7] • 不同word embeddings所含有的单 词不一样 • HLBL • Huang • GloVe • SENNA • Word2vec • 对某些unknown words的处理 • Randomly initialized • Projection: (mutual learning) 𝑎𝑟𝑔𝑚𝑖𝑛||𝑤𝑗 − 𝑤𝑗||2
  • 17. MVCNN:Training • Pretraining • Unsupervised training • Average of context word vectors as a predicted representation of the middle word • To produce good initial values • Training • Logistic regression
  • 18. References [1] Kim, Y. (n.d.). Convolutional Neural Networks for Sentence Classification. Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP). [2] Kalchbrenner, N., Grefenstette, E., & Blunsom, P. (n.d.). A Convolutional Neural Network for Modelling Sentences. Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). [3] Wang, P., Xu, J., Xu, B., Liu, C. L., Zhang, H., Wang, F., & Hao, H. (2015). Semantic Clustering and Convolutional Neural Network for Short Text Categorization. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Vol. 2, pp. 352- 357). [4] Johnson, R., & Zhang, T. (n.d.). Effective Use of Word Order for Text Categorization with Convolutional Neural Networks. Proceedings of the 2015 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. [5] dos Santos, C. N., & Gatti, M. (2014). Deep convolutional neural networks for sentiment analysis of short texts. In Proceedings of the 25th International Conference on Computational Linguistics (COLING), Dublin, Ireland. [6] Tang, D., Wei, F., Qin, B., Liu, T., & Zhou, M. (2014, August). Coooolll: A deep learning system for twitter sentiment classification. In Proceedings of the 8th International Workshop on Semantic Evaluation (SemEval 2014) (pp. 208-212). [7] Wenpeng Yin, Hinrich Schütze. Multichannel Variable-Size Convolution for Sentence Classification. The 19th SIGNLL Conference on Computational Natural Language Learning (CoNLL'2015, long paper). July 30-31, Peking, China.