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

Split calls in gl_translate more effectively - not all or nothing? #80

Open
LukasWallrich opened this issue Feb 5, 2023 · 2 comments
Open

Comments

@LukasWallrich
Copy link

Currently, it appears like gl_translate attempts to send everything in one call, and failing that, makes one call per vector element. In my use case, that results in 20,000 calls of 100 characters each, all with their own status message ... not ideal, and probably slower than a few larger calls.

Would it make sense to instead attempt to split the request into (e.g.) 2, then 4, then 8 buckets? Id' be happy to propose an alternative to the current line Reduce(rbind, lapply(t_string, gl_translate, format = format, target = target, source = source, model = model)) if something like that would seem useful?

@MarkEdmondson1234
Copy link
Collaborator

Yes any optimisation you can do will be appreciated. Is there some control by doing some text processing before the API call? Even if its just a helper function to split into bigger batches or something.

There is also probably a concurrency feature, so sending multiple API calls at once may be possioble - this is an approach I've looked at in googleCloudRunner

@LukasWallrich
Copy link
Author

Ok, I will think about larger batches - apparently, up to 5k characters at a time are recommended - so that would already go a long way, at least in my use case (translating titles of journal articles).

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

No branches or pull requests

2 participants