Kaldi alignment methods wrapped into Python
Project description
kaldialign
A small package that exposes edit distance computation functions from Kaldi. It uses the original Kaldi code and wraps it using pybind11.
Installation
conda install -c kaldialign kaldialign
or
pip install --verbose kaldialign
or
pip install --verbose -U git+https://github.com/pzelasko/kaldialign.git
or
git clone https://github.com/pzelasko/kaldialign.git
cd kaldialign
python3 setup.py install --verbose
Examples
align(seq1, seq2, epsilon)
- used to obtain the alignment between two string sequences.epsilon
should be a null symbol (indicating deletion/insertion) that doesn't exist in either sequence.
from kaldialign import align
EPS = '*'
a = ['a', 'b', 'c']
b = ['a', 's', 'x', 'c']
ali = align(a, b, EPS)
assert ali == [('a', 'a'), ('b', 's'), (EPS, 'x'), ('c', 'c')]
edit_distance(seq1, seq2)
- used to obtain the total edit distance, as well as the number of insertions, deletions and substitutions.
from kaldialign import edit_distance
a = ['a', 'b', 'c']
b = ['a', 's', 'x', 'c']
results = edit_distance(a, b)
assert results == {
'ins': 1,
'del': 0,
'sub': 1,
'total': 2
}
Motivation
The need for this arised from the fact that practically all implementations of the Levenshtein distance have slight differences, making it impossible to use a different scoring tool than Kaldi and get the same error rate results. This package copies code from Kaldi directly and wraps it using Cython, avoiding the issue altogether.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file kaldialign-0.6-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: kaldialign-0.6-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 61.7 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83cc7265a024822df43a4406b2f3da4fe4683936c1bf111bef3540940e5a32ba |
|
MD5 | b8317d14fb310e79786e4de47fbdf7c1 |
|
BLAKE2b-256 | 54f8ae77dbedb16e2696983a63c6f22de44fc1016bafbd5cad23fa1be488ad5a |
File details
Details for the file kaldialign-0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: kaldialign-0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 81.3 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48ccb8764ac6a6c94d71a38a41fb472bd42ecbd53b7deefe15407f99a8352f05 |
|
MD5 | 1e00fc2e40984b0e60f23a95aca79b5d |
|
BLAKE2b-256 | d0c9caccd21d90767e603c5962a399b5898aa4f1452a922b1c0c54d83395eada |
File details
Details for the file kaldialign-0.6-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: kaldialign-0.6-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 86.6 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | decb9e8298a60a3251081c2363b261b981c01483d9726553004786d5ee846115 |
|
MD5 | 2ceddf7b32b28a941bda596ca087dc4b |
|
BLAKE2b-256 | 105181d98cb022acfe1d269646bc9b34b80cf87a5bcb9a419096350b0d0a4559 |
File details
Details for the file kaldialign-0.6-cp311-cp311-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: kaldialign-0.6-cp311-cp311-macosx_10_9_x86_64.whl
- Upload date:
- Size: 53.2 kB
- Tags: CPython 3.11, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6be9300cf4e8c17db5b38a377ac6cd3af1fa13a21d94870125d225bda86ad9b8 |
|
MD5 | 7806e0653c621fc821b5eb4238c409c1 |
|
BLAKE2b-256 | 630c01197764f42e42921910b1e71ecfc14097f7162e64a9d0740d407d55b1a0 |
File details
Details for the file kaldialign-0.6-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: kaldialign-0.6-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 61.7 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 553189e7a6b379dfa4596054daecbdfbf1a0d33be1e9b750a4f67477b209b199 |
|
MD5 | 5672b18c74a1b64c0552d4fd370f94ca |
|
BLAKE2b-256 | 97b01d780b71b68dc3554efabf816795dad9bd11d4c15d67d940cec081185133 |
File details
Details for the file kaldialign-0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: kaldialign-0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 81.3 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26eb569392bda5bfbb21c7dfb494a644639ea5a0dc3f0b12a921e2a2bd9d1a4a |
|
MD5 | a4f45dd99200276ae28b039e591ca1f5 |
|
BLAKE2b-256 | d512080ac897f913d567a0c1e0ff5ed820c7019624546ae03e3ae347740cf707 |
File details
Details for the file kaldialign-0.6-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: kaldialign-0.6-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 86.7 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d3857675ee3751de7f490bb3d49a02a5c74659211a20baf3858cdd9a91cfde1 |
|
MD5 | 69095714febe12c4885e208bebd8b16d |
|
BLAKE2b-256 | c2ea35cf27ca228b4de3471551fe3a4f546ae3cbff1d47e570f6d2737e919da9 |
File details
Details for the file kaldialign-0.6-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: kaldialign-0.6-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 53.2 kB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | de1349adcc1ce1cd8b33b90d1670d95c2f891e290e9a28d47d2e1d05b2bdc248 |
|
MD5 | 828fa35ee9daf530d841e25f522fb44f |
|
BLAKE2b-256 | fb275393905dd86e4b78a0de05762f51b427ed75667b952bc39de4a13c454069 |
File details
Details for the file kaldialign-0.6-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: kaldialign-0.6-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 61.8 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86a9052bfba2aed50e244d9ba547c481ef15a9d35afcda831a1c70472b1f22a3 |
|
MD5 | 568972fdcb7de4d3d7efe88c3ee05279 |
|
BLAKE2b-256 | 8cc1bc601629eb0b441aceb501a4b5a9ae4d68d8563d82c83086f9fcc9bfe357 |
File details
Details for the file kaldialign-0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: kaldialign-0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 81.5 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a87d13d496c23279d871f505998f7850ce4b3aa0d8d73efb9f4e72a4b3c28446 |
|
MD5 | 614a0907bc0a03c286d83e174e916466 |
|
BLAKE2b-256 | 9c92f2c58b762ee767e431eff96183fcc901384ba774aa63d15d2405d050c1b6 |
File details
Details for the file kaldialign-0.6-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: kaldialign-0.6-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 87.0 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a7ead2a2225aed4527dedabd2ca64dae69d264af559d72bd64611c62ee2f847 |
|
MD5 | 642ee11222c2aca78a9fdab04dc318ed |
|
BLAKE2b-256 | 1061897f9ce7fd3e186e0014e498b8db171343c8713aff54ce98da614f3906fa |
File details
Details for the file kaldialign-0.6-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: kaldialign-0.6-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 53.3 kB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18f823910ecb3321a1dcd1ae15e2ade71caa5b4782303dd2a51a0bd225de200d |
|
MD5 | bba396fc657d48804f88d7a483708868 |
|
BLAKE2b-256 | 5e0342bf4b0a6873b38a1880bdcafbd34eae4e905cad99c389713f94d97349da |
File details
Details for the file kaldialign-0.6-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: kaldialign-0.6-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 61.6 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0b208b0ec30d97630974d20503ea044d22aff029b6e2bffdf0a93139a0449cb |
|
MD5 | d9f673bf5cf384e6b197de94421a3f58 |
|
BLAKE2b-256 | 1dfa4eed93d83caa4b8512387ca615095bc2e137914f460ffdd6fc9c99e10de4 |
File details
Details for the file kaldialign-0.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: kaldialign-0.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 81.3 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27387fe8691c1a811831e7ac87a2475d2d66ce1406870aadc379052c5001952a |
|
MD5 | f7338f6e374245d4a119326c83f0684d |
|
BLAKE2b-256 | 549f0d34688f7891f5235a1201a36125416b51688e0f3c8ad3a7e72a5273d891 |
File details
Details for the file kaldialign-0.6-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: kaldialign-0.6-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 86.6 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4eaf6d8327e4e132e0c115113f625583ecc41a091cf8097fa5b4aa1230ab6b40 |
|
MD5 | 359340c98a8a833da40f73df0528db5c |
|
BLAKE2b-256 | 583f91fbe623af807332bbc803876503d1872a219ac6627e7366b7767622210c |
File details
Details for the file kaldialign-0.6-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: kaldialign-0.6-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 53.2 kB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cc99fd36222a7798e612b9ed600c91c74519e6dd930c5d17dd835c0808db2ae |
|
MD5 | 2b0bb70c5c135d14d79bdbfa21cfd84e |
|
BLAKE2b-256 | 661d175130ae8aa04996b3fe07faed21c31babb06b3e578ae57099dbf79d96c4 |
File details
Details for the file kaldialign-0.6-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: kaldialign-0.6-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 62.1 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e529544ff885fef798af98d8bcaef2ac1b08152a7b5f8204a1d99f049bcd5200 |
|
MD5 | b156aed4c5294bf8720a6bdd440da531 |
|
BLAKE2b-256 | 57ec9520eee6044038818a52ab3bbde529f4d16eb84da0d30c95f28014f5c451 |
File details
Details for the file kaldialign-0.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: kaldialign-0.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 82.2 kB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb093a29f0678bf9eae5ceecedea8c8d1c921426ee69d365de44cb174338ee00 |
|
MD5 | 8ba10c9ba3dc2b5efb86be2a986066a7 |
|
BLAKE2b-256 | 5e322b632bb151d10f00469a7418bd03acf0c5290839213ec3ce6093b27c12f0 |
File details
Details for the file kaldialign-0.6-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: kaldialign-0.6-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 88.0 kB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23d3d6720a72e668276dd45cd8051849bff4d7c0bc0acc5df628214db8b90d01 |
|
MD5 | 9bdd5bb5bdb2f7e8aeee7d05107c61f8 |
|
BLAKE2b-256 | 8f816c932b7630a2db5f052da81f70a06bd312711a92b4a31bf813a4df99ea1b |
File details
Details for the file kaldialign-0.6-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: kaldialign-0.6-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 53.2 kB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dda5dc4d0f1c7cc02de5c450562454f65818727d116065087a7434712c93f9a |
|
MD5 | 6c1263bb26150d17e89d104b3f59fa54 |
|
BLAKE2b-256 | 3d17ad91c3cfe3fe25ebea340b2d8a84c328c1b8034e8c852c460f3cc302dce5 |
File details
Details for the file kaldialign-0.6-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: kaldialign-0.6-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 62.1 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9f5eb68b1a348908a4a79fa582ff6852312bd35590b97337b00da50c0fd2316 |
|
MD5 | 531e9084b37f177199da55f481696aef |
|
BLAKE2b-256 | 3f3d6cf17adb58c399e4e7c8e166881de08496b49ce172b9afa9af8a3ff798e7 |
File details
Details for the file kaldialign-0.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: kaldialign-0.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 82.1 kB
- Tags: CPython 3.6m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c64321f49b6416631b4c5eccb465efe6c0469cb789cf4ca2d2591f5ce23ea698 |
|
MD5 | 43980e0b1517f6f31a5eab718253be6a |
|
BLAKE2b-256 | 44875e580c5dc250feb6f70a2c1741bf5f10f02e2bc1d915b26aa06b391bbcd9 |
File details
Details for the file kaldialign-0.6-cp36-cp36m-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: kaldialign-0.6-cp36-cp36m-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 87.9 kB
- Tags: CPython 3.6m, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a969bff1603a239658e979fc5cc8a36311837bb3cee828af6256cbb22621949 |
|
MD5 | c2d315b71ccb1a7b35060d5f43874618 |
|
BLAKE2b-256 | 355333aef7a94e989726ce25b6c18d38a4e844df4804168ecbc19677ca3a31c0 |
File details
Details for the file kaldialign-0.6-cp36-cp36m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: kaldialign-0.6-cp36-cp36m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 53.2 kB
- Tags: CPython 3.6m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4d0dc4075ee7b4f5d312161934a8a1b71c1bbbb353c0a414fd7703543f58616 |
|
MD5 | a6a56cf0b3c1f1334e4a46a2ed59ea96 |
|
BLAKE2b-256 | 4a951b2727917ca100115a105bf11b7c3ef912ffa67ee4c91a0ce7c162877bc8 |