Use a Custom Translator model trained and published with Document Translation SDK

Liel Serfaty 0 Reputation points
2025-10-27T09:22:19.8133333+00:00

I have trained and published a custom translator model using the Azure AI Language Studio.
I would like to know if it is possible to use this custom translator model when loading documents into Document Translation via Python code using the Document Translation SDK, similar to how it can be done in Language Studio by creating a translation job with Custom Translator model ID.

Azure AI Translator
Azure AI Translator
An Azure service to easily conduct machine translation with a simple REST API call.
{count} votes

1 answer

Sort by: Most helpful
  1. Manas Mohanty 13,255 Reputation points Moderator
    2025-10-27T13:28:24.0433333+00:00

    Hello Liel Serfaty

    Good day.

    Yes, you can use your Custom Translator model (category ID) with the Azure Document Translation Python SDK.

    https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/translation/azure-ai-translation-document/samples/sample_translation_with_custom_model.py

    Common pitfalls & checks

    1. Region mismatch\ Your Custom Translator model and your Translator resource must be in the same Azure region. A mismatch typically returns a 400/BadRequest with messaging like “unknown category.”
    2. Resource type\ Use a Translator resource (single-service). A generic “Cognitive Services (multi-service)” key won’t work with Document Translation.
    3. Model status\ Ensure the Custom Translator system is Deployed and the Category ID is from that deployment (not the project ID).
    4. Language pair alignment\ The custom system must support the source→target pair you are requesting (e.g., es->en).
    5. Permissions to blobs\ The SAS on source_url must grant Read; on each target_url, grant Write (and typically Create, Add, List) for the SDK to write outputs.
    6. SDK property name\ In Python it’s category_id on TranslationTarget. In some REST samples it’s category. If you set category in Python, it will be ignored—use category_id.

    Thank you.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.