Difference between constituency parser and dependency parser
Asked Answered
R

1

128

What is the difference between a constituency parser and a dependency parser? What are the different usages of the two?

Rushing answered 1/5, 2012 at 16:45 Comment(0)
M
203

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

Mellette answered 1/5, 2012 at 17:12 Comment(3)
In reagrds to NLP, where is the application for constituent parsing? Dependency parsing is very useful but where exactly can I use constituent parsing output?Dragster
> Constituent-based approaches to parsing provide similar information, but it often has to be distilled from the trees via techniques such as the head finding rules discussed in Chapter 11. web.stanford.edu/~jurafsky/slp3/11.pdfLilytrotter
@Dragster there're many applications for constituent parsing. Just to name one as an example here, in information/relation extraction from text, you may only need to extract VPs/NPs/Clauses from text and then classify pairs of these phrases/clauses as whether indicative of a relation type or not. So in this case, I do not necessarily need the fine-grained relation info within a phrase/clause but I just need the phrase/clause spans from text. And that is when a constituency parser comes in handy.Intermarriage

© 2022 - 2024 — McMap. All rights reserved.