Skip to content

String-specific context for DeepL machine translation #15188

@michael-smt

Description

@michael-smt

Describe the problem

In the DeepL machine translation there is no unit-specific context like the explanation field is considered. Providing more context might help to get better results, especially for short strings.

Solution brainstorm

Provide a setting in the DeepL machinery to enable strings specific context.
Enabling it would mean:

  • no more batching (slower, more expensive)
  • context from the machinery settings is expanded with explanation and possibly other sources, like nearby keys.

Describe alternatives you have considered

Just merge the set of explanations of all keys set to the API: This might lead even worse results because the context might be confusing/contradictory and won't apply to the whole batch of texts.

Allow placeholders for context sources like explanation in the context setting of the machinery configuration: over-complicated with little benefit compared to simple appending.

Skip batching only on keys that have a explanation text: could be a future optimization.

Screenshots

No response

Additional context

Similar requests exists for LLM based machine translations.

Weblate currently tries to batch the translation by passing more strings at once while doing automatic translations. Besides speed and costs, this helps quality as well, as the LLM sees more strings at once and keeps the translations more consistent. But this makes adding additional information per string tricky. Passing explanation might also be useful, see https://github.com/orgs/WeblateOrg/discussions/14273.

Originally posted by @nijel in #13398

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: Automatic translationIssues related to automatic translations, automatic suggestions, fuzzy matching etc.Waiting for: DemandLow priority for development. Pull requests welcome. Can be prioritized by sponsorship.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions