Share via


TranslationTarget Class

Definition

Translate targets parameters.

public class TranslationTarget : System.ClientModel.Primitives.IJsonModel<Azure.AI.Translation.Text.TranslationTarget>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.Translation.Text.TranslationTarget>
type TranslationTarget = class
    interface IJsonModel<TranslationTarget>
    interface IPersistableModel<TranslationTarget>
Public Class TranslationTarget
Implements IJsonModel(Of TranslationTarget), IPersistableModel(Of TranslationTarget)
Inheritance
TranslationTarget
Implements

Constructors

Name Description
TranslationTarget(String, String, Nullable<ProfanityAction>, Nullable<ProfanityMarker>, String, Nullable<Boolean>, String, String, String, String)

Initializes a new instance of TranslationTarget with optional parameters.

TranslationTarget(String)

Initializes a new instance of TranslationTarget.

Properties

Name Description
AdaptiveDatasetId

Reference dataset ID having sentence pair to generate adaptive customized translation.

AllowFallback

In the case where a custom system is being used, specifies that the service is allowed to fall back to a general system when a custom system doesn't exist. In the case where a Large Language Model is being used, specifies that the service is allowed to fall back to a Small Language Model if an error occurs. Possible values are: true (default) or false.

allowFallback=false specifies that the translation should only use systems trained for the category specified by the request. If a translation for language X to language Y requires chaining through a pivot language E, then all the systems in the chain (X → E and E → Y) will need to be custom and have the same category. If no system is found with the specific category, the request will return a 400 status code. allowFallback=true specifies that the service is allowed to fall back to a general system when a custom system doesn't exist.

DeploymentName

Default is 'general', which uses NMT system. 'abc-inc-gpt-4o', and 'abc-inc-gpt-4o-mini' are examples of deployment names which use GPT-4o uses or GPT-4o-mini model. 'gpt-4o' uses GPT-4o model.

'<custom model id>' uses the custom NMT model tuned by customer. 'best' system determines which is the best model to use for the request. This intelligence could be introduced in future. Customer should have deployed it in their resource.

Gender

Desired gender of target translation.

Grade

Defines complexity of LLM prompts to provide high accuracy translation.

Language

Specifies the language of the output text. The target language must be one of the supported languages included in the translation scope. It's possible to translate to multiple languages simultaneously by including multiple string values in the targetsLanguage array.

ProfanityAction

Specifies how profanities should be treated in translations. Possible values are: NoAction (default), Marked or Deleted.

ProfanityMarker

Specifies how profanities should be marked in translations. Possible values are: Asterisk (default) or Tag.

ReferenceTextPairs

Reference text pairs to generate adaptive customized translation.

Script

Specifies the script of the translated text.

Tone

Desired tone of target translation.

Methods

Name Description
JsonModelCreateCore(Utf8JsonReader, ModelReaderWriterOptions)
JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)
PersistableModelCreateCore(BinaryData, ModelReaderWriterOptions)
PersistableModelWriteCore(ModelReaderWriterOptions)

Explicit Interface Implementations

Name Description
IJsonModel<TranslationTarget>.Create(Utf8JsonReader, ModelReaderWriterOptions)
IJsonModel<TranslationTarget>.Write(Utf8JsonWriter, ModelReaderWriterOptions)
IPersistableModel<TranslationTarget>.Create(BinaryData, ModelReaderWriterOptions)
IPersistableModel<TranslationTarget>.GetFormatFromOptions(ModelReaderWriterOptions)
IPersistableModel<TranslationTarget>.Write(ModelReaderWriterOptions)

Applies to