Socket
Socket
Sign inDemoInstall

translation-quality-estimator

Package Overview
Dependencies
1
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    translation-quality-estimator

To estimate the quality of translation


Maintainers
1

Readme

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

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc