DeepsetDeepLTextTranslator
Translates text into the language you choose using the DeepL Python SDK.
Basic Information
- Type:
deepset_cloud_custom_nodes.converters.deepl_translator.DeepsetDeepLTextTranslator - Components it can connect with:
- Any component that accepts
stringas input or returnsstringas its output.
- Any component that accepts
Inputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| text | str | Text to translate. |
Outputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| text | str | The translated text. | |
| meta | Dict[str, Any] | 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 AI Platform on the Integrations page:
Connection Instructions
- Click your profile icon in the top right corner and choose Integrations.

- Click Connect next to the provider.
- Enter your API key and submit it.
Once deepset is connected, you can use DeepsetDeepLTextTranslator without passing the API key in the pipeline YAML.
Usage Example
Initializing the Component
components:
DeepsetDeepLTextTranslator:
type: converters.deepl_translator.DeepsetDeepLTextTranslator
init_parameters:
Parameters
Init Parameters
These are the parameters you can configure in Pipeline Builder:
| Parameter | Type | Default | Description |
|---|---|---|---|
| target_language | str | The code of the language you want to translate into. For a list of codes, see DeepL documentation. | |
| source_language | Optional[str] | None | The source language code. If None, the source language is auto-detected. For a list of codes, see DeepL documentation. |
| api_key | Secret | Secret.from_env_var('DEEPL_API_KEY') | DeepL API key. |
| preserve_formatting | Optional[bool] | None | Controls automatic formatting correction. If None, prevents automatic correction of formatting. |
| split_sentences | Literal[0, 1, 'nonewlines', None] | None | Controls how the translation engine should split input into sentences before translation. Sets whether the translation engine should first split the input into sentences. This is enabled by default. Possible values are: - 0: 0 means OFF. No splitting at all, whole input is treated as one sentence. Use this option if the input text is already split into sentences, to prevent the engine from splitting the sentence unintentionally. - 1: 1 means ALL. (default) splits on punctuation and on newlines. - 'nonewlines': splits on punctuation only, ignoring newlines. |
| context | Optional[str] | None | Use this setting 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 more information and examples, refer to the DeepL API documentation. |
| formality | Literal[None, 'less', 'default', 'more', 'prefer_more', 'prefer_less'] | None | Controls whether translations should lean toward informal or formal language. This feature currently only works for the following languages DE (German), FR (French), IT (Italian), ES (Spanish), NL (Dutch), PL (Polish), PT-BR and PT-PT (Portuguese), JA (Japanese), and RU (Russian). The available options are: - 'less': Translate using informal language. - 'default': Translate using the default formality. - 'more': Translate using formal language. - 'prefer_more': Translate using formal language if the target language supports formality, otherwise use default formality. - 'prefer_less': Translate using informal language if the target language supports formality, otherwise use default formality. |
| max_retries | Optional[int] | 5 | Maximum number of network retries after a failed HTTP request. Default retries is set to 5. |
| glossary | Union[str, None] | None | (Optional) glossary ID to use for translation. Must match specified source_lang and target_lang. |
| tag_handling | Literal[None, 'xml', 'html'] | None | (Optional) Type of tags to parse before translation, only "xml" and "html" are currently available. |
| outline_detection | Optional[bool] | None | (Optional) Set to False to disable automatic tag detection. |
| non_splitting_tags | Union[str, List[str], None] | None | (Optional) XML tags that should not split a sentence. |
| splitting_tags | Union[str, List[str], None] | None | (Optional) XML tags that should split a sentence. |
| ignore_tags | Union[str, List[str], None] | None | (Optional) XML tags containing text that should not be translated. |
Run Method Parameters
These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.
| Parameter | Type | Default | Description |
|---|---|---|---|
| text | str | Text to translate. |
Was this page helpful?