Skip to content

ParallelData

Source: src/AWS/Translate/ParallelData.ts

Amazon Translate parallel data — segment-aligned translation examples imported from S3 that steer the style, tone, and word choice of batch translation jobs (Active Custom Translation). The import is asynchronous: the resource waits for the parallel data to become ACTIVE.

Import parallel data from S3

const examples = yield* AWS.Translate.ParallelData("StyleExamples", {
s3Uri: "s3://my-bucket/style-examples.csv",
format: "CSV",
});

Use parallel data in a batch translation job

const startJob = yield* AWS.Translate.StartTextTranslationJob(dataAccessRole);
yield* startJob({
InputDataConfig: { S3Uri: "s3://my-bucket/input/", ContentType: "text/plain" },
OutputDataConfig: { S3Uri: "s3://my-bucket/output/" },
SourceLanguageCode: "en",
TargetLanguageCodes: ["es"],
ParallelDataNames: [examples.parallelDataName],
});