lingtrain-aligner


Namelingtrain-aligner JSON
Version 0.7.6 PyPI version JSON
download
home_pagehttps://github.com/averkij/lingtrain-aligner
SummaryAlignment tool for texts in different languages
upload_time2022-05-14 05:59:29
maintainer
docs_urlNone
authorSergei Averkiev
requires_python>=3.6
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI - PyPi](https://img.shields.io/pypi/v/lingtrain-aligner)](https://pypi.org/project/lingtrain-aligner)

# Lingtrain Aligner

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

- 🔥 [How to create bilingual books. Part 2. Lingtrain Alignment Studio](https://habr.com/ru/post/590549/)
- 💡 [Lingtrain Aligner. How to make parallel books for language learning. Part 1. Python and Colab version](https://habr.com/ru/post/586574/)

![Cover](https://i.imgur.com/WQWB4v0.png)

## 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](https://arxiv.org/abs/2004.09813)
- **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](https://arxiv.org/abs/2007.01852)

## 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. 



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/averkij/lingtrain-aligner",
    "name": "lingtrain-aligner",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Sergei Averkiev",
    "author_email": "averoo@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/3b/dd/2d2628f92f64b4489f4c480b49318d1066064bb8f03f71aeebcc52b8ecba/lingtrain-aligner-0.7.6.tar.gz",
    "platform": null,
    "description": "[![PyPI - PyPi](https://img.shields.io/pypi/v/lingtrain-aligner)](https://pypi.org/project/lingtrain-aligner)\n\n# Lingtrain Aligner\n\nML powered library for the accurate texts alignment in different languages.\n\n- \ud83d\udd25 [How to create bilingual books. Part 2. Lingtrain Alignment Studio](https://habr.com/ru/post/590549/)\n- \ud83d\udca1 [Lingtrain Aligner. How to make parallel books for language learning. Part 1. Python and Colab version](https://habr.com/ru/post/586574/)\n\n![Cover](https://i.imgur.com/WQWB4v0.png)\n\n## Purpose\n\nMain 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_ \u2014 it's translation into English.\n\n## Process\n\nThere are plenty of obstacles during the alignment process:\n\n- The translator could translate several sentences as one.\n- The translator could translate one sentence as many.\n- There are some service marks in the text\n    - Page numbers\n    - Chapters and other section headings\n    - Author and title information\n    - Notes\n\nWhile service marks can be handled manually (the tool helps to detect them), the translation conflicts should be handled more carefully.\n\nLingtrain 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.\n\n### Supported languages and models\n\nAutomated 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.\n\n- **distiluse-base-multilingual-cased-v2**\n  - more reliable and fast\n  - moderate weights size \u2014 500MB\n  - supports 50+ languages\n  - full list of supported languages can be found in [this paper](https://arxiv.org/abs/2004.09813)\n- **LaBSE (Language-agnostic BERT Sentence Embedding)**\n  - can be used for rare languages\n  - pretty heavy weights \u2014 1.8GB\n  - supports 100+ languages\n  - full list of supported languages can be found [here](https://arxiv.org/abs/2007.01852)\n\n## Profit\n\n- Parallel corpora by itself can used as the resource for machine translation models or for linguistic researches.\n- My personal goal of this project is to help people building parallel translated books for the foreign language learning. \n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Alignment tool for texts in different languages",
    "version": "0.7.6",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "495447ac923969b8197c0f59267ea5d7",
                "sha256": "222f2aaa01ef02ac6828639957b4e7e0fdacf19b279f624bbf6f700ee9e92082"
            },
            "downloads": -1,
            "filename": "lingtrain_aligner-0.7.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "495447ac923969b8197c0f59267ea5d7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 47056,
            "upload_time": "2022-05-14T05:59:28",
            "upload_time_iso_8601": "2022-05-14T05:59:28.072925Z",
            "url": "https://files.pythonhosted.org/packages/11/ca/23334131596faf0605dd9e7aef74cd84d8f238212061c904183ed31cb4a5/lingtrain_aligner-0.7.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "711fb1f6af55f9b5b988d3ec0f6cef99",
                "sha256": "d23302189900be520ee5e552c32aeb33c82d2e0d7283c4da0ea6fb23e3709d93"
            },
            "downloads": -1,
            "filename": "lingtrain-aligner-0.7.6.tar.gz",
            "has_sig": false,
            "md5_digest": "711fb1f6af55f9b5b988d3ec0f6cef99",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 44698,
            "upload_time": "2022-05-14T05:59:29",
            "upload_time_iso_8601": "2022-05-14T05:59:29.879211Z",
            "url": "https://files.pythonhosted.org/packages/3b/dd/2d2628f92f64b4489f4c480b49318d1066064bb8f03f71aeebcc52b8ecba/lingtrain-aligner-0.7.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-05-14 05:59:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "averkij",
    "github_project": "lingtrain-aligner",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "lingtrain-aligner"
}
        
Elapsed time: 0.37594s