Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation adpater support #1809

Closed
wants to merge 2 commits into from

Conversation

sushmanthreddy
Copy link
Contributor

@sushmanthreddy sushmanthreddy commented Nov 16, 2024

Hello @chenmoneygithub @okhat

close #1803
Added two different translation adapters that we can use in our DSPy pipelines. Let me explain what each does:

The TranslationAdapter is your straightforward translator - it takes content and translates it directly to your target language. Think of it like Google Translate but with better context awareness and formatting rules. It's fast and efficient since it's doing a single hop translation.

The ChainedTranslationAdapter is a bit more interesting - it does translation in three steps:

  1. First translates from source language to English
  2. Does all the processing/reasoning in English
  3. Finally translates the results back to target language

Why two adapters? Well, they're good for different things.

Use the simple TranslationAdapter when:

  • You just need to translate stuff quickly
  • You don't need any complex processing
  • You want to keep things simple and efficient

Go for ChainedTranslationAdapter when:

  • You're doing complex reasoning that works better in English
  • You need that extra validation step
  • You're fine trading some speed for more accuracy

Both adapters handle all the formatting, cultural adaptations, and technical terms properly. They also work nicely with the existing ChatAdapter for message handling.

I'm not pushing for one over the other - they both have their place depending on what you're building. Would love to get your thoughts on this approach and any improvements we could make.

@sushmanthreddy sushmanthreddy marked this pull request as draft November 16, 2024 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: localization
1 participant