Constituent Parsing & Dependency Parsing 句法分析简介

来源:互联网 发布:怀卡托理工学院 知乎 编辑:程序博客网 时间:2024/06/10 12:43

由于博主前面在学习句法分析的时候发现,相关的学习资料少之又少,费了不少功夫收集和整理。所以写几个笔记记录一下。

关于Parsing的一些基础知识:主要包括Parsing任务是干什么的,有什么作用,怎么做。
可以参考Christopher Manning的视频。以前在course上面有视频,现在得翻墙看
这是视频链接https://www.youtube.com/playlist?list=PL6397E4B26D00A269
这里写图片描述
不过他所有修改过的ppt能够找到。下面是ppt链接,里面还有其他nlp方面的介绍。
http://web.stanford.edu/~jurafsky/NLPCourseraSlides.html

话不多说,上面的资料很好,讲的很清楚。

1 Two views of linguistic structure。
两种句法结构的异同,依存句法和成分句法是两种不同的句法,
Phrase structure organizes words into nested constituents.
这里写图片描述
成分句法把句子组织成短语的形式,如eating fish就是一个动词短语。

Phrase structure:
A constituency parse tree breaks a text into sub-phrases.
Non-terminals in the tree are types of phrases,
the terminals are the words in the sentence, and the edges are unlabeled.
interested in sub-phrases within the sentence

Dependency structure shows which words depend on (modify or are arguments of) which other words.
这里写图片描述
而依存句法主要揭示了句子中词的依赖关系。

Dependency structure:
A dependency parse connects words according to their relationships.
Each vertex in the tree represents a word,
child nodes are words that are dependent on the parent, and edges are labeled by the relationship.
interested in the dependency relationships between words

两种语法结构能够揭示句子中不同的信息,所以当你在其他任务中,需要用到句子中的短语结构就用constituent ,而需要用到词与词之间的依赖关系就用dependency。

顺带提一个小常识,依存句法树能够根据成分句法树转换而来,但成分句法树不能通过依存树转化来。转换的规则是head-finding rules from Zhang and Clark 2008

另外一个对于初学者比较头疼的问题就是什么是head word。
博主刚开始以为有明确的定义,但没找到,后面才知道,head word在不同的Parsing方案中不一样,有的(比如Stanford的那一套规则)可能在这一句话中把这个词定为head word,而有的却是另外一个词。当然这些不同只是在一小部分比较特殊的语句中。

什么是head word???

在成分句法分析中。
这里写图片描述
如上图,在”布朗访问上海“这一整棵树中head word就是“访问”这个词,而在右子树上head word是“访问”。
在constituent parsing中,一个长短语的head word表示最能表示整个短语的那个词,名词短语一般是名词,动词短语一般是动词。而具体怎么选,则根据不同的parser采取的方案有不同的规定,不过大部分的句子是一样的,如上图这些简单的句子,不同的parser规则,得到的树应该是一样的。

在依存句法分析中。
这里写图片描述
比如eating fish 中心是就是eating,因为fish依赖于eating。
很好理解。

而中心词的作用可以理解成在parse的过程中的一个重要的特征。

0 0
原创粉丝点击