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

Discrepancy with Google Translation #43

Closed
AdamElitzur opened this issue May 29, 2024 · 7 comments
Closed

Discrepancy with Google Translation #43

AdamElitzur opened this issue May 29, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@AdamElitzur
Copy link

Hi Aidan,

Loving the API so far!

I did have one issue, when I'm translating something from Hebrew to English, I'm getting a different translation from Google Translate. The one the API is giving me is incorrect, and the one Google Translate gives me is much better. Do you think I'm using it wrong, or have you seen inconsistencies with Google Translate's website?

This is my prompt from the translate call, which returns this result: "Aryan main, I would like to the mountains at the distance"
image
However, this is what Google translate returns: "I lift my head, I will lift my eyes to the mountains in the distance"

Any ideas about this? I've also been having this issue with some other languages, but this is one that I found right now. Thanks so much!

@AidanWelch
Copy link
Owner

I'm glad you're liking it! My immediate guess would have been that it was because of forceBatch but you already set that to false so I'd have to investigate. I'll try to take a look when I get a chance soon (If I take too long feel free to @ me)

@AidanWelch AidanWelch added the bug Something isn't working label May 29, 2024
@AdamElitzur
Copy link
Author

Thanks so much! Let me know if you find anything, and if it's happening on your side or not.

@AdamElitzur
Copy link
Author

@AidanWelch I hope all is well! Finding anything yet with the discrepancy? Anything else I should try in the meantime? Thanks so much.

@AidanWelch
Copy link
Owner

Well, the issue is with batch translation as

translate('ארים ראשי, אשא עיני אל ההרים במרחקים', {from: 'he', to: 'en', forceBatch: false, fallbackBatch: false}); // => res.text === 'I lift my head, I will lift my eyes to the mountains in the distance'

However that responds with Error: Too Many Requests sometimes. So, it must just be more aggressive rate limiting. With fallbackBatch: true when singleTranslate fails then batchTranslate is called rather than throwing an error. But, to be honest, it might have been a mistake on my part to degrade translation quality rather than throw an error by default.

Basically, forceBatch: false and fallbackBatch: false must be set to force the more accurate singleTranslate.

@AidanWelch
Copy link
Owner

@AdamElitzur (Just pinging in case you didn't get the notification)

@AdamElitzur
Copy link
Author

Thanks so much @AidanWelch! If I set forceBatch: false and fallbackBatch: false, then could that cause errors if there are too many requests?
I would like for a translation to show no matter what, even if the quality is worse, if that is the best possible outcome (better than an error). So actually, I like your move to degrade translation quality rather than throw an error by default! Thank you!

@AidanWelch
Copy link
Owner

@AdamElitzur Yep you got it exactly right! I'm glad that solution works for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants