Skip to main content

To estimate the quality of translation

Project description

PyPI - Python PyPI - License PyPI - PyPi

Translation Quality Estimator

Translation Quality Estimator is a simple but powerful way of estimating the quality of translations in over a hundred languages. It takes two lists of strings as input and returns the cosine similarity scores between their embeddings.

Table of Contents

  1. About the Project
  2. Getting Started
    2.1. Installation
    2.2. Basic Usage

1. About the Project

The approach focuses on generating language agnostic state-of-the-art 🤗 transformer embeddings for the list of string pairs (provided as an input) and measures performance by calculating the cosine similarity between the embeddings. The similarity scores range between [0, 1] with higher referring to better quality of translations.

The aim of this project is to create a quick and easy method for estimating the quality of translation of strings.

2. Getting Started

2.1. Installation

PyTorch 1.2.0 or higher is recommended. If the install below gives an error, please install pytorch first here.

Installation can be done using pypi

pip install translation-quality-estimator

2.2. Usage

The most minimal example can be seen below for translation quality estimation between two lists of strings:

from tqe import TQE

lang_1 = ["what are you doing", "what is your name"]
lang_2 = ["तुम क्या कर रहे हो", "तुम्हारा नाम क्या है"]

model = TQE('LaBSE')
cos_sim_values = model.fit(lang_1, lang_2)
print(cos_sim_values)

NOTE: For a full overview of all possible multi-lingual transformer models see sentence-transformer. I would advise using 'LaBSE' but you can also test out any 'XLM-R' or 'Multilingual-BERT' based models.

License

MIT

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

translation-quality-estimator-0.1.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

translation_quality_estimator-0.1.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file translation-quality-estimator-0.1.1.tar.gz.

File metadata

  • Download URL: translation-quality-estimator-0.1.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.9

File hashes

Hashes for translation-quality-estimator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 582f73d56ba9833746cb4f32e3407489ac0311d2e165c9ca3ec4ce2dc5417ea7
MD5 2182b56e29a648986e0a109d4aa7f294
BLAKE2b-256 3285f4d4fe3c0c291424a34ddf640117babee3cc3fc84ee0ffff681ae73d6c9a

See more details on using hashes here.

File details

Details for the file translation_quality_estimator-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: translation_quality_estimator-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.9

File hashes

Hashes for translation_quality_estimator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f7b22aff97de63be0306e63e60c9f02ece9603e1af7eeb31fe7ba2f3e1a2795
MD5 2a30f42a45927063997d6cd069e21094
BLAKE2b-256 c8a76c898c12e6a4989e5228701994966b83ef4288c448ae7e02bf061e6ac7c0

See more details on using hashes here.

Supported by

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