没有合适的资源?快使用搜索试试~ 我知道了~
它涵盖了自然语言处理(NLP)和语音处理的各个方面
0 下载量 99 浏览量
2024-03-08
17:49:44
上传
评论
收藏 20.42MB PDF 举报
温馨提示
试读
577页
《Speech and Language Processing》是一本由Daniel Jurafsky和James H. Martin合著的著名教科书,它涵盖了自然语言处理(NLP)和语音处理的各个方面。以下是该书的一些具体内容: 自然语言处理基础:介绍了NLP的基本概念和技术,包括语言模型、词性标注、句法分析、语义分析等。 语言理解和生成:讨论了NLP中的语言理解和生成问题,如问答系统、信息检索、机器翻译等。 文本处理和分析:涵盖了文本处理和分析的技术,包括文本分类、情感分析、命名实体识别等。 对话系统:介绍了对话系统的基本原理和技术,包括对话管理、对话策略、对话生成等。 语音处理基础:讨论了语音处理的基本概念和技术,包括语音信号处理、语音识别、语音合成等。 语音识别和语音合成:深入介绍了语音识别和语音合成的算法和方法,包括声学模型、语言模型、声学特征提取等。 统计方法和机器学习:涵盖了NLP中常用的统计方法和机器学习技术,如朴素贝叶斯、最大熵模型、条件随机场等。 深度学习在NLP中的应用:讨论了深度学习在NLP领域的应用,包括词向量表示、循环神经网络、注意力机制等。
资源推荐
资源详情
资源评论
Speech and Language Processing
An Introduction to Natural Language Processing,
Computational Linguistics, and Speech Recognition
Third Edition draft
Daniel Jurafsky
Stanford University
James H. Martin
University of Colorado at Boulder
Copyright ©2023. All rights reserved.
Draft of February 3, 2024. Comments and typos welcome!
Summary of Contents
I Fundamental Algorithms for NLP 1
1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Regular Expressions, Text Normalization, Edit Distance. . . . . . . . . 4
3 N-gram Language Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4 Naive Bayes, Text Classification, and Sentiment . . . . . . . . . . . . . . . . . 60
5 Logistic Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
6 Vector Semantics and Embeddings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
7 Neural Networks and Neural Language Models . . . . . . . . . . . . . . . . . 136
8 Sequence Labeling for Parts of Speech and Named Entities . . . . . . 162
9 RNNs and LSTMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
10 Transformers and Large Language Models . . . . . . . . . . . . . . . . . . . . . 213
11 Fine-Tuning and Masked Language Models. . . . . . . . . . . . . . . . . . . . . 242
12 Prompting, In-Context Learning, and Instruct Tuning. . . . . . . . . . .263
II NLP Applications 265
13 Machine Translation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
14 Question Answering and Information Retrieval . . . . . . . . . . . . . . . . . 293
15 Chatbots & Dialogue Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
16 Automatic Speech Recognition and Text-to-Speech . . . . . . . . . . . . . . 337
III Annotating Linguistic Structure 365
17 Context-Free Grammars and Constituency Parsing . . . . . . . . . . . . . 367
18 Dependency Parsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
19 Information Extraction: Relations, Events, and Time. . . . . . . . . . . .415
20 Semantic Role Labeling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
21 Lexicons for Sentiment, Affect, and Connotation. . . . . . . . . . . . . . . . 461
22 Coreference Resolution and Entity Linking . . . . . . . . . . . . . . . . . . . . . 481
23 Discourse Coherence. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .511
Bibliography. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .533
Subject Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
2
Contents
I Fundamental Algorithms for NLP 1
1 Introduction 3
2 Regular Expressions, Text Normalization, Edit Distance 4
2.1 Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.3 Corpora . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.4 Simple Unix Tools for Word Tokenization . . . . . . . . . . . . . 17
2.5 Word Tokenization . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.6 Word Normalization, Lemmatization and Stemming . . . . . . . . 23
2.7 Sentence Segmentation . . . . . . . . . . . . . . . . . . . . . . . 25
2.8 Minimum Edit Distance . . . . . . . . . . . . . . . . . . . . . . . 25
2.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Bibliographical and Historical Notes . . . . . . . . . . . . . . . . . . . . 30
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3 N-gram Language Models 32
3.1 N-Grams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.2 Evaluating Language Models: Training and Test Sets . . . . . . . 38
3.3 Evaluating Language Models: Perplexity . . . . . . . . . . . . . . 39
3.4 Sampling sentences from a language model . . . . . . . . . . . . . 42
3.5 Generalization and Zeros . . . . . . . . . . . . . . . . . . . . . . 42
3.6 Smoothing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.7 Huge Language Models and Stupid Backoff . . . . . . . . . . . . 50
3.8 Advanced: Kneser-Ney Smoothing . . . . . . . . . . . . . . . . . 51
3.9 Advanced: Perplexity’s Relation to Entropy . . . . . . . . . . . . 54
3.10 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Bibliographical and Historical Notes . . . . . . . . . . . . . . . . . . . . 57
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
4 Naive Bayes, Text Classification, and Sentiment 60
4.1 Naive Bayes Classifiers . . . . . . . . . . . . . . . . . . . . . . . 61
4.2 Training the Naive Bayes Classifier . . . . . . . . . . . . . . . . . 64
4.3 Worked example . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
4.4 Optimizing for Sentiment Analysis . . . . . . . . . . . . . . . . . 66
4.5 Naive Bayes for other text classification tasks . . . . . . . . . . . 68
4.6 Naive Bayes as a Language Model . . . . . . . . . . . . . . . . . 69
4.7 Evaluation: Precision, Recall, F-measure . . . . . . . . . . . . . . 70
4.8 Test sets and Cross-validation . . . . . . . . . . . . . . . . . . . . 72
4.9 Statistical Significance Testing . . . . . . . . . . . . . . . . . . . 73
4.10 Avoiding Harms in Classification . . . . . . . . . . . . . . . . . . 77
4.11 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Bibliographical and Historical Notes . . . . . . . . . . . . . . . . . . . . 78
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
5 Logistic Regression 81
5.1 The sigmoid function . . . . . . . . . . . . . . . . . . . . . . . . 82
5.2 Classification with Logistic Regression . . . . . . . . . . . . . . . 84
3
4 CONTENTS
5.3 Multinomial logistic regression . . . . . . . . . . . . . . . . . . . 88
5.4 Learning in Logistic Regression . . . . . . . . . . . . . . . . . . . 91
5.5 The cross-entropy loss function . . . . . . . . . . . . . . . . . . . 92
5.6 Gradient Descent . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.7 Regularization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
5.8 Learning in Multinomial Logistic Regression . . . . . . . . . . . . 100
5.9 Interpreting models . . . . . . . . . . . . . . . . . . . . . . . . . 102
5.10 Advanced: Deriving the Gradient Equation . . . . . . . . . . . . . 102
5.11 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Bibliographical and Historical Notes . . . . . . . . . . . . . . . . . . . . 104
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
6 Vector Semantics and Embeddings 105
6.1 Lexical Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . 106
6.2 Vector Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . 109
6.3 Words and Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . 110
6.4 Cosine for measuring similarity . . . . . . . . . . . . . . . . . . . 114
6.5 TF-IDF: Weighing terms in the vector . . . . . . . . . . . . . . . 115
6.6 Pointwise Mutual Information (PMI) . . . . . . . . . . . . . . . . 118
6.7 Applications of the tf-idf or PPMI vector models . . . . . . . . . . 120
6.8 Word2vec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
6.9 Visualizing Embeddings . . . . . . . . . . . . . . . . . . . . . . . 127
6.10 Semantic properties of embeddings . . . . . . . . . . . . . . . . . 128
6.11 Bias and Embeddings . . . . . . . . . . . . . . . . . . . . . . . . 130
6.12 Evaluating Vector Models . . . . . . . . . . . . . . . . . . . . . . 131
6.13 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Bibliographical and Historical Notes . . . . . . . . . . . . . . . . . . . . 133
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
7 Neural Networks and Neural Language Models 136
7.1 Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
7.2 The XOR problem . . . . . . . . . . . . . . . . . . . . . . . . . . 139
7.3 Feedforward Neural Networks . . . . . . . . . . . . . . . . . . . . 142
7.4 Feedforward networks for NLP: Classification . . . . . . . . . . . 147
7.5 Training Neural Nets . . . . . . . . . . . . . . . . . . . . . . . . 149
7.6 Feedforward Neural Language Modeling . . . . . . . . . . . . . . 156
7.7 Training the neural language model . . . . . . . . . . . . . . . . . 158
7.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Bibliographical and Historical Notes . . . . . . . . . . . . . . . . . . . . 161
8 Sequence Labeling for Parts of Speech and Named Entities 162
8.1 (Mostly) English Word Classes . . . . . . . . . . . . . . . . . . . 163
8.2 Part-of-Speech Tagging . . . . . . . . . . . . . . . . . . . . . . . 165
8.3 Named Entities and Named Entity Tagging . . . . . . . . . . . . . 167
8.4 HMM Part-of-Speech Tagging . . . . . . . . . . . . . . . . . . . 169
8.5 Conditional Random Fields (CRFs) . . . . . . . . . . . . . . . . . 176
8.6 Evaluation of Named Entity Recognition . . . . . . . . . . . . . . 181
8.7 Further Details . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
8.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Bibliographical and Historical Notes . . . . . . . . . . . . . . . . . . . . 184
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
CONTENTS 5
9 RNNs and LSTMs 187
9.1 Recurrent Neural Networks . . . . . . . . . . . . . . . . . . . . . 187
9.2 RNNs as Language Models . . . . . . . . . . . . . . . . . . . . . 191
9.3 RNNs for other NLP tasks . . . . . . . . . . . . . . . . . . . . . . 194
9.4 Stacked and Bidirectional RNN architectures . . . . . . . . . . . . 197
9.5 The LSTM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
9.6 Summary: Common RNN NLP Architectures . . . . . . . . . . . 203
9.7 The Encoder-Decoder Model with RNNs . . . . . . . . . . . . . . 203
9.8 Attention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
9.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Bibliographical and Historical Notes . . . . . . . . . . . . . . . . . . . . 211
10 Transformers and Large Language Models 213
10.1 The Transformer: A Self-Attention Network . . . . . . . . . . . . 214
10.2 Multihead Attention . . . . . . . . . . . . . . . . . . . . . . . . . 221
10.3 Transformer Blocks . . . . . . . . . . . . . . . . . . . . . . . . . 221
10.4 The Residual Stream view of the Transformer Block . . . . . . . . 224
10.5 The input: embeddings for token and position . . . . . . . . . . . 226
10.6 The Language Modeling Head . . . . . . . . . . . . . . . . . . . 228
10.7 Large Language Models with Transformers . . . . . . . . . . . . . 231
10.8 Large Language Models: Generation by Sampling . . . . . . . . . 234
10.9 Large Language Models: Training Transformers . . . . . . . . . . 237
10.10 Potential Harms from Language Models . . . . . . . . . . . . . . 239
10.11 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Bibliographical and Historical Notes . . . . . . . . . . . . . . . . . . . . 241
11 Fine-Tuning and Masked Language Models 242
11.1 Bidirectional Transformer Encoders . . . . . . . . . . . . . . . . . 242
11.2 Training Bidirectional Encoders . . . . . . . . . . . . . . . . . . . 246
11.3 Contextual Embeddings . . . . . . . . . . . . . . . . . . . . . . . 250
11.4 Fine-Tuning Language Models . . . . . . . . . . . . . . . . . . . 254
11.5 Advanced: Span-based Masking . . . . . . . . . . . . . . . . . . 258
11.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
Bibliographical and Historical Notes . . . . . . . . . . . . . . . . . . . . 262
12 Prompting, In-Context Learning, and Instruct Tuning 263
II NLP Applications 265
13 Machine Translation 267
13.1 Language Divergences and Typology . . . . . . . . . . . . . . . . 268
13.2 Machine Translation using Encoder-Decoder . . . . . . . . . . . . 272
13.3 Details of the Encoder-Decoder Model . . . . . . . . . . . . . . . 276
13.4 Decoding in MT: Beam Search . . . . . . . . . . . . . . . . . . . 278
13.5 Translating in low-resource situations . . . . . . . . . . . . . . . . 282
13.6 MT Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
13.7 Bias and Ethical Issues . . . . . . . . . . . . . . . . . . . . . . . 288
13.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Bibliographical and Historical Notes . . . . . . . . . . . . . . . . . . . . 290
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
14 Question Answering and Information Retrieval 293
剩余576页未读,继续阅读
资源评论
xianyinsuifeng
- 粉丝: 433
- 资源: 55
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 电赛数据集-数字5,6,7,8识别
- 基于Vue的长沙理工大学Java大作业设计源码
- matlab基于线性准则的考虑风力发电不确定性的分布鲁棒优化机组组合
- 基于C语言+stm32f4的modbus tcp上下位机通信项目+上位机由LabVIEW编写+源码+开发文档+视频教程(高分项目
- 基于Python的Struts2漏洞扫描器设计源码
- HTML+CSS制作的个人博客网页.zip
- 基于htmlde 爱心代码,但HTML网页源码.zip
- 51单片机实现LED流水灯
- 基于Python的obEspoir分布式游戏框架设计源码
- 基于python的机械设计实用计算器,可计算电动机,传动装置,V带轮,齿轮,轴,轴承的几何或者力,运动学参数数值+源码+开发文档
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功