Skip to main content

Alignment tool for texts in different languages

Project description

PyPI - PyPi Downloads

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
  • SONAR (Sentence-level multimOdal and laNguage-Agnostic Representations)

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-1.0.2.tar.gz (66.3 kB view details)

Uploaded Source

Built Distribution

lingtrain_aligner-1.0.2-py3-none-any.whl (68.3 kB view details)

Uploaded Python 3

File details

Details for the file lingtrain_aligner-1.0.2.tar.gz.

File metadata

  • Download URL: lingtrain_aligner-1.0.2.tar.gz
  • Upload date:
  • Size: 66.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for lingtrain_aligner-1.0.2.tar.gz
Algorithm Hash digest
SHA256 8fe1c2cc548a27b8d72284a6d8a5ed5984803d127d8233c5f9080112209906f4
MD5 7a5258f185c13c816823aac10647cfac
BLAKE2b-256 98a84a448058f9fb200742578db6e62267715c929ad4fe377949e87f01a04c84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lingtrain_aligner-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bdd0085a74807fc717793a6647be00cbb6a8f2b842a272652b19ac3a873ebe8a
MD5 e2072eb3967085c54f3252201c565066
BLAKE2b-256 e546ad46c66b66698730e983719650ae8e404e9e9c775e2cccef74e6685fb66b

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