A Survey of the Usages of Deep Learning for Natural Language Processing2019综述学习
这篇论文的特点在于将NLP的领域分类较好,算法都是讲的怎么用的(都是CNN、RNN变形和bert),没有讲原理,没有一个公式。作为NLP入门了解一些专业词汇很好。
摘要
在过去的几年里,随着深度学习模型的大量使用,自然语言处理领域得到了极大的发展。本调查对该领域进行了简要介绍,并简要概述了深度学习体系结构和方法。然后,它筛选了大量最近的研究,并总结了大量相关的贡献。分析的研究领域除了计算语言学的一些应用外,还包括几个核心的语言处理问题。并对今后的研究提出了建议。
关键词
深度学习,神经网络,自然语言处理,计算语言学,机器学习
1.介绍
以前方法:统计学、概率论、机器学习
有了GPU之后
现在方法:深度学习
本文主要介绍NLP和深度学习。第二章AL和NLP理论;
第三章NLP的四个主要问题:语言模型、形态学、句法分析、语义,以及DL在其中的应用;
第四章NLP的应用领域:信息检索、信息抽取、文本分类、文本生成、总结、问答系统、机器翻译;
第五章结论,未来展望。
2.自然语言处理和深度学习
2.1自然语言处理
NLP两个大的子领域:核心领域和应用
核心领域:语言模型、形态学、句法分析、语义(+一句话介绍每部分是干什么的)注意:很多有交叉
应用:信息检索、信息抽取、文本分类、文本生成、总结、问答系统、机器翻译
以前机器学习的方法:朴素贝叶斯、KNN、隐马尔可夫、条件随机场、决策树、随机森林、支持向量机。
最近几年用于NLP的方法:transformer。
2.2神经网络和深度学习
神经网络、随机梯度下降、反向传播、前馈神经网络(FFNN)、深度神经网络(DNN)
2.2.1 CNN
CNN被用于图片处理、视频处理、语音处理和自然语言处理
池化可以减小
2.2.2递归神经网络
递归神经网络Recursive Neural Networks
CNN同一层之间共享权重,而RNN是不同层之间共享权重
2.2.3循环神经网络和LSTM
循环神经网络: Recurrent Neural Networks
LSTM:Long Short-Term Memory Networks
循环神经网络是递归神经网络的一种
因为RNN是单向的,而单词之间的关系是双向的,因此有了 双向RNN(bidirectional RNN)
工程化应用广泛的一种RNN是LSTM
一种轻量化的LSTM变体是GRU( Gated Recurrent Unit)
2.2.4注意力机制和transformer
上图是transformer模型。其中a图中,四个蓝色编码器和四个红色解码器,编码器前面有一个positional encoder(粉红色)。b 图和c图对应的是a图内部结构,其中b是编码器内部结构,c 是解码器内部结构。编码器中一个self-attention layer,一个feed forward layer。解码器中一个 self-attention layer,一个attentional encoder-decoder layer,一个feed forward layer。
原来RNN的问题:不关注哪个重要哪个不重要,全部从编码器到解码器。
因此有了attention机制。
attention 机制的一些变体:convolutional , intra-temporal , gated , and self-attention
Self-attention in particular has become widely used in a state-of-the-art encoder-decoder model called Transformer。
2.2.5 残差连接和dropout
防止梯度爆炸和梯度消失的方法:
1.选择合适的激活函数,推荐relu
2.残差连接,网络举例: residual network (ResNet)
一些变体: Highway Networks and DenseNets .
3.dropout:防止训练数据过拟合
3.深度学习用于NLP的核心领域
主要分为四个部分:语言模型、形态学、句法分析、语
义学
语言模型决定哪个词与哪个词连接
形态学研究词本身的结构,词根前缀后缀,性别数字等。
句法分析词怎么构成句子
语义学研究每个词的意思以及怎么构成句子。
3.1语言模型
Language modeling (LM)
3.1.1 神经语言模型
可以识别同义词和词汇表外词
3.1.2评估LM
目前没有完美的方法,有一个度量指标是困惑度(perplexity)
困惑度的一个缺点是只能在同一个数据集上进行比较,多个数据集之间没有意义。
这个领域常用数据集:Penn Treebank (PTB) [54], and the Billion Word Benchmark
3.1.3LM中的记忆网络和注意力机制
1.运用注意力机制的网络变形三次递进尝试
1) a single value to predict the next token, to encode information for the attentional unit, and to decode the information in the attentional unit hinders a network
问题:difficult to train a single parameter to perform three distinct tasks simultaneously
2)designed each node to have two outputs: one to encode and decode the information in the attentional unit, and another to predict the next tokens explicitly
3)further separated the outputs, using separate values to encode the information entering the attentional unit and decode the information being retrieved from it
It was found that this network also provided results comparable to many larger RNNs and LSTMs, suggesting that reasonable results can be achieved using simpler networks.
2.近期 residual memory networks (RMNs) for LM
注意:residual connections skipping two layers were most effective
It was found that RMNs are capable of outperforming LSTMs of similar size.
3.1.4 CNN用于LM
A CNN used recently in LM replaced the pooling layers with fully-connected layers
Three different architectures were implemented:
1)a multilayer perceptron CNN (MLPConv)
2) a multilayer CNN (ML-CNN)
3) a combination of these networks called COM
this study showed that CNNs can be used to capture long term dependencies in sentences.