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
translateModule - Available Models in the
translateModule - Model Parameters in the
translateModule - Input File Size Limit
- A Single-Module Pipeline for the
translateModule - Further Information on
translateModule IO and Clickability
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:
-
opus-mt-en-es - (default) English to Spanish
-
opus-mt-es-en - Spanish to English
-
opus-mt-de-en - German to English
-
opus-mt-en-fr - English to French
-
opus-mt-fr-en - French to English
-
opus-mt-it-en - Italian to English
-
opus-mt-zh-en - Chinese to English
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: