Skip to main content

Alignment tool for texts in different languages

Project description

PyPI - PyPi

Lingtrain Aligner

ML powered library for the accurate texts alignment in different languages.

Cover

Purpose

Main purpose of this alignment tool is to build parallel corpora using two or more raw texts in different languages. Texts should contain the same information (i.e., one text should be a translated analog oh the other text). E.g., it can be the Drei Kameraden by Remarque in German and the Three Comrades — it's translation into English.

Process

There are plenty of obstacles during the alignment process:

  • The translator could translate several sentences as one.
  • The translator could translate one sentence as many.
  • There are some service marks in the text
    • Page numbers
    • Chapters and other section headings
    • Author and title information
    • Notes

While service marks can be handled manually (the tool helps to detect them), the translation conflicts should be handled more carefully.

Lingtrain Aligner tool will do almost all alignment work for you. It matches the sentence pairs automatically using the multilingual machine learning models. Then it searches for the alignment conflicts and resolves them. As output you will have the parallel corpora either as two distinct plain text files or as the merged corpora in widely used TMX format.

Supported languages and models

Automated alignment process relies on the sentence embeddings models. Embeddings are multidimensional vectors of a special kind which are used to calculate a distance between the sentences. Supported languages list depend on the selected backend model.

  • distiluse-base-multilingual-cased-v2
    • more reliable and fast
    • moderate weights size — 500MB
    • supports 50+ languages
    • full list of supported languages can be found in this paper
  • LaBSE (Language-agnostic BERT Sentence Embedding)
    • can be used for rare languages
    • pretty heavy weights — 1.8GB
    • supports 100+ languages
    • full list of supported languages can be found here

Profit

  • Parallel corpora by itself can used as the resource for machine translation models or for linguistic researches.
  • My personal goal of this project is to help people building parallel translated books for the foreign language learning.

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

lingtrain-aligner-0.6.9.tar.gz (42.9 kB view details)

Uploaded Source

Built Distribution

lingtrain_aligner-0.6.9-py3-none-any.whl (45.3 kB view details)

Uploaded Python 3

File details

Details for the file lingtrain-aligner-0.6.9.tar.gz.

File metadata

  • Download URL: lingtrain-aligner-0.6.9.tar.gz
  • Upload date:
  • Size: 42.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.6

File hashes

Hashes for lingtrain-aligner-0.6.9.tar.gz
Algorithm Hash digest
SHA256 1a5eb70823bad070ad883bb9048c922e079d852ae34956789e85f663a0f25d39
MD5 be41be9629242479f7ee74774b2caaca
BLAKE2b-256 0b571cf7a47dce241d3f7b8428eabe14d516ffd70fb9d5ca155cc38ce3058e17

See more details on using hashes here.

File details

Details for the file lingtrain_aligner-0.6.9-py3-none-any.whl.

File metadata

  • Download URL: lingtrain_aligner-0.6.9-py3-none-any.whl
  • Upload date:
  • Size: 45.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.6

File hashes

Hashes for lingtrain_aligner-0.6.9-py3-none-any.whl
Algorithm Hash digest
SHA256 df64d3e92ed7753655ce8122770d8db4dfd91740f73809486163f68c12259a3a
MD5 9928f892188009347523cddecb8f06e9
BLAKE2b-256 e209c412d9ebdbf3554b676990869eff74ca5f6e2966846f4cfb8f530f452ad4

See more details on using hashes here.

Supported by

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