hf_mirrors/opus-mt-ru-en-openmind
Model Introduction
Files & versions
Analysis

opus-mt-ru-en

Table of Contents

  • Model Details
  • Uses
  • Risks, Limitations and Biases
  • Training
  • Evaluation
  • Citation Information
  • How to Get Started With the Model

Model Details

Model Description:

  • Developed by: Language Technology Research Group at the University of Helsinki
  • Model Type: Transformer-align
  • Language(s):
    • Source Language: Russian
    • Target Language: English
  • License: CC-BY-4.0
  • Resources for more information:
    • GitHub Repo

Use in Openmind

import argparse
import time
import torch
from openmind import pipeline, is_torch_npu_available


def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--model_name_or_path",
        type=str,
        help="Path to model",
        default="jeffding/opus-mt-ru-en-openmind",
    )

    args = parser.parse_args()
    return args


def main():
    args = parse_args()
    model_path = args.model_name_or_path

    if is_torch_npu_available():
        device = "npu:0"
    else:
        device = "cpu"
        
    start_time = time.time()

    translator = pipeline("translation", model=model_path, framework="pt", device=device)
    
    output = translator("С Новым 2025 годом!.")
    print(output)
    
    end_time = time.time()
    print(f"硬件环境:{device},推理执行时间:{end_time - start_time}秒")

if __name__ == "__main__":
    main()

Uses

Direct Use

This model can be used for translation and text-to-text generation.

Risks, Limitations and Biases

CONTENT WARNING: Readers should be aware this section contains content that is disturbing, offensive, and can propagate historical and current stereotypes.

Significant research has explored bias and fairness issues with language models (see, e.g., Sheng et al. (2021) and Bender et al. (2021)).

Further details about the dataset for this model can be found in the OPUS readme: ru-en

Training

Training Data

Preprocessing
  • Pre-processing: Normalization + SentencePiece

  • Dataset: opus

  • Download original weights: opus-2020-02-26.zip

  • Test set translations: opus-2020-02-26.test.txt

Evaluation

Results

  • test set scores: opus-2020-02-26.eval.txt

Benchmarks

testsetBLEUchr-F
newstest2012.ru.en34.80.603
newstest2013.ru.en27.90.545
newstest2014-ruen.ru.en31.90.591
newstest2015-enru.ru.en30.40.568
newstest2016-enru.ru.en30.10.565
newstest2017-enru.ru.en33.40.593
newstest2018-enru.ru.en29.60.565
newstest2019-ruen.ru.en31.40.576
Tatoeba.ru.en61.10.736

Citation Information

@InProceedings{TiedemannThottingal:EAMT2020,
  author = {J{\"o}rg Tiedemann and Santhosh Thottingal},
  title = {{OPUS-MT} — {B}uilding open translation services for the {W}orld},
  booktitle = {Proceedings of the 22nd Annual Conferenec of the European Association for Machine Translation (EAMT)},
  year = {2020},
  address = {Lisbon, Portugal}
 }

How to Get Started With the Model

from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("Helsinki-NLP/opus-mt-ru-en")

model = AutoModelForSeq2SeqLM.from_pretrained("Helsinki-NLP/opus-mt-ru-en")