Fast Neural Machine Translation Model from Chinese to Swedish

Description

Marian is an efficient, free Neural Machine Translation framework written in pure C++ with minimal dependencies. It is mainly being developed by the Microsoft Translator team. Many academic (most notably the University of Edinburgh and in the past the Adam Mickiewicz University in Poznań) and commercial contributors help with its development. It is currently the engine behind the Microsoft Translator Neural Machine Translation services and being deployed by many companies, organizations and research projects (see below for an incomplete list).

source languages: zh

target languages: sv

Download Copy S3 URI

How to use

documentAssembler = DocumentAssembler()\ 
.setInputCol("text")\ 
.setOutputCol("document")

sentencerDL = SentenceDetectorDLModel.pretrained("sentence_detector_dl", "xx")\ 
.setInputCols(["document"])\ 
.setOutputCol("sentences")

marian = MarianTransformer.pretrained("opus_mt_zh_sv", "xx")\ 
.setInputCols(["sentence"])\ 
.setOutputCol("translation")

val documentAssembler = new DocumentAssembler()
.setInputCol("text")
.setOutputCol("document")

val sentence = SentenceDetectorDLModel.pretrained("sentence_detector_dl", "xx")
.setInputCols("document")
.setOutputCol("sentence")

val marian = MarianTransformer.pretrained("opus_mt_zh_sv", "xx")
.setInputCols("sentence")
.setOutputCol("translation")

import nlu
text = ["text to translate"]
translate_df = nlu.load('xx.Chinese.translate_to.Swedish').predict(text, output_level='sentence')
translate_df

Model Information

Model Name: opus_mt_zh_sv
Compatibility: Spark NLP 3.1.0+
License: Open Source
Edition: Official
Input Labels: [sentence]
Output Labels: [translation]
Language: xx

Data Source

https://github.com/Helsinki-NLP/OPUS-MT-train/tree/master/models