DeepsetDeepLTextTranslator
Translate text using DeepL Python SDK.
Basic Information
- Pipeline type: Indexing and Query
- Type:
deepset_cloud_custom_nodes.converters.deepl_translator.DeepsetDeepLTextTranslator
- Components it can connect with:
- Any component that accepts
string
as input or returnsstring
as its output.
- Any component that accepts
Inputs
Name | Type | Description |
---|---|---|
text | String | The text to be translated. |
Outputs
Name | Type | Description |
---|---|---|
text | String | The translated text. |
meta | Dictionary | The metadata related to the translation, such as the source and target language. |
Overview
DeepsetDeepLTextTranslator uses the DeepL Python library to translate text into the languages you specify. For a list of supported languages, see DeepL documentation.
Authorization
You must have an active DeepL account and a DeepL API key to use this component. Connect DeepL to deepset Cloud on the Connections page:
-
Click your initials in the top right corner and select Connections.
-
Click Connect next to the provider.
-
Enter your user access token and submit it.
Once deepset Cloud is connected, you can use DeepsetDeepLTextTranslator without passing the API key in the pipeline YAML.
Init Parameters
Parameter | Type | Possible values | Description |
---|---|---|---|
target_language | List of strings | For a list of possible options, see DeepL documentation. | Codes of languages you want to translate your documents into. Required. |
source_language | String | Default: None | The language of the documents you want to translate. If None , it's automatically detected. For a list of possible options, see DeepL documentation.Optional. |
api_key | Secret | Default: Secret.from_env_var("DEEPL_API_TOKEN") | The DeepL API key. Required. |
preserve_formatting | Boolean | Default: True | Controls automatic formatting correction. When True , prevents automatic correction of formatting.Optional |
context | String | Default: None | Use this parameter to include additional context that can influence a translation without being translated itself. Providing additional context can potentially improve translation quality, especially for short, low-context source texts such as product names on an e-commerce website, article headlines on a news website, or UI elements. For details, see DeepL API documentation. Optional. |
formality | String | less more Default: None | Controls whether translations lean toward informal or formal language. This works only for target languages: German (DE), French (FR), Italian (IT), Spanish (ES), Dutch (NL), Polish (PL), Portugese (PT_BR and PT_PT), Japanese (JA), and Russian (RU). Possible values: - less : Uses more informal language- more : Uses more polite and formal language.Optional. |
max_retries | Integer | Default: 5 | The maximum number of network retries after a failed HTTP request. Optional. |
Updated about 2 hours ago
Related Links