lingtrain-aligner


Namelingtrain-aligner JSON
Version 0.9.7 PyPI version JSON
download
home_pagehttps://github.com/averkij/lingtrain-aligner
SummaryAlignment tool for texts in different languages
upload_time2024-03-20 07:29:57
maintainerNone
docs_urlNone
authorSergei Averkiev
requires_python>=3.6
licenseNone
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) [![Downloads](https://static.pepy.tech/personalized-badge/lingtrain-aligner?period=total&units=abbreviation&left_color=grey&right_color=green&left_text=Downloads)](https://pepy.tech/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": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Sergei Averkiev",
    "author_email": "averoo@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/24/24/77c9f9ff4679c8058feaa551e5b8084d37be9f6cc6c187e1140cc507e2ca/lingtrain-aligner-0.9.7.tar.gz",
    "platform": null,
    "description": "[![PyPI - PyPi](https://img.shields.io/pypi/v/lingtrain-aligner)](https://pypi.org/project/lingtrain-aligner) [![Downloads](https://static.pepy.tech/personalized-badge/lingtrain-aligner?period=total&units=abbreviation&left_color=grey&right_color=green&left_text=Downloads)](https://pepy.tech/project/lingtrain-aligner)\r\n\r\n# Lingtrain Aligner\r\n\r\nML powered library for the accurate texts alignment in different languages.\r\n\r\n- \ud83d\udd25 [How to create bilingual books. Part 2. Lingtrain Alignment Studio](https://habr.com/ru/post/590549/)\r\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/)\r\n\r\n![Cover](https://i.imgur.com/WQWB4v0.png)\r\n\r\n## Purpose\r\n\r\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.\r\n\r\n## Process\r\n\r\nThere are plenty of obstacles during the alignment process:\r\n\r\n- The translator could translate several sentences as one.\r\n- The translator could translate one sentence as many.\r\n- There are some service marks in the text\r\n    - Page numbers\r\n    - Chapters and other section headings\r\n    - Author and title information\r\n    - Notes\r\n\r\nWhile service marks can be handled manually (the tool helps to detect them), the translation conflicts should be handled more carefully.\r\n\r\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.\r\n\r\n### Supported languages and models\r\n\r\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.\r\n\r\n- **distiluse-base-multilingual-cased-v2**\r\n  - more reliable and fast\r\n  - moderate weights size \u2014 500MB\r\n  - supports 50+ languages\r\n  - full list of supported languages can be found in [this paper](https://arxiv.org/abs/2004.09813)\r\n- **LaBSE (Language-agnostic BERT Sentence Embedding)**\r\n  - can be used for rare languages\r\n  - pretty heavy weights \u2014 1.8GB\r\n  - supports 100+ languages\r\n  - full list of supported languages can be found [here](https://arxiv.org/abs/2007.01852)\r\n\r\n## Profit\r\n\r\n- Parallel corpora by itself can used as the resource for machine translation models or for linguistic researches.\r\n- My personal goal of this project is to help people building parallel translated books for the foreign language learning. \r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Alignment tool for texts in different languages",
    "version": "0.9.7",
    "project_urls": {
        "Bug Tracker": "https://github.com/averkij/lingtrain-aligner/issues",
        "Homepage": "https://github.com/averkij/lingtrain-aligner"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a811a0df2315aea654006d9f2a068a66366388a8908b7e7f252ba1ac258cd770",
                "md5": "a86b748dc064e3dc27afcc0c9e138b33",
                "sha256": "442afd8eb0fefc7b69000f6e116b72eaf024e89a170d0b2a9d02df221e944b35"
            },
            "downloads": -1,
            "filename": "lingtrain_aligner-0.9.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a86b748dc064e3dc27afcc0c9e138b33",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 51881,
            "upload_time": "2024-03-20T07:29:53",
            "upload_time_iso_8601": "2024-03-20T07:29:53.225836Z",
            "url": "https://files.pythonhosted.org/packages/a8/11/a0df2315aea654006d9f2a068a66366388a8908b7e7f252ba1ac258cd770/lingtrain_aligner-0.9.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "242477c9f9ff4679c8058feaa551e5b8084d37be9f6cc6c187e1140cc507e2ca",
                "md5": "93e7ef830b3cca88e5cd9e4b72fe441f",
                "sha256": "8bb34ab98b3b3bd908cd5a026043016383da96b45b3544ce65ef4c3402276e8b"
            },
            "downloads": -1,
            "filename": "lingtrain-aligner-0.9.7.tar.gz",
            "has_sig": false,
            "md5_digest": "93e7ef830b3cca88e5cd9e4b72fe441f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 49745,
            "upload_time": "2024-03-20T07:29:57",
            "upload_time_iso_8601": "2024-03-20T07:29:57.169868Z",
            "url": "https://files.pythonhosted.org/packages/24/24/77c9f9ff4679c8058feaa551e5b8084d37be9f6cc6c187e1140cc507e2ca/lingtrain-aligner-0.9.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-20 07:29:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "averkij",
    "github_project": "lingtrain-aligner",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "lingtrain-aligner"
}
        
Elapsed time: 0.21404s