选区解析器和依赖解析器之间的区别 [英] Difference between constituency parser and dependency parser
问题描述
选区解析器和依赖解析器有什么区别?两者有什么不同用法?
选区分析树将文本分成多个子短语.树中的非终结符是短语的类型,终结符是句子中的单词,并且边缘未标记.对于一个简单的句子"John sees Bill",选区分析将是:
Sentence
|
+-------------+------------+
| |
Noun Phrase Verb Phrase
| |
John +-------+--------+
| |
Verb Noun Phrase
| |
sees Bill
依赖项解析根据单词之间的关系连接单词.树中的每个顶点表示一个单词,子节点是依赖于父代的单词,并且边缘用关系标记. "John sees Bill"的依存关系解析为:
sees
|
+--------------+
subject | | object
| |
John Bill
您应该使用使您最接近目标的解析器类型.如果您对句子中的子短语感兴趣,则可能需要选区分析.如果您对单词之间的依存关系感兴趣,那么您可能希望对依存关系进行解析.
Stanford解析器可以为您提供任何一种(在线演示).实际上,它的真正工作方式是始终使用选区解析器解析该句子,然后在需要时对选区解析树执行确定性(基于规则)转换,以将其转换为依赖关系树.>
更多信息可以在这里找到:
http://en.wikipedia.org/wiki/Phrase_structure_grammar
http://en.wikipedia.org/wiki/Dependency_grammar
What is the difference between a constituency parser and a dependency parser? What are the different usages of the two?
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. For a simple sentence "John sees Bill", a constituency parse would be:
Sentence
|
+-------------+------------+
| |
Noun Phrase Verb Phrase
| |
John +-------+--------+
| |
Verb Noun Phrase
| |
sees Bill
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. A dependency parse of "John sees Bill", would be:
sees
|
+--------------+
subject | | object
| |
John Bill
You should use the parser type that gets you closest to your goal. If you are interested in sub-phrases within the sentence, you probably want the constituency parse. If you are interested in the dependency relationships between words, then you probably want the dependency parse.
The Stanford parser can give you either (online demo). In fact, the way it really works is to always parse the sentence with the constituency parser, and then, if needed, it performs a deterministic (rule-based) transformation on the constituency parse tree to convert it into a dependency tree.
More can be found here:
http://en.wikipedia.org/wiki/Phrase_structure_grammar
http://en.wikipedia.org/wiki/Dependency_grammar
这篇关于选区解析器和依赖解析器之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!