Skip to main content

Bindings to Chu-Liu-Edmonds algorithm from TurboParser

Project description

Chu-Liu-Edmonds Algorithm from TurpoParser.

This package wraps the Chu-Liu-Edmonds maximum spanning algorithm from TurboParser for use within Python.

The original package was made by https://github.com/andersjo/dependency_decoding .

Documentation

The package provides a function chu_liu_edmonds, which accepts an N×N score matrix as argument, where N is the sentence length including the artificial root node, which has index 0. The (i,j)-th cell is the score for the edge j→i. In other words, a row gives the scores for the different heads of a dependent.

A np.nan cell value informs the algorithm to skip the edge.

Example usage:

import numpy as np
from ufal.chu_liu_edmonds import chu_liu_edmonds

np.random.seed(42)
score_matrix = np.random.rand(3, 3)
heads, tree_score = chu_liu_edmonds(score_matrix)
print(heads, tree_score)

Install

Binary wheels of the package are provided, just run

pip install ufal.chu_liu_edmonds

Updating the Cython-generated Module

To update the Cython-generated module, run

cython --module-name ufal.chu_liu_edmonds._chu_liu_edmonds chu_liu_edmonds.pyx -o chu_liu_edmonds.cpp

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ufal.chu_liu_edmonds-1.0.3.tar.gz (153.1 kB view hashes)

Uploaded Source

Built Distributions

ufal.chu_liu_edmonds-1.0.3-cp312-cp312-win_amd64.whl (292.0 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

ufal.chu_liu_edmonds-1.0.3-cp312-cp312-win32.whl (234.3 kB view hashes)

Uploaded CPython 3.12 Windows x86

ufal.chu_liu_edmonds-1.0.3-cp312-cp312-musllinux_1_1_x86_64.whl (660.1 kB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp312-cp312-musllinux_1_1_i686.whl (714.2 kB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ i686

ufal.chu_liu_edmonds-1.0.3-cp312-cp312-musllinux_1_1_aarch64.whl (643.7 kB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (114.1 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (109.6 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (118.8 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

ufal.chu_liu_edmonds-1.0.3-cp312-cp312-macosx_11_0_arm64.whl (92.6 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp312-cp312-macosx_10_9_x86_64.whl (99.2 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp311-cp311-win_amd64.whl (290.7 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

ufal.chu_liu_edmonds-1.0.3-cp311-cp311-win32.whl (233.0 kB view hashes)

Uploaded CPython 3.11 Windows x86

ufal.chu_liu_edmonds-1.0.3-cp311-cp311-musllinux_1_1_x86_64.whl (661.6 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp311-cp311-musllinux_1_1_i686.whl (715.0 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ i686

ufal.chu_liu_edmonds-1.0.3-cp311-cp311-musllinux_1_1_aarch64.whl (645.0 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (116.5 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (111.4 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (121.9 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

ufal.chu_liu_edmonds-1.0.3-cp311-cp311-macosx_11_0_arm64.whl (91.4 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp311-cp311-macosx_10_9_x86_64.whl (97.5 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp310-cp310-win_amd64.whl (290.6 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

ufal.chu_liu_edmonds-1.0.3-cp310-cp310-win32.whl (233.3 kB view hashes)

Uploaded CPython 3.10 Windows x86

ufal.chu_liu_edmonds-1.0.3-cp310-cp310-musllinux_1_1_x86_64.whl (661.5 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp310-cp310-musllinux_1_1_i686.whl (715.6 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

ufal.chu_liu_edmonds-1.0.3-cp310-cp310-musllinux_1_1_aarch64.whl (645.0 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (117.0 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (111.6 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (121.8 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

ufal.chu_liu_edmonds-1.0.3-cp310-cp310-macosx_11_0_arm64.whl (91.6 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp310-cp310-macosx_10_9_x86_64.whl (97.7 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp39-cp39-win_amd64.whl (291.1 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

ufal.chu_liu_edmonds-1.0.3-cp39-cp39-win32.whl (234.0 kB view hashes)

Uploaded CPython 3.9 Windows x86

ufal.chu_liu_edmonds-1.0.3-cp39-cp39-musllinux_1_1_x86_64.whl (662.0 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp39-cp39-musllinux_1_1_i686.whl (716.2 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ i686

ufal.chu_liu_edmonds-1.0.3-cp39-cp39-musllinux_1_1_aarch64.whl (645.7 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (117.6 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (112.1 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (122.3 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

ufal.chu_liu_edmonds-1.0.3-cp39-cp39-macosx_11_0_arm64.whl (92.3 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp39-cp39-macosx_10_9_x86_64.whl (98.2 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp38-cp38-win_amd64.whl (291.2 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

ufal.chu_liu_edmonds-1.0.3-cp38-cp38-win32.whl (234.0 kB view hashes)

Uploaded CPython 3.8 Windows x86

ufal.chu_liu_edmonds-1.0.3-cp38-cp38-musllinux_1_1_x86_64.whl (662.6 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp38-cp38-musllinux_1_1_i686.whl (716.4 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ i686

ufal.chu_liu_edmonds-1.0.3-cp38-cp38-musllinux_1_1_aarch64.whl (646.5 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (117.8 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (112.3 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (122.1 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

ufal.chu_liu_edmonds-1.0.3-cp38-cp38-macosx_11_0_arm64.whl (92.0 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp38-cp38-macosx_10_9_x86_64.whl (97.8 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp37-cp37m-win_amd64.whl (290.8 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

ufal.chu_liu_edmonds-1.0.3-cp37-cp37m-win32.whl (233.4 kB view hashes)

Uploaded CPython 3.7m Windows x86

ufal.chu_liu_edmonds-1.0.3-cp37-cp37m-musllinux_1_1_x86_64.whl (661.7 kB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp37-cp37m-musllinux_1_1_i686.whl (716.0 kB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ i686

ufal.chu_liu_edmonds-1.0.3-cp37-cp37m-musllinux_1_1_aarch64.whl (646.2 kB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (117.0 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (112.0 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (121.8 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

ufal.chu_liu_edmonds-1.0.3-cp37-cp37m-macosx_10_9_x86_64.whl (98.4 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp36-cp36m-win_amd64.whl (301.3 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

ufal.chu_liu_edmonds-1.0.3-cp36-cp36m-win32.whl (239.8 kB view hashes)

Uploaded CPython 3.6m Windows x86

ufal.chu_liu_edmonds-1.0.3-cp36-cp36m-musllinux_1_1_x86_64.whl (658.7 kB view hashes)

Uploaded CPython 3.6m musllinux: musl 1.1+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp36-cp36m-musllinux_1_1_i686.whl (713.4 kB view hashes)

Uploaded CPython 3.6m musllinux: musl 1.1+ i686

ufal.chu_liu_edmonds-1.0.3-cp36-cp36m-musllinux_1_1_aarch64.whl (642.8 kB view hashes)

Uploaded CPython 3.6m musllinux: musl 1.1+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (114.1 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

ufal.chu_liu_edmonds-1.0.3-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (109.5 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ ARM64

ufal.chu_liu_edmonds-1.0.3-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (119.1 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

ufal.chu_liu_edmonds-1.0.3-cp36-cp36m-macosx_10_9_x86_64.whl (96.2 kB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page