Alignment tool for texts in different languages
Project description
Lingtrain Aligner
ML powered library for the accurate texts alignment in different languages.
- 🔥 How to create bilingual books. Part 2. Lingtrain Alignment Studio
- 💡 Lingtrain Aligner. How to make parallel books for language learning. Part 1. Python and Colab version
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)
- Supports about 200 languages (approximately these)
- A large model (3 GB of weights)
- Ideally, requires you to indicate the source language explicitly
- Was originally released at facebookresearch/SONAR based on fairseq2, but here uses a HuggingFace port.
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
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 Distribution
Built Distribution
File details
Details for the file lingtrain_aligner-0.9.11.tar.gz
.
File metadata
- Download URL: lingtrain_aligner-0.9.11.tar.gz
- Upload date:
- Size: 51.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7af0213d44705845e19a301b47b89f2d453a55c124c3cf6a90e4b177767b254 |
|
MD5 | 67e358589c9344daec84aa2968eaa81b |
|
BLAKE2b-256 | 0e3c157b61b63e11a3376b9171ceeb3a86db65304f73f2498c0f81f9e142975d |
File details
Details for the file lingtrain_aligner-0.9.11-py3-none-any.whl
.
File metadata
- Download URL: lingtrain_aligner-0.9.11-py3-none-any.whl
- Upload date:
- Size: 54.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91f4820e844cc8a239a5c6189d204a701a764465a52b3070e332c17e6c99e9b6 |
|
MD5 | 7014e37a3724518698fb0db58975ab83 |
|
BLAKE2b-256 | 4e03e6ded141189b540ae890ad4ec96209b06091b3ed35cdadedb27ea9cb6665 |