分享方式:


檔翻譯作業

參考
功能: Azure AI Translator →文件翻譯

文件翻譯是 Azure AI 翻譯工具服務的雲端式功能,屬於 Azure AI 服務的 REST API 系列。 Batch 檔翻譯 API 會跨所有 支援的語言和方言 翻譯檔,同時保留檔結構和數據格式。 可用的方法會列在下表中:

API 版本: 2024-05-01

注意

  • 目前的版本與舊版回溯相容。

  • 從這個目前的版本開始, get supported storage sources 此方法會受到較長的支援。 翻譯工具服務僅支援 Azure Blob 記憶體。

要求 方法 描述 API 路徑
Single 同步 Document 翻譯
翻譯檔 POST 同步翻譯單一文件。 {document-translation-endpoint}/translator/document:translate?targetLanguage={target_language}&api-version={date}
Batch 非同步 文件 翻譯
開始翻譯 POST 啟動批次文件翻譯作業。 {document-translation-endpoint}/translator/document/batches?api-version={date}
取得所有翻譯作業的狀態 GET 要求使用者提交的翻譯工作清單和狀態。 {document-translation-endpoint}/translator/document/batches?api-version={date}
取得特定翻譯作業的狀態 GET 要求特定翻譯作業狀態的摘要。 回應包含整體作業狀態,以及正在轉譯為該作業一部分的文件狀態。 {document-translation-endpoint}/translator/document/batches/{id}?api-version={date}
取得所有文件的狀態 GET 要求翻譯作業中所有文件的狀態。 {document-translation-endpoint}/translator/document/batches/{id}/documents?api-version={date}
取得特定文件的狀態 GET 要求作業中特定文件的狀態。 {document-translation-endpoint}/translator/document/batches/{id}/documents/{documentId}?api-version={date}
取消翻譯 DELETE 取消目前正在處理或已排入佇列的文件翻譯作業。 {document-translation-endpoint}/translator/document/batches/{id}?api-version={date}
取得支援的檔案格式 GET 要求支援的檔案格式清單。 {document-translation-endpoint}/translator/document/formats?api-version={date}&type=document
取得支援的詞彙格式 GET 要求支援的詞彙格式清單。 {document-translation-endpoint}/translator/document/formats?api-version={date}&type=glossary

舊版

注意

  • 舊版與目前版本回溯相容。 您可以使用任一版本的作業來翻譯檔。
  • 建議您將應用程式移轉至最新版本,以受益於增強的體驗和進階功能。
要求 方法 描述 API 路徑
Single 同步 Document 翻譯
翻譯檔 POST 同步翻譯單一文件。 {document-translation-endpoint}/translator/document:translate?sourceLanguage={source language}&targetLanguage={target language}&api-version=2024-05-01" -H "Ocp-Apim-Subscription-Key:{your-key}" -F "document={path-to-your-document-with-file-extension};type={ContentType}/{file-extension}" -F "glossary={path-to-your-glossary-with-file-extension};type={ContentType}/{file-extension}" -o "{path-to-output-file}"
Batch 非同步 文件 翻譯
開始翻譯 POST 啟動批次文件翻譯作業。 {document-translation-endpoint}.cognitiveservices.azure.com/translator/text/batch/v1.1/batches
取得所有翻譯作業的狀態 GET 要求使用者提交的翻譯工作清單和狀態。 {document-translation-endpoint}.cognitiveservices.azure.com/translator/text/batch/v1.1/batches
取得特定翻譯作業的狀態 GET 要求特定翻譯作業狀態的摘要。 回應包含整體作業狀態,以及正在轉譯為該作業一部分的文件狀態。 {document-translation-endpoint}.cognitiveservices.azure.com/translator/text/batch/v1.1/batches/{id}
取得所有文件的狀態 GET 要求作業中特定文件的狀態。 {document-translation-endpoint}.cognitiveservices.azure.com/translator/text/batch/v1.1/batches/{id}/documents
取得特定文件的狀態 GET 要求作業中特定文件的狀態。 {document-translation-endpoint}.cognitiveservices.azure.com/translator/text/batch/v1.1/batches/{id}/documents/{documentId}
取消翻譯 DELETE 取消目前正在處理或已排入佇列的文件翻譯作業。 {document-translation-endpoint}.cognitiveservices.azure.com/translator/text/batch/v1.1/batches/{id}
取得支援的檔案格式 GET 要求支援的檔案格式清單。 {document-translation-endpoint}.cognitiveservices.azure.com/translator/text/batch/v1.1/documents/formats
取得支援的詞彙格式 GET 要求支援的詞彙格式清單。 {document-translation-endpoint}.cognitiveservices.azure.com/translator/text/batch/v1.1/glossaries/formats
取得支援的記憶體來源 GET 要求支援的記憶體來源/選項清單。 翻譯工具服務目前僅支援 Azure Blob 記憶體。 {document-translation-endpoint}.cognitiveservices.azure.com/translator/text/batch/v1.1/storagesources