To estimate the quality of translation
Project description
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
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
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
Hashes for translation-quality-estimator-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 582f73d56ba9833746cb4f32e3407489ac0311d2e165c9ca3ec4ce2dc5417ea7 |
|
MD5 | 2182b56e29a648986e0a109d4aa7f294 |
|
BLAKE2b-256 | 3285f4d4fe3c0c291424a34ddf640117babee3cc3fc84ee0ffff681ae73d6c9a |
Hashes for translation_quality_estimator-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f7b22aff97de63be0306e63e60c9f02ece9603e1af7eeb31fe7ba2f3e1a2795 |
|
MD5 | 2a30f42a45927063997d6cd069e21094 |
|
BLAKE2b-256 | c8a76c898c12e6a4989e5228701994966b83ef4288c448ae7e02bf061e6ac7c0 |