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

Enforce service limits #71

Open
chriswendt1 opened this issue Nov 11, 2021 · 4 comments
Open

Enforce service limits #71

chriswendt1 opened this issue Nov 11, 2021 · 4 comments

Comments

@chriswendt1
Copy link
Member

The Translator service has limits in document translation, in file size and number of languages.
The client should be aware of these limits, and either work around or prevent user from exceeding them.

https://docs.microsoft.com/en-us/azure/cognitive-services/translator/document-translation/get-started-with-document-translation?tabs=csharp#content-limits

@dv505
Copy link

dv505 commented Mar 21, 2023

I'm trying to translate a large .docx document (+1000 pages / +120Mb); which, if I'm not wrong, is over the limitations published in the link you post. So, as expected, the software generates an error and does not translate the document (The maximum document file size has been exceeded. (InvalidRequest)). The software works perfectly with other smarller documents.

Same problem if if I try to translate the document using my own code (as given by Microsoft). It works with other smaller documents, but not with this large one.

However, if I use the "old" program "DocumentTranslator-Legacy" (https://github.com/MicrosoftTranslator/DocumentTranslator-Legacy) , it works perfectly. So for now it is my only possible solution (fortunately! thanks!).

Any idea of why it is happening? Any possible solution so to be able to use this new "DocumentTranslation" software?

Thank you very much.

@chriswendt1
Copy link
Member Author

Hi @dv505,
The old DocumentTranslator-Legacy breaks the document locally into snippets using a document object model, and translates these snippets as plain text, reinserting them into the target document. That's why size doesn't matter here.

The new version transmits the document as is to the Document Translation Service, doesn't touch it locally. The Document Translation Service imposes a document size restriction.

The reason I didn't fix this bug yet is that the values of these limits are not provided by the service, and I didn't want to hardcode them in the client, which runs the danger of being outdated quickly.

Now you give me an idea though: I could catch the error that you saw when trying the first time and adjust the client-side limit dynamically, based on the server response.

@dv505
Copy link

dv505 commented Mar 21, 2023

Thank you very much for your quick response and your work.

If I can give you any examples or screenshots, let me know. It would help me a lot to have this bug fixed, so it's great to read and understand the reasons why the process fails and to realize that there is a workable solution. I will keep an eye out for a software update that might fix this bug.

I have almost no programming knowledge, so I was thinking about giving the user the possibility to decide and iterate in how many pieces want to split the document, but adjusting it dynamically sounds much better :D

By the way, I would love to understand how the software does to split the document into objects and reassemble it in a perfect way, because bedore I've found this software this is what I was doing manually, but I always had some little problems that I had to fix by hand.... so it's fantastic, sounds like magic to me! One more reason to start learning programming!

Thank you very much!

@chriswendt1
Copy link
Member Author

The fix for this bug is to fail earlier and more gracefully. The fix won't enable translating larger documents. Splitting the document and recombining it is beyond the scope of this app. I'd rather lobby Microsoft to increase the document size limits.

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