A probabilistic non-projective dependency parser. Nonprojective
dependencies allows for "crossing branches" in the parse tree
which is necessary for representing particular linguistic phenomena, or
even typical parses in some languages. This parser follows the MST
parsing algorithm, outlined in McDonald(2005), which likens the search
for the best non-projective parse to finding the maximum spanning tree in
a weighted directed graph.
|
|
|
|
|
train(self,
graphs,
dependency_scorer)
Trains a DependencyScorerI from a set of
DependencyGraph objects, and establishes this as the
parser's scorer. |
source code
|
|
|
|
|
|
|
collapse_nodes(self,
new_node,
cycle_path,
g_graph,
b_graph,
c_graph)
Takes a list of nodes that have been identified to belong to a cycle,
and collapses them into on larger node. |
source code
|
|
|
|
|
|
|
compute_original_indexes(self,
new_indexes)
As nodes are collapsed into others, they are replaced by the new node
in the graph, but it's still necessary to keep track of what these
original nodes were. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
parse(self,
tokens,
tags)
Parses a list of tokens in accordance to the MST parsing algorithm
for non-projective dependency parses. |
source code
|
|