选区解析器和依赖解析器的区别 [英] Difference between constituency parser and dependency parser

查看:48
本文介绍了选区解析器和依赖解析器的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

选区解析器依赖解析器有什么区别?两者有什么不同的用法?

解决方案

选区解析树将文本分解为子短语.树中的非终结符是短语的类型,终结符是句子中的单词,边缘是未标记的.对于简单的句子John sees Bill",选区解析将是:

 语句|+------------+------------+||名词短语动词短语||约翰 +-------+--------+||动词名词短语||见比尔

依赖解析根据单词的关系连接单词.树中的每个顶点代表一个单词,子节点是依赖于父节点的单词,边由关系标记.John sees 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆