-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document translation of text within an image (#31384)
* Adding support for new apiversion that includes translation of image within document translation * Fixing json formatting * Fixing formatting issues again * Fixing TypeSpec validation error * Updating Readme with the new version * Fixing the release tag * Anothe tag fix * Fixing formatting on client.tsp * Updating property names * Updating SDT response property name; removing x- * Changing the order of parameter definition --------- Co-authored-by: Weidong Xu <[email protected]>
- Loading branch information
1 parent
b755f17
commit 01791fc
Showing
21 changed files
with
2,327 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
....AI.DocumentTranslation/examples/2024-11-01-preview/DocumentTranslate_MaximumSet_Gen.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"title": "Translate a single document", | ||
"operationId": "DocumentTranslationOperations_DocumentTranslate", | ||
"parameters": { | ||
"api-version": "2024-11-01-preview", | ||
"sourceLanguage": "en", | ||
"targetLanguage": "es", | ||
"document": "TXkgdHJhbnNsYXRlZCBkb2N1bWVudA==" | ||
}, | ||
"responses": { | ||
"200": { | ||
"headers": { | ||
"x-metered-usage": 739, | ||
"total-image-scans-succeeded": 6, | ||
"total-image-scans-failed": 1 | ||
}, | ||
"body": "TXkgdHJhbnNsYXRlZCBkb2N1bWVudA==" | ||
} | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
...ification/translation/Azure.AI.DocumentTranslation/examples/2024-11-01-preview/batch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"title": "Submit a document translation request to the Document Translation service", | ||
"operationId": "DocumentTranslationOperations_StartTranslation", | ||
"parameters": { | ||
"api-version": "2024-11-01-preview", | ||
"subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", | ||
"resourceGroupName": "TestResourceGroup", | ||
"endpoint": "{endpoint}", | ||
"Ocp-Apim-Subscription-Key": "{API key}", | ||
"body": { | ||
"inputs": [ | ||
{ | ||
"source": { | ||
"sourceUrl": "https://myblob.blob.core.windows.net/sourceContainer", | ||
"filter": { | ||
"prefix": "pre", | ||
"suffix": ".txt" | ||
}, | ||
"language": "en", | ||
"storageSource": "AzureBlob" | ||
}, | ||
"targets": [ | ||
{ | ||
"targetUrl": "https://myblob.blob.core.windows.net/destinationContainer1", | ||
"category": "general", | ||
"language": "fr", | ||
"glossaries": [ | ||
{ | ||
"glossaryUrl": "https://myblob.blob.core.windows.net/myglossary/en_fr_glossary.xlf", | ||
"storageSource": "AzureBlob", | ||
"format": "XLIFF" | ||
} | ||
], | ||
"storageSource": "AzureBlob" | ||
}, | ||
{ | ||
"targetUrl": "https://myblob.blob.core.windows.net/destinationContainer2", | ||
"category": "general", | ||
"language": "es", | ||
"storageSource": "AzureBlob" | ||
} | ||
], | ||
"storageType": "Folder" | ||
} | ||
] | ||
} | ||
}, | ||
"responses": { | ||
"202": { | ||
"headers": { | ||
"Operation-Location": "https://westus.cognitiveservices.azure.com/translator/document/batches?api-version=2024-05-01/operation/0FA2822F-4C2A-4317-9C20-658C801E0E55" | ||
} | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...fication/translation/Azure.AI.DocumentTranslation/examples/2024-11-01-preview/cancel.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"title": "Cancel a currently processing or queued translation", | ||
"operationId": "DocumentTranslationOperations_CancelTranslation", | ||
"parameters": { | ||
"api-version": "2024-11-01-preview", | ||
"subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", | ||
"resourceGroupName": "TestResourceGroup", | ||
"endpoint": "{endpoint}", | ||
"Ocp-Apim-Subscription-Key": "{API key}", | ||
"id": "727BF148-F327-47A0-9481-ABAE6362F11E" | ||
}, | ||
"responses": { | ||
"200": { | ||
"headers": {}, | ||
"body": { | ||
"id": "727bf148-f327-47a0-9481-abae6362f11e", | ||
"createdDateTimeUtc": "2020-03-26T00:00:00Z", | ||
"lastActionDateTimeUtc": "2020-03-26T01:00:00Z", | ||
"status": "Succeeded", | ||
"summary": { | ||
"total": 10, | ||
"failed": 1, | ||
"success": 9, | ||
"inProgress": 0, | ||
"notYetStarted": 0, | ||
"cancelled": 0, | ||
"totalCharacterCharged": 0, | ||
"totalImageScansSucceeded": 6, | ||
"totalImageScansFailed": 1 | ||
} | ||
} | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...cation/translation/Azure.AI.DocumentTranslation/examples/2024-11-01-preview/document.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"title": "Returns the status of a single document in a batch translation request", | ||
"operationId": "DocumentTranslationOperations_GetDocumentStatus", | ||
"parameters": { | ||
"api-version": "2024-11-01-preview", | ||
"subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", | ||
"resourceGroupName": "TestResourceGroup", | ||
"endpoint": "{endpoint}", | ||
"Ocp-Apim-Subscription-Key": "{API key}", | ||
"id": "727BF148-F327-47A0-9481-ABAE6362F11E", | ||
"documentId": "727BF148-F327-47A0-9481-ABAE6362F12F" | ||
}, | ||
"responses": { | ||
"200": { | ||
"headers": { | ||
"retry-after": "30", | ||
"ETag": "686897696a7c876b7e" | ||
}, | ||
"body": { | ||
"path": "https://myblob.blob.core.windows.net/destinationContainer/fr/mydoc.txt", | ||
"sourcePath": "https://myblob.blob.core.windows.net/sourceContainer/fr/mydoc.txt", | ||
"createdDateTimeUtc": "2020-03-26T00:00:00Z", | ||
"lastActionDateTimeUtc": "2020-03-26T01:00:00Z", | ||
"status": "Running", | ||
"to": "fr", | ||
"progress": 0.1, | ||
"id": "273622bd-835c-4946-9798-fd8f19f6bbf2", | ||
"characterCharged": 0, | ||
"totalImageScansSucceeded": 6, | ||
"totalImageScansFailed": 1 | ||
} | ||
} | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
...ation/translation/Azure.AI.DocumentTranslation/examples/2024-11-01-preview/documents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"title": "Returns the status for all documents in a batch document translation request", | ||
"operationId": "DocumentTranslationOperations_GetDocumentsStatus", | ||
"parameters": { | ||
"api-version": "2024-11-01-preview", | ||
"subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", | ||
"resourceGroupName": "TestResourceGroup", | ||
"endpoint": "{endpoint}", | ||
"Ocp-Apim-Subscription-Key": "{API key}", | ||
"id": "727BF148-F327-47A0-9481-ABAE6362F11E", | ||
"top": 2, | ||
"skip": 0, | ||
"maxpagesize": 1, | ||
"orderBy": "CreatedDateTimeUtc asc", | ||
"createdDateTimeUtcStart": "2021-03-23T07:03:38.0136316Z", | ||
"createdDateTimeUtcEnd": "2021-03-25T07:03:38.0136316Z", | ||
"statuses": [ | ||
"Succeeded" | ||
], | ||
"ids": [ | ||
"273622bd-835c-4946-9798-fd8f19f6bbf2", | ||
"511b6a66-a6f8-4640-83e1-48c325e9fa29" | ||
] | ||
}, | ||
"responses": { | ||
"200": { | ||
"headers": { | ||
"retry-after": "30", | ||
"ETag": "686897696a7c876b7e" | ||
}, | ||
"body": { | ||
"value": [ | ||
{ | ||
"path": "https://myblob.blob.core.windows.net/destinationContainer/fr/mydoc.txt", | ||
"sourcePath": "https://myblob.blob.core.windows.net/sourceContainer/fr/mydoc.txt", | ||
"createdDateTimeUtc": "2021-03-23T07:03:39.013631Z", | ||
"lastActionDateTimeUtc": "2021-03-23T07:03:41.012452Z", | ||
"status": "Running", | ||
"to": "fr", | ||
"progress": 0.1, | ||
"id": "273622bd-835c-4946-9798-fd8f19f6bbf2", | ||
"characterCharged": 0, | ||
"totalImageScansSucceeded": 6, | ||
"totalImageScansFailed": 1 | ||
} | ||
], | ||
"nextLink": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0/operation/0FA2822F-4C2A-4317-9C20-658C801E0E55/documents?top=1&skip=1&maxpagesize=1&orderBy=CreatedDateTimeUtc%20asc&createdDateTimeUtcStart=2021-03-23T00:03:38.0136316Z&createdDateTimeUtcEnd=2021-03-25T00:03:38.0136316&statuses=Succeeded&ids=273622BD-835C-4946-9798-FD8F19F6BBF2,511B6A66-A6F8-4640-83E1-48C325E9FA29" | ||
} | ||
} | ||
} | ||
} |
79 changes: 79 additions & 0 deletions
79
...fication/translation/Azure.AI.DocumentTranslation/examples/2024-11-01-preview/format.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"title": "Returns a list of supported document formats", | ||
"operationId": "DocumentTranslationOperations_GetSupportedFormats", | ||
"parameters": { | ||
"api-version": "2024-11-01-preview", | ||
"subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", | ||
"resourceGroupName": "TestResourceGroup", | ||
"endpoint": "{endpoint}", | ||
"Ocp-Apim-Subscription-Key": "{API key}", | ||
"type": "document" | ||
}, | ||
"responses": { | ||
"200": { | ||
"headers": { | ||
"retry-after": "30", | ||
"ETag": "686897696a7c876b7e" | ||
}, | ||
"body": { | ||
"value": [ | ||
{ | ||
"format": "PlainText", | ||
"fileExtensions": [ | ||
".txt" | ||
], | ||
"contentTypes": [ | ||
"text/plain" | ||
] | ||
}, | ||
{ | ||
"format": "PortableDocumentFormat", | ||
"fileExtensions": [ | ||
".pdf" | ||
], | ||
"contentTypes": [ | ||
"application/pdf" | ||
] | ||
}, | ||
{ | ||
"format": "OpenXmlWord", | ||
"fileExtensions": [ | ||
".docx" | ||
], | ||
"contentTypes": [ | ||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" | ||
] | ||
}, | ||
{ | ||
"format": "OpenXmlPresentation", | ||
"fileExtensions": [ | ||
".pptx" | ||
], | ||
"contentTypes": [ | ||
"application/vnd.openxmlformats-officedocument.presentationml.presentation" | ||
] | ||
}, | ||
{ | ||
"format": "OpenXmlSpreadsheet", | ||
"fileExtensions": [ | ||
".xlsx" | ||
], | ||
"contentTypes": [ | ||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | ||
] | ||
}, | ||
{ | ||
"format": "HtmlFile", | ||
"fileExtensions": [ | ||
".html", | ||
".htm" | ||
], | ||
"contentTypes": [ | ||
"text/html" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...ation/translation/Azure.AI.DocumentTranslation/examples/2024-11-01-preview/operation.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"title": "Returns the status for a batch document translation request", | ||
"operationId": "DocumentTranslationOperations_GetTranslationStatus", | ||
"parameters": { | ||
"api-version": "2024-11-01-preview", | ||
"subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", | ||
"resourceGroupName": "TestResourceGroup", | ||
"endpoint": "{endpoint}", | ||
"Ocp-Apim-Subscription-Key": "{API key}", | ||
"id": "727BF148-F327-47A0-9481-ABAE6362F11E" | ||
}, | ||
"responses": { | ||
"200": { | ||
"headers": { | ||
"retry-after": "30", | ||
"ETag": "686897696a7c876b7e" | ||
}, | ||
"body": { | ||
"id": "727bf148-f327-47a0-9481-abae6362f11e", | ||
"createdDateTimeUtc": "2020-03-26T00:00:00Z", | ||
"lastActionDateTimeUtc": "2020-03-26T01:00:00Z", | ||
"status": "Succeeded", | ||
"summary": { | ||
"total": 10, | ||
"failed": 1, | ||
"success": 9, | ||
"inProgress": 0, | ||
"notYetStarted": 0, | ||
"cancelled": 0, | ||
"totalCharacterCharged": 0, | ||
"totalImageScansSucceeded": 6, | ||
"totalImageScansFailed": 1 | ||
} | ||
} | ||
} | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
...tion/translation/Azure.AI.DocumentTranslation/examples/2024-11-01-preview/operations.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"title": "Returns a list of batch requests submitted and the status for each request", | ||
"operationId": "DocumentTranslationOperations_GetTranslationsStatus", | ||
"parameters": { | ||
"api-version": "2024-11-01-preview", | ||
"subscriptionId": "EA19050C-51FC-4B55-84E5-9EA7283601DA", | ||
"resourceGroupName": "TestResourceGroup", | ||
"endpoint": "{endpoint}", | ||
"Ocp-Apim-Subscription-Key": "{API key}", | ||
"top": 1, | ||
"skip": 0, | ||
"maxpagesize": 10, | ||
"orderBy": "CreatedDateTime asc", | ||
"createdDateTimeUtcStart": "2021-03-23T07:03:38.0136316Z", | ||
"createdDateTimeUtcEnd": "2021-03-25T07:03:38.0136316Z", | ||
"statuses": [ | ||
"Succeeded" | ||
], | ||
"ids": [ | ||
"273622bd-835c-4946-9798-fd8f19f6bbf2" | ||
] | ||
}, | ||
"responses": { | ||
"200": { | ||
"headers": { | ||
"retry-after": "30", | ||
"ETag": "686897696a7c876b7e" | ||
}, | ||
"body": { | ||
"value": [ | ||
{ | ||
"id": "273622bd-835c-4946-9798-fd8f19f6bbf2", | ||
"createdDateTimeUtc": "2021-03-23T07:03:30.013631Z", | ||
"lastActionDateTimeUtc": "2021-03-26T01:00:00Z", | ||
"status": "Succeeded", | ||
"summary": { | ||
"total": 10, | ||
"failed": 1, | ||
"success": 9, | ||
"inProgress": 0, | ||
"notYetStarted": 0, | ||
"cancelled": 0, | ||
"totalCharacterCharged": 1000, | ||
"totalImageScansSucceeded": 6, | ||
"totalImageScansFailed": 1 | ||
} | ||
} | ||
], | ||
"nextLink": "https://westus.cognitiveservices.azure.com/translator/text/batch/v1.0/operation/0FA2822F-4C2A-4317-9C20-658C801E0E55/documents?top=1&skip=1&maxpagesize=1&orderBy=CreatedDateTimeUtc%20asc&createdDateTimeUtcStart=2021-03-23T00:03:38.0136316Z&createdDateTimeUtcEnd=2021-03-25T00:03:38.0136316&statuses=Succeeded&ids=273622BD-835C-4946-9798-FD8F19F6BBF2,511B6A66-A6F8-4640-83E1-48C325E9FA29" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.