Skip to content

translation

The translate Module

🇨🇴 Versión en español de este documento

The translate module takes one or several text snippets and returns their translations in the selected model's output language.

This overview of the translate module is divided into the following sections:

Inputs and Outputs of the translate Module

The translate module accepts JSON file input. The input JSON must respect this format.

The translate module returns a JSON file. The returned JSON file is in the same format as the input file, but each snippet has been translated.

Available Models in the translate Module

You can activate any of the following models when using the translate module:

Use the modules argument in the process method to determine what model you'd like active when you process files through the translate module.

Model Parameters in the translate Module

None of the translate module models are parameterizable. Consequently, when selecting what model you'll use through the process method's modules argument, params will always be set to an empty dictionary. For example:

# example model selection for translate module in process
modules={'translate': {'model':'opus-mt-zh-en',
                       'params': {}}}

Input File Size Limit

translate module input JSON files can currently be no larger than 3MB.

A Single-Module Pipeline for the translate Module

Please click here to visit the Pipeline Examples section of our documentation and review an example of a single-module pipeline for the translate module.

Further Information on translate Module IO and Clickability

Please click here to visit the Convenience Methods (and More!) documentation. There you will find two tools to learn more about the translate module: