Skip to main content
Teacher models can label real queries for you. You review their labels, then turn the rows you accept into a dataset. First check whether labelling is available, and which teachers are offered:
Plan the job with available, defaults.teacher_models and limits. Check available: a catalogue of teacher names doesn’t mean the service is enabled.

1. Upload unlabelled queries

Save UTF-8 JSONL, one context per line. You can put decisions on each row, or give shared decisions when you start the job.
Keep the returned source id. A source holds up to 2,000 rows and 16 MiB, and each query asks up to 64 decisions. Its input receipt records the uploaded bytes and hash. Every row must define a decision ID the same way, whether it has its own decisions or uses the shared ones. A job whose rows differ is refused with conflicting_decision before it is created, and nothing is charged.
Teacher labelling sends the selected queries to the teacher model’s provider. Choose data that suits that.

2. Start a job

Set SQWISH_SOURCE_ID to the source’s ID, and SQWISH_TEACHER_ID to a teacher ID from /v1/labeling/teachers:
teacher_models names one or two different teachers. Left out, it is defaults.teacher_models. A job costs each of its teachers’ price for every row of its source. pricing.teacher_row_usd in /v1/onehot gives the price for a row.
  • The job’s price_usd is held while it runs. It is charged once the labels are ready for review.
  • A job that fails or is cancelled before then costs nothing.
  • Send the price you were shown as max_price_usd (USD amounts). A job that would cost more gets 409 price_changed.
A teacher that gives no answer is asked again. After 15 minutes with no answer, the job tries again from the rows already labelled. On the third such try, it fails. A job with no valid row fails too. Poll /v1/labeling/jobs/{job_id}:

3. Review and finalise

Once the job is review_ready, read /v1/labeling/jobs/{job_id}/results page by page, up to 200 rows a page. Before that, and for a job that failed or was cancelled, it answers 409 review_required. Each result has its source index, context, decisions, teacher labels, valid and agreement. valid means the teachers returned labels in the expected shape. agreement means they chose the same labels. Neither replaces your review. For valid rows, targets averages the teachers’ one-hot votes. Inspect disagreements and systematic mistakes against your labelling rules. Invalid rows can’t be finalised. Set SQWISH_LABEL_JOB_ID to your job’s ID. After reviewing and accepting rows 0 and 1:
Use the original row indices, not positions on a page. Finalising returns the dataset and changes the job to finalized. A different selection later conflicts. When the reviewed selection must change, start another job.

Choose the evaluation rows

Finalising also takes evaluation_fraction, from 0.1 to 1. It is 0.2 by default. The console offers the same choice before you finalise.
  • A mixed dataset needs at least two selected rows, with distinct contexts for training and evaluation.
  • At 1 the dataset is evaluation only, and a single reviewed context is enough.
  • To choose each row’s side yourself, send training_indices and evaluation_indices in place of row_indices. They work like a dataset’s training and evaluation parts (choose the evaluation set).
The dataset keeps its teacher and source lineage. Inspect it like any other dataset before you tune or train.

Discard or delete

A dataset you finalised from a source stays when you delete the source. Delete that dataset separately.