MicrosoftTranslator / DocumentTranslation

Command Line tool and Windows application for document translation, a local interface to the Azure Document Translation service for Windows, macOS and Linux.
Other
156 stars 37 forks source link

Using multiple custom translator models with Document translation #133

Closed wolfjin0 closed 1 month ago

wolfjin0 commented 1 month ago

Dear developers, I plan to train several custom translator models for different language pairs (and in different directions), such as DE-EN, EN-DE, FR-EN, EN-FR etc. Is there a way to use document translation or to configure Azure so that it automatically send the documents to the right model depending on the language pairs?

Best regards, Jammy

chriswendt1 commented 1 month ago

Hi @wolfjin0,

The custom trained engine is accessed via the combination of language pair and category ID. You can train all of your language pairs within the same Workspace of the Custom Translator portal, and you can give all the pairs the same "Domain" label. Each language pair is a new "Project", and you specify the language pair and domain at project creation. All language pairs within your workspace AND with the same domain label will have the same category ID. The category ID is the string workspace ID + '_' + domain.

At runtime, when the API client specifies a language pair and category ID for which you have not yet built a custom translation system, the API by default will silently fall back to the Microsoft generic engine for this language pair. If you want to prevent this fallback and cause the request to fail in the case of a nonexistent custom translation system for the given category ID, you can specify the optional parameter allowFallback=false.

Let me know if this helps, Chris..

chriswendt1 commented 1 month ago

Hi @wolfjin0, did my comments help? If yes, we can resolve this issue.

wolfjin0 commented 1 month ago

Hi @wolfjin0,

Hi Chris, thank you so much for the help!

chriswendt1 commented 1 month ago

Thanks for confirming.