Can we use custom translator with Document translation API ?

Anil Gudla 20 Reputation points
2025-01-23T15:52:02.56+00:00

Can we use custom translator with Document translation API ?
As per this
https://learn.microsoft.com/en-us/azure/ai-services/translator/custom-translator/how-to/translate-with-custom-model

we can use it for Translator API but there is no mention on document translation API with custom translator. Is that possible ? Are there any articles for reference

Azure Translator
Azure Translator
An Azure service to easily conduct machine translation with a simple REST API call.
438 questions
0 comments No comments
{count} votes

Accepted answer
  1. Pavankumar Purilla 3,005 Reputation points Microsoft Vendor
    2025-01-23T20:28:52.7333333+00:00

    Hi Anil Gudla,
    Greetings & Welcome to Microsoft Q&A forum! Thanks for posting your query!
    The Azure Document Translation API does not currently support the use of Custom Translator models. While the Translator API allows you to specify a custom model using the model's category ID, this functionality is not available for the Document Translation API, which uses only the standard general translation models.
    However, you can work around this limitation by extracting the text content from your documents using tools like Azure Computer Vision (for scanned or image-based documents. Once extracted, you can translate the text using the Translator API with your Custom Translator model by specifying the custom model's category ID. After translation, you can reapply the translated text back into the original document format using document generation libraries such as python-docx for Word files or FPDF for PDFs. While this approach allows you to leverage Custom Translator for document translation, it requires additional effort to preserve the original document's formatting and structure. For more information, you can refer to the official documentation for Custom Translator and Document Translation API.

    Hope this helps. Do let us know if you have any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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