DeepL Translation¶
Translate a text column into another language using the DeepL Translation API.
This capability is provided by the DeepL Translation plugin, which you need to install. Please see Installing plugins.
Check DeepL’s pricing page for information about their pricing tiers.
How to set up¶
If you are a Dataiku admin user, follow these configuration steps right after you install the plugin. If you are not an admin, you can forward this to your admin and scroll down to the How to use section.
Create a DeepL account & get your DeepL API Key¶
In order to use the DeepL Translation API, you need a DeepL API Free or DeepL API Pro account. Follow the DeepL API signup instructions. A DeepL Translator account alone does not provide API access.
Once your API account is set up, retrieve your API key from your DeepL account. You will need this key to use DeepL in Dataiku.
Create an API configuration preset – in Dataiku¶
In Dataiku, open the DeepL Translation plugin, navigate to Settings > API configuration, and create your first preset.
Configure the preset – in Dataiku¶
Fill the AUTHENTICATION settings
Copy-paste your DeepL API key in the corresponding field.
In DeepL URL, select DeepL Free or DeepL Pro to match your API subscription.
(Optional) Review the PARALLELIZATION and ATTEMPTS settings
The default Concurrency parameter means that 4 threads will call the API in parallel.
Note
We do not recommend changing this default parameter unless your server has a much higher number of CPU cores.
The Maximum Attempts means that if an API request fails it will be reattempted (default 3 attempts). Regardless of whether the request fails because of e.g. an access error with your DeepL account or a throttling exception due to too many concurrent requests, it will be tried again.
The Waiting Interval specifies how long to wait before retrying a failed attempt (default 5 seconds). In case of a throttling exception due to too many requests increasing the Waiting Interval may help, however, we recommend first decreasing the Concurrency setting.
Set the Permissions of your preset
You can declare yourself as the Owner of this preset and make it available to everybody, or to a specific group of users.
Any user belonging to one of those groups on your Dataiku instance will be able to see and use this preset.
Your preset is now ready to be used.
Configuring additional presets can be useful to segment plugin usage by user group. For instance, you can create a “Default” preset for everyone and a “High performance” one for your Marketing team, with separate billing for each team.
How to use¶
Let’s assume that you have installed this plugin and that you have a Dataiku project with a dataset containing a column of text to translate.
DeepL Translation recipe¶
To create your first recipe, navigate to the Flow, click on the + RECIPE button and access the Natural Language Processing menu. If your dataset is selected, you can directly find the plugin in the right panel.
Input¶
Dataset with a text column to translate.
Settings¶
Review INPUT parameters
The Text column parameter is the column in the input dataset that you wish to translate.
The Source language parameter is the original language of the Text column. If you would like the translation API to infer the original language, you can select the Auto-detect option. Select the source and target languages from the choices available in the recipe.
The Target language parameter is the language you would like to translate to.
The Split Sentences parameter sets whether the translation engine should first split the input into sentences. This is enabled by default. For applications that send one sentence per row, it is advisable to set it to Splits: None in order to prevent the engine from splitting the sentence unintentionally.
The Preserve Formatting parameter sets whether the translation engine should respect the formatting of the input text, even if it would usually correct some aspects.
The Formality parameter can be used to increase or decrease how formal the output translation should be. It only shows up if formality is available for the chosen target language.
Review CONFIGURATION parameters
Select the API configuration preset made available by your Dataiku admin.
The Fail on error parameter lets you choose whether the recipe should abort execution on an HTTP API error. If unchecked, HTTP API errors are logged in two additional columns in the output. Other failures, such as connection errors, can still abort execution.
Output¶
Dataset with text translated to another language.
The columns of the output dataset are as follows:
Column |
Description |
|---|---|
[Input dataset columns] |
All columns from the input dataset will be preserved |
[selected column]_language |
The detected language of the selected column. Only present if Auto-detect has been selected as the source language |
[selected column]_{target language code} |
The selected column in its translated version. Hyphens in the target language code become underscores, for example text_EN_US for target EN-US |
translation_api_response |
Raw API response in JSON form |
translation_api_error_message |
The error message in case an error occurred. Only present if Fail on error is not selected during configuration |
translation_api_error_type |
The error type in case an error occurred. Only present if Fail on error is not selected during configuration |