楼主: qingxunz
3098 4

Deep Learning for Natural Language Processing by Jason Brownlee [推广有奖]

  • 3关注
  • 2粉丝

已卖:952份资源

学科带头人

37%

还不是VIP/贵宾

-

威望
0
论坛币
2350 个
通用积分
106.7852
学术水平
12 点
热心指数
10 点
信用等级
10 点
经验
49881 点
帖子
1708
精华
0
在线时间
2697 小时
注册时间
2010-8-31
最后登录
2026-1-22

楼主
qingxunz 发表于 2018-11-19 10:09:15 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币


Deep Learning for Natural Language Processing

Jason Brownlee


Deep-Learning-for-Natural-Language-Processing.png deep_learning_for_nlp.pdf (7.26 MB, 需要: 10 个论坛币)




Contents
Copyright i
Contents ii
Preface iii
I Introductions iv
Welcome v
Who Is This Book For? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
About Your Outcomes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi
How to Read This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi
About the Book Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
About Python Code Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii
About Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii
About Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
II Foundations 1
1 Natural Language Processing 2
1.1 Natural Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Challenge of Natural Language . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 From Linguistics to Natural Language Processing . . . . . . . . . . . . . . . . . 3
1.4 Natural Language Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2 Deep Learning 8
2.1 Deep Learning is Large Neural Networks . . . . . . . . . . . . . . . . . . . . . . 8
2.2 Deep Learning is Hierarchical Feature Learning . . . . . . . . . . . . . . . . . . 11
2.3 Deep Learning as Scalable Learning Across Domains . . . . . . . . . . . . . . . 12
2.4 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
ii
CONTENTS iii
3 Promise of Deep Learning for Natural Language 16
3.1 Promise of Deep Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2 Promise of Drop-in Replacement Models . . . . . . . . . . . . . . . . . . . . . . 17
3.3 Promise of New NLP Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.4 Promise of Feature Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.5 Promise of Continued Improvement . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.6 Promise of End-to-End Models . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.7 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4 How to Develop Deep Learning Models With Keras 21
4.1 Keras Model Life-Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.2 Keras Functional Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.3 Standard Network Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.4 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
III Data Preparation 34
5 How to Clean Text Manually and with NLTK 35
5.1 Tutorial Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.2 Metamorphosis by Franz Kafka . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.3 Text Cleaning Is Task Speci c . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.4 Manual Tokenization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.5 Tokenization and Cleaning with NLTK . . . . . . . . . . . . . . . . . . . . . . . 41
5.6 Additional Text Cleaning Considerations . . . . . . . . . . . . . . . . . . . . . . 46
5.7 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6 How to Prepare Text Data with scikit-learn 48
6.1 The Bag-of-Words Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6.2 Word Counts with CountVectorizer . . . . . . . . . . . . . . . . . . . . . . . . 49
6.3 Word Frequencies with TfidfVectorizer . . . . . . . . . . . . . . . . . . . . . . 50
6.4 Hashing with HashingVectorizer . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.5 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
7 How to Prepare Text Data With Keras 54
7.1 Tutorial Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
7.2 Split Words with text to word sequence . . . . . . . . . . . . . . . . . . . . . 54
7.3 Encoding with one hot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
7.4 Hash Encoding with hashing trick . . . . . . . . . . . . . . . . . . . . . . . . 56
7.5 Tokenizer API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
7.6 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
7.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
CONTENTS iv
IV Bag-of-Words 61
8 The Bag-of-Words Model 62
8.1 Tutorial Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
8.2 The Problem with Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
8.3 What is a Bag-of-Words? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
8.4 Example of the Bag-of-Words Model . . . . . . . . . . . . . . . . . . . . . . . . 63
8.5 Managing Vocabulary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
8.6 Scoring Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
8.7 Limitations of Bag-of-Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
8.8 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
8.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
9 How to Prepare Movie Review Data for Sentiment Analysis 69
9.1 Tutorial Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
9.2 Movie Review Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
9.3 Load Text Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
9.4 Clean Text Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
9.5 Develop Vocabulary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
9.6 Save Prepared Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
9.7 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
9.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
10 Project: Develop a Neural Bag-of-Words Model for Sentiment Analysis 85
10.1 Tutorial Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
10.2 Movie Review Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
10.3 Data Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
10.4 Bag-of-Words Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
10.5 Sentiment Analysis Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
10.6 Comparing Word Scoring Methods . . . . . . . . . . . . . . . . . . . . . . . . . 103
10.7 Predicting Sentiment for New Reviews . . . . . . . . . . . . . . . . . . . . . . . 108
10.8 Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
10.9 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
10.10Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
V Word Embeddings 114
11 The Word Embedding Model 115
11.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
11.2 What Are Word Embeddings? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
11.3 Word Embedding Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
11.4 Using Word Embeddings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
11.5 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
11.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
CONTENTS v
12 How to Develop Word Embeddings with Gensim 122
12.1 Tutorial Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
12.2 Word Embeddings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
12.3 Gensim Python Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
12.4 Develop Word2Vec Embedding . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
12.5 Visualize Word Embedding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
12.6 Load Google's Word2Vec Embedding . . . . . . . . . . . . . . . . . . . . . . . . 128
12.7 Load Stanford's GloVe Embedding . . . . . . . . . . . . . . . . . . . . . . . . . 129
12.8 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
12.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
13 How to Learn and Load Word Embeddings in Keras 133
13.1 Tutorial Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
13.2 Word Embedding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
13.3 Keras Embedding Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
13.4 Example of Learning an Embedding . . . . . . . . . . . . . . . . . . . . . . . . . 135
13.5 Example of Using Pre-Trained GloVe Embedding . . . . . . . . . . . . . . . . . 138
13.6 Tips for Cleaning Text for Word Embedding . . . . . . . . . . . . . . . . . . . . 142
13.7 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
13.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
VI Text Classi cation 144
14 Neural Models for Document Classi cation 145
14.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
14.2 Word Embeddings + CNN = Text Classi cation . . . . . . . . . . . . . . . . . . 146
14.3 Use a Single Layer CNN Architecture . . . . . . . . . . . . . . . . . . . . . . . . 147
14.4 Dial in CNN Hyperparameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
14.5 Consider Character-Level CNNs . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
14.6 Consider Deeper CNNs for Classi cation . . . . . . . . . . . . . . . . . . . . . . 151
14.7 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
14.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
15 Project: Develop an Embedding + CNN Model for Sentiment Analysis 153
15.1 Tutorial Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
15.2 Movie Review Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
15.3 Data Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
15.4 Train CNN With Embedding Layer . . . . . . . . . . . . . . . . . . . . . . . . . 160
15.5 Evaluate Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
15.6 Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
15.7 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
15.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
...............................................................................................................................................


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝


已有 1 人评分学术水平 热心指数 信用等级 收起 理由
飞天玄舞6 + 5 + 5 + 5 精彩帖子

总评分: 学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

沙发
phipe(真实交易用户) 发表于 2018-11-19 18:35:47
谢谢分享

藤椅
jiaminZ(真实交易用户) 发表于 2018-11-20 23:28:58 来自手机
qingxunz 发表于 2018-11-19 10:09
Deep Learning for Natural Language Processing

Jason Brownlee
支持一下

板凳
heiyaodai(真实交易用户) 发表于 2018-11-25 10:47:15
谢谢分享。

报纸
linyu0219(真实交易用户) 发表于 2019-12-5 20:24:10
谢谢分享

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-2-13 09:38