-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[translation] consider simplifying input to translation #17916
Copy link
Copy link
Closed
Description
Consult user data available and any findings from user studies to determine if we should simplify our input to create_translation_job to optimize for the use case of only one source and target.
This currently requires you to import and instantiate a few objects
from azure.ai.translation.document import (
DocumentTranslationClient,
DocumentTranslationInput,
TranslationTarget
)
client = DocumentTranslationClient(endpoint, AzureKeyCredential(key))
job = client.create_translation_job(inputs=[
DocumentTranslationInput(
source_url=source_container_url,
targets=[
TranslationTarget(
target_url=target_container_url,
language_code="es"
)
]
)
]
)
Some ideas - we could consider "overloading" the method itself or accepting additional kwargs in DocumentTranslationInput.
- def create_translation_job(**kwargs):
- requires
inputs. Must passinputsif you need to pass more than one source and/or target. - requires
source_url,target_url, andlanguage_codealong with any other optional kwargs
DocumentTranslationInputtakes kwargstarget_urlandlanguage_code. Consider other optional kwargs. Must supplytargetsif planning on passing more than one target in.
Reactions are currently unavailable