nltk.parse.ProjectiveDependencyParser

class nltk.parse.ProjectiveDependencyParser(dependency_grammar)[source]

A projective, rule-based, dependency parser. A ProjectiveDependencyParser is created with a DependencyGrammar, a set of productions specifying word-to-word dependency relations. The parse() method will then return the set of all parses, in tree representation, for a given input sequence of tokens. Each parse must meet the requirements of the both the grammar and the projectivity constraint which specifies that the branches of the dependency tree are not allowed to cross. Alternatively, this can be understood as stating that each parent node and its children in the parse tree form a continuous substring of the input sequence.

Methods

__init__(dependency_grammar) Create a new ProjectiveDependencyParser, from a word-to-word dependency grammar DependencyGrammar.
concatenate(span1, span2) Concatenates the two spans in whichever way possible.
parse(tokens) Performs a projective dependency parse on the list of tokens using a chart-based, span-concatenation algorithm similar to Eisner (1996).