Add localized rows to a dataset
Adapts a sample of this dataset’s rows to each country/language pair — translating the text and matching that country’s conventions — and returns the result as a new dataset, leaving this one unchanged. The new dataset carries this dataset’s rows alongside the localized ones. Poll GET /datasets/{dataset_id}/status on the returned id until it reaches succeeded. To translate into a language without targeting a country, use POST /datasets/{dataset_id}/translate. Set estimate=true to price the request without starting a run.
Body ParametersJSON
Fraction of this dataset’s rows to expand, per target. At 0.25 with two targets, a 1,000-row dataset gains 500 rows and the new dataset holds 1,500.
When true, validates the request and returns the estimated credit cost without starting a run or creating a dataset.
Returns
The expanded dataset. It carries this dataset’s rows plus the new ones, and is ready to download once its status reaches succeeded. Null for an estimate, which creates nothing.
Add localized rows to a dataset
curl https://api.prod.adaptionlabs.ai/api/v1/datasets/$DATASET_ID/localize \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ADAPTION_API_KEY" \
-d '{
"sample_rate": 0.25,
"pairs": [
{
"country": "ES",
"language": "ca"
}
]
}'{
"dataset_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "running",
"estimated_credits_consumed": 5,
"estimate": true,
"estimated_new_rows": 500
}Returns Examples
{
"dataset_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "running",
"estimated_credits_consumed": 5,
"estimate": true,
"estimated_new_rows": 500
}