This dataset consists of prompt-completion pairs designed for Yoruba language tone correction. Each sample provides a Yoruba word written without proper diacritics as the prompt and the correctly accented version as the completion. The content focuses on mapping unmarked vowels to their appropriate high, mid, or low tones to improve orthographic accuracy.
import time
from adaption import Adaption
client = Adaption(api_key="YOUR_API_KEY")
# Step 1: Upload file
dataset = client.datasets.upload_file(
"yoruba_tone_correction.csv",
name="yoruba_tone_correction",
)
# Step 2: Wait for ingestion to finish (row_count populated)
while True:
status = client.datasets.get_status(dataset.dataset_id)
if status.status == "failed":
err = status.error_data
msg = (err and err.message) or "unknown error"
raise RuntimeError(f"Ingestion failed: {msg}")
if status.row_count is not None:
break
time.sleep(5)
# Step 3: Run augmentation
job = client.datasets.run(
dataset.dataset_id,
column_mapping={
"prompt": "input",
"completion": "target",
},
recipe_specification={
"recipes": {
"prompt_rephrase": False,
"deduplication": True,
},
},
training_type="preference_pairs",
job_specification={"max_rows": 5000},
)
print(f"Launched — estimated time: {job.estimated_minutes:.0f} minutes")
# Step 4: Poll until complete
while True:
status = client.datasets.get_status(dataset.dataset_id)
if status.status == "succeeded":
break
if status.status == "failed":
err = status.error_data
msg = (err and err.message) or "unknown error"
raise RuntimeError(f"Run failed: {msg}")
time.sleep(10)
# Step 5: Review results
ds = client.datasets.get(dataset.dataset_id)
if ds.evaluation_summary:
print(f"Quality: {ds.evaluation_summary.grade_before} → {ds.evaluation_summary.grade_after}")
print(f"Improvement: {ds.evaluation_summary.improvement_percent:.0f}%")
# Step 6: Download
client.datasets.download(dataset.dataset_id)