Skip to content

[translation] consider simplifying input to translation #17916

@kristapratico

Description

@kristapratico

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.

  1. def create_translation_job(**kwargs):
  • requires inputs. Must pass inputs if you need to pass more than one source and/or target.
  • requires source_url, target_url, and language_code along with any other optional kwargs
  1. DocumentTranslationInput takes kwargs target_url and language_code. Consider other optional kwargs. Must supply targets if planning on passing more than one target in.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions