Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Can a constituency parse be converted to a dependency parse?


Asked by Oakley Bryan on Dec 09, 2021 FAQ



Provides full syntactic analysis, minimally a constituency (phrase-structure tree) parse of sentences. If a rule-based conversion from constituency parses to dependency parses is available (this is currently the case for English and Chinese, only), then a dependency representation is also generated using this conversion.
In addition,
Due to the nature of the underlying grammars, dependency parsing performs better than constituency in this kind of scenario. On the other hand, when we want to extract sub-phrases from the sentence, a constituency parser might be better. We can use both types of parse trees to extract features for a supervised machine learning model.
In fact, Constituency parsers internally generate binary parse trees, which can also be saved. If you only need dependency parses, then you can get only dependency parses more quickly (and using less memory) by using the direct dependency parser annotator depparse. Note that this is a separate annotator, with different options.
Additionally,
Now spaCy does not provide an official API for constituency parsing. Therefore, we will be using the Berkeley Neural Parser. It is a python implementation of the parsers based on Constituency Parsing with a Self-Attentive Encoder from ACL 2018.
Accordingly,
Like the constituency-based tree, constituent structure is acknowledged. Any complete sub-tree of the tree is a constituent. Thus this dependency-based parse tree acknowledges the subject noun John and the object noun phrase the ball as constituents just like the constituency-based parse tree does.