Skip to main content

Alignment tool based on fast_align

Project description

systran-align

systran-align is a small alignment tool that is based on https://github.com/clab/fast_align.

Installation

pip install systran-align

Usage

import systran_align

Generating alignment probabilities

systran_align.generate_alignment_probabilities(
    input_path: str,
    forward_probs_path: str,
    backward_probs_path: str,
    verbose: bool = False,
    iterations: int = 5,
    favor_diagonal: bool = False,
    beam_threshold: float = -4,
    diagonal_tension: float = 4,
    optimize_tension: bool = False,
    variational_bayes: bool = False,
    alpha: float = 0.01,
    no_null_word: bool = False,
    prob_align_null: float = 0.08,
    thread_buffer_size: int = 10000)

Computing alignments

aligner = systran_align.Aligner(
    forward_probs_path: str,
    backward_probs_path: str)

# result is a dict with fields:
# * alignments
# * forward_log_prob
# * backward_log_prob
result = aligner.align(
    source: list,
    target: list)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

systran_align-3.1.1-cp38-cp38-manylinux1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.8

systran_align-3.1.1-cp37-cp37m-manylinux1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.7m

systran_align-3.1.1-cp36-cp36m-manylinux1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.6m

systran_align-3.1.1-cp35-cp35m-manylinux1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.5m

systran_align-3.1.1-cp27-cp27mu-manylinux1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 2.7mu

systran_align-3.1.1-cp27-cp27m-manylinux1_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 2.7m

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