06 Dependency Parsing

课程计划

1、语法结构:一致性和依赖性。
2、依存语法。
3、研究亮点
4、基于转换的句法依存关系分析(Transition-based dependency parsing)
5、神经网络句法依存分析

1、语言结构的两种观点(Constituency = phrase structure grammar = context-free grammars (CFGs))

句法结构将单词组织成嵌套的成分
CS224n-06 Dependency Parsing

依存关系结构表示一个单词依赖于周围的哪一个词。
CS224n-06 Dependency Parsing

歧义(Ambiguity: PP attachments)

通过句法树可以表达歧义,一个确定的句法树对应句子的一个确定解读。from space这个介词短语到底依附谁?不同的答案导致对句子不同的理解。
CS224n-06 Dependency Parsing

依附歧义(Attachment ambiguities)

关键的语法决策是如何把一个短语(介词短语、状语短语、分词短语、不定式)依附到其他成分上去,比如下列句子:
CS224n-06 Dependency Parsing

数据标注的起源:Universal Dependencies treebanks

[Universal Dependencies: http://universaldependencies.org/ ;
cf. Marcus et al. 1993, The Penn Treebank, Computational Linguistics]
CS224n-06 Dependency Parsing
人们偏好树库多于规则的原因是显而易见的,树库虽然标注难度高,但每一份劳动都可被复用(可以用于词性标注命名实体识别等等任务);而每个人编写的规则都不同,并且死板又丑陋。树库的多用性还是得其作为评测的标杆数据,得到了越来越多的引用。

2. 依存语法和依存结构(Dependency Grammar and Dependency Structure)

依存语法假设语法结构包含词汇和一般的二元不对称关系被叫做依赖性。
标注依存弧label的依存句法树就是短语结构树的一种:
CS224n-06 Dependency Parsing
一旦标上了,两者就彻底不同了:
CS224n-06 Dependency Parsing
这里箭头的尾部是head(被修饰的主题),箭头指向的是dependent(修饰语)。

CS224n-06 Dependency Parsing
CS224n-06 Dependency Parsing
CS224n-06 Dependency Parsing

1、人们画依存句法树的弧的方式不同,这门课是head指向dependent(即箭头指向的词语是依赖者,箭头尾部的词语是被依赖者),我的偏好是反过来。
2、每个句子都有一个虚根,代表句子之外的开始,这样句子中的每个单词都有自己的依存对象了。

从属条件参数(Dependency Conditioning 选项)

依存分析需要什么信息?
1、双词汇亲和(Bilexical affinities),比如discussion与issues。
2、从属距离,因为一般相邻的词语才具有依存关系
3、中间词,如果中间词语是动词或标点,则两边的词语不太可能有依存
4、词语配件,一个词语最多有几个依赖者。

依存关系句法分析(Dependency Parsing)

一些约束:
1、只有一个词依赖于ROOT;
2、没有环A → B, B → A

这样就形成了一个树形依赖。英语中大部分句子是projective的,少数是non-projective的:
CS224n-06 Dependency Parsing
不能将一个依存句法树还原成句子。

依存句法分析方法(Methods of Dependency Parsing)

1、动态规划(Dynamic programming)
估计是找出以某head结尾的字串对应的最可能的句法树。
2、图算法(Graph algorithms)
对句子创建一个最小生成树。
3、Constraint Satisfaction
估计是在某个图上逐步删除不符合要求的边,直到成为一棵树。
4、“Transition-based parsing” or “deterministic dependency parsing”
通过ML分类器选择好的依附词,被证明很有效(主流方法)

通过词嵌入的经验提高词分布相似度(Improving Distributional Similarity with Lessons Learned from Word Embeddings)

CS224n-06 Dependency Parsing
CS224n-06 Dependency Parsing

CS224n-06 Dependency Parsing

CS224n-06 Dependency Parsing

CS224n-06 Dependency Parsing
CS224n-06 Dependency Parsing
CS224n-06 Dependency Parsing

关键点:
1、神经网络方法优于基于计数的方法。
2、模型结构很重要,参数同样是一个关键,不要忽略这个。

4、Greedy transition-based parsing

1、一个简单的贪心从属解析
2、解析是一系列颠倒的行为。

Basic transition-based dependency parser

CS224n-06 Dependency Parsing

Arc-standard transition-based parser

CS224n-06 Dependency Parsing
CS224n-06 Dependency Parsing

MaltParser

无搜索,贪婪地下转移决策,线性复杂度,只损失了一点效果。加个beam search会上升一点。

特征表示(Feature Representation)

CS224n-06 Dependency Parsing
无非是栈和队列中单词、词性、依存标签的组合的特征函数,一个超长的稀疏01向量。

评价依存分析(Evaluation of Dependency Parsing:(labeled) dependency accuracy)

评测指标是UAS(不考虑标签只考虑弧)或LAS(同时考虑标签和弧)
CS224n-06 Dependency Parsing

Dependency paths identify semantic relations – e.g, for protein interaction

CS224n-06 Dependency Parsing

投射性(Projectivity)

CS224n-06 Dependency Parsing

非投射性(non-projectivity)

CS224n-06 Dependency Parsing

5. Why train a neural dependency parser? Indicator Features Revisited

CS224n-06 Dependency Parsing
CS224n-06 Dependency Parsing
深度学习神经网络模型的提升效果很有限。

分布式表示(Distributed Representations)

1、将每一个单词表示成d维的稠密向量。(词嵌入)
相似的词期望表示成紧密的向量
2、同时,part-of-speech tags (POS) 和dependency labels同样被表示成d维的向量。
相似的词集表示出语义上的相似

从结构提取符号和词向量表示(Extracting Tokens and then vector representations from configuration)

CS224n-06 Dependency Parsing

模型结构

CS224n-06 Dependency Parsing

为什么需要非线性层(Non-linearities between layers:Why they’re needed)?

CS224n-06 Dependency Parsing

CS224n-06 Dependency Parsing
CS224n-06 Dependency Parsing

句子结构的依存关系分析(Dependency parsing for sentence structure)

神经网络能准确判断句子结构,并且可以解释。
CS224n-06 Dependency Parsing
Chen and Manning (2014)提出了第一个成功地神经网络依存分析方法。
稠密表示的性能在准确率和速度上都优于贪婪解析法(greedy parsers)。

基于转换的神经网络句法分析未来工作(Further developments in transition-based neural dependency parsing)

1、更大更深的神经网络和更好地参数调解。
2、Beam search
3、在决策序列全局进行类似CRF推断的方法
Google的SyntaxNet 中的 Parsey McParseFace的效果:
https://research.googleblog.com/2016/05/announcing-syntaxnet-worlds-most.html
CS224n-06 Dependency Parsing

随着网络结构复杂化,模型结果提升很大。



参考:
http://web.stanford.edu/class/cs224n/
http://www.hankcs.com/nlp/word-vector-representations-word2vec.html



相关文章: