Verified Translation
Verfied Translation has a human in the loop to ensure the highest translation quality. That means immediate turn around times will not be possible unlike with Instant Translate.
In this section we will discuss:
- Uploading Files
- Creating a Job
- Monitoring Job Status
- Downloading Translated Jobs
- Archiving Downloaded Jobs
Things you will need:
- API Key - All requests throught the LILT API use the API Key to authenticate.
- File to Translate - We recommend a simple text file (txt) for a first attempt.
- Memory ID - A LILT Data Source's
memoryId
to use with the translation - Create one here!
Submitting a New LILT Job
A LILT Job encapsulates the various files that you want to translate. A Job is usually made up of multiple Projects. A Project is a grouping of Documents to be translated for an individual language pair (en->de - English to German). The LILT app has a useful wizard for creating Jobs that breaks all of these concepts down into a single package.
In the next section you will learn how to create your first LILT Job. If you are curious about how these objects fit together, feel free to check out the API Reference:
Uploading Files
The first step is to upload some files. For this example, a text (txt) file will be used as it is one of the simplest file types supported for verified translation. See the API docs for more file upload options.
curl -X POST https://api.lilt.com/v2/files?key=API_KEY&name=testfile.txt \
--header "Content-Type: application/octet-stream" \
--data-binary @testfile.txt
The response will have an ID that relates to the File:
{
"id": {Your File Id here},
"name": "testfile.txt",
"file_hash": "3858f62230ac3c915f300c664312c63f",
"detected_lang": "en",
"detected_lang_confidence": 0.7,
"category": "API",
"labels": [],
"created_at": "2024-02-16T22:12:34.000Z",
"updated_at": "2024-02-16T22:12:34.000Z"
}
Hold onto the file IDs as you will need them in Step 2. If you lose them, you can always query the Files API to see a list of your files.
Upload all of the files first before creating a Job with them.
Creating a Job
To create a Job you need at least one Data Source for the language you want to
translate into. We will use the corresponding memoryId
and the target language
from that memory to specify a Language Pair, which can then be linked to the
relevant Job.
For now, let's create a Job for a single File and a single Language Pair. The request to create a Job will look like this. See the API docs for more info.
curl -X POST 'https://api.lilt.com/v2/jobs?key=API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "test job",
"fileIds": [1234],
"due": "2024-02-05T10:56:44.985Z",
"srcLang": "en",
"srcLocale": "US",
"languagePairs": [
{ "memoryId": 3121, "trgLang": "de" }
]
}'
That is all it takes to create a Verified Translation Job in LILT.
The Job has now been created and the LILT team will handle processing the verified translations. The Job will be marked as Delivered in LILT to indicate that the translations are ready for download.
Monitoring the Job Status
To determine which translaions are ready for download query for jobs where
isDelivered=true
and isArchived=false
.
curl -X GET https://api.lilt.com/v2/jobs?key=API_KEY&isDelivered=true&isArchived=false
See the API Docs for more info.
Downloading Translated Jobs
To download the completed translations, first initiate an export of the Job
using the export endpoint. This will set
the isProcessing
value to 1
.
curl -X GET 'https://api.lilt.com/v2/jobs/{id}/export?key=API_KEY&type=files'
Check the status of the export by calling the
get job by ID endpoint. When the export is
complete, the isProcessing
value will be set to 0
(or -2
in the case of an
export error).
curl -X GET 'https://api.lilt.com/v2/jobs/{id}?key=API_KEY'
Once the export is complete the translations can be downloaded. The download endpoint will return a zip file containing all of the translations.
curl -X GET 'https://api.lilt.com/v2/jobs/{id}/download?key=API_KEY'
Archiving Downloaded Jobs
Call the archive endpoint after successful download of the translations to indicate that the translations have been received.
curl -X POST 'https://api.lilt.com/v2/jobs/{id}/archive?key=API_KEY'
That concludes this end-to-end guide for completing Verified Translation Jobs using the LILT API.