Issues with Document Translation API using cURL for Synchronous Method

Saurabh Gohain 0 Reputation points
2024-12-09T13:04:46.62+00:00

The document translation feature of Azure AI Translator is being tested using the cURL method from the documentation. A Hindi document with a .docx extension is being submitted with the target language set to English, but it returns some unsupported text.

Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
2,111 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Saurabh Gohain 0 Reputation points
    2024-12-12T05:40:31.6633333+00:00

    Hi, Pavan

    Sorry for the delayed response, had been busy with other task, Thank you for the response, I will check out the tips provided by you and see if it works.

    0 comments No comments

  2. Saurabh Gohain 0 Reputation points
    2024-12-12T07:18:18.8066667+00:00

    Hi pavan,

    I tried out verifying, I could see that .docx type is primarily a binary file, but after unziping it and checking the word/document.xml file it was utf-8 encoded document,

    After I tried again, it is still giving me binary data.

    I am attaching the screenshot of the output document and as well as the command used

    file -I /Users/saurabh/Desktop/document-translation/output_utf8.docx
    
    curl -v -i -X POST "https://translation-dev.cognitiveservices.azure.com/translator/document:translate?sourceLanguage=hi&targetLanguage=en&api-version=2024-05-01" \
    -H "Ocp-Apim-Subscription-Key:xx" \
    -F "document=@/Users/saurabh/Desktop/document-translation/output_utf8.docx;type=application/vnd.openxmlformats-officedocument.wordprocessingml.document" \
    -o "/Users/saurabh/Desktop/document-translation/output.docx"
    
    

    Screenshot 2024-12-12 at 12.24.19 PM


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.