This package wraps the Chu-Liu-Edmonds maximum spanning algorithm from TurboParser for use within Python.
It provides a function chu_liu_edmonds
which accepts a
A np.nan
cell value informs the algorithm to skip the edge.
Example usage:
import numpy as np
from dependency_decoding import chu_liu_edmonds
np.random.seed(42)
score_matrix = np.random.rand(3, 4)
heads, tree_score = chu_liu_edmonds(score_matrix)
print(heads, tree_score)
Install directly from Github as shown below:
pip install git+https://github.com/andersjo/dependency_decoding