Rating

Score a media or text item on a numeric scale, optionally against a reference.

Rating tasks ask annotators to score one media or text subject on a predefined scale, like the classic Likert-style 1-to-5 or 1-to-7 question. You can also show one non-selectable media reference when the score depends on fidelity to an original.

When to use it

  • Scoring a model output on perceived quality
  • Checking whether an edit preserves the identity or features of a reference image
  • Likert-scale surveys (agreement, satisfaction, confidence)
  • Jobs where you want the full distribution of scores, not just a winner

Datapoint shape

{
  "media": {
    "reference": [{ "url": "dp://e7d921ab3c45/shoe1.png", "type": "image" }],
    "subject": [{ "url": "dp://e7d921ab3c45/shoe2.png", "type": "image" }]
  }
}

media.subject

FieldTypeDescription
url*stringA dp:// reference returned by POST /media, or a public https URL.
type"video" | "image" | "audio"Determines which player the annotator sees. Inferred from the uploaded media, or from the URL's file extension — only required when a public URL has no extension to infer from.

media.reference

FieldTypeDescription
url*stringA dp:// reference returned by POST /media, or a public https URL.
type"video" | "image" | "audio"Determines how the non-selectable reference is displayed. Inferred when possible.

Each datapoint can have at most one media subject and one optional reference. The reference is context only: annotators always score the subject, and the submitted answer remains a single numeric rating. The two media roles may use different supported media types. When there is no media subject, a reference is valid if the datapoint has non-empty context containing the text to rate.

Omit subject for a text rating, retaining reference only when the text is being judged against that media.

Text rating

For rating an abstract question with no specific media subject, send an empty media object — "media": {} — with no subject array. The annotator sees the prompt and scale only.

{
  "task_type": "rating",
  "instruction": "How likely are you to recommend this product to a friend?",
  "response_options": { "scale": [1, 2, 3, 4, 5] },
  "datapoints": [{ "media": {} }]
}

When you have several text passages to rate against the same question, put each passage in the datapoint's context, reference it with {context} in the job-level instruction, and submit one datapoint per passage:

{
  "instruction": "Rate how much you agree: {context}",
  "datapoints": [
    { "media": {}, "context": "Climate change is human-caused." },
    { "media": {}, "context": "Lemurs are reptiles." }
  ]
}

The {context} placeholder is substituted per datapoint at delivery time. Without it, context is stored on the datapoint but never shown to annotators; they would only see the bare instruction.

To rate a description against an image, keep the text in context and send the image under media.reference. The annotator sees the rendered question, the non-selectable reference image, and the rating scale; no media subject card is created.

{
  "task_type": "rating",
  "instruction": "How accurately does this description match the reference image?\n\nDescription: {context}",
  "response_options": {
    "scale": [1, 2, 3, 4, 5],
    "labels": { "1": "Not accurate", "5": "Fully accurate" }
  },
  "datapoints": [
    {
      "media": {
        "reference": [
          { "url": "dp://e7d921ab3c45/shoe1.png", "type": "image" }
        ]
      },
      "context": "A red shoe with white laces."
    }
  ]
}

Scale configuration

Rating jobs require a response_options object on the job body:

{
  "task_type": "rating",
  "response_options": {
    "scale": [1, 2, 3, 4, 5],
    "labels": {
      "1": "Very poor",
      "5": "Excellent"
    }
  },
  ...
}

response_options

FieldTypeDescription
scale*array of numbersAllowed rating values (at least 2). Any numeric array works; [1,2,3,4,5] is canonical but you can use [0,1] for binary or [1..10] for finer grain.
labels{ [value: string]: string }Optional human-readable labels for scale endpoints or intermediate values. Keys are string-stringified scale values.

Result shape

{
  "datapoint_index": 0,
  "mean": 4.0,
  "median": 4,
  "distribution": { "3": 2, "4": 6, "5": 2 },
  "total_responses": 10,
  "weighted_mean": 4.059,
  "weighted_distribution": { "3": 1.4, "4": 5.2, "5": 1.9 },
  "media": [
    {
      "media_id": "e7d921ab-3c45-4a2f-9b71-0d1e2f3a4b5c",
      "type": "video",
      "role": "subject",
      "label": null,
      "url": "/media/v2/e7d921ab-3c45-4a2f-9b71-0d1e2f3a4b5c?cid=...&exp=...&sig=...",
      "thumbnail_url": "/media/v2/e7d921ab-3c45-4a2f-9b71-0d1e2f3a4b5c?cid=...&exp=...&sig=...&preview=1"
    }
  ]
}
FieldTypeDescription
meanfloat | nullArithmetic mean, rounded to 3 decimals. null if no responses yet.
medianfloat | nullMedian across responses. For even N, the average of the two middle values.
distribution{ [value: string]: count }Frequency count per rating value. Keys are stringified scale values.
total_responsesintValid numeric responses counted.
weighted_meanfloat | nullMean where each response is weighted by a platform-computed reliability score instead of counted equally. Rounded to 3 decimals, or null when there are no eligible responses. (There is no weighted median.)
weighted_distribution{ [value: string]: float }The weighted counterpart of `distribution` (see `weighted_mean`). Rounded to 3 decimals.
mediaarrayThe datapoint's media subject and optional reference, so you can tie each result row back to its assets. A text rating with a reference contains only that reference; an unreferenced text rating is empty. See the fields below.

Each entry in the media array describes one media item on the datapoint:

media[]

FieldTypeDescription
media_idstringStable identifier for the media item.
type"video" | "image" | "audio" | nullThe media item's type.
role"subject" | "reference"Whether the item is scored (`subject`) or shown as non-selectable context (`reference`).
labelstring | nullThe value key this item maps to; null for rating, whose media is the scored subject rather than a vote key.
urlstringSigned, relative proxy URL for the media; valid for roughly one hour.
thumbnail_urlstringSigned, relative preview URL; valid for roughly one hour.

Example

curl -X POST https://api.trydatapoint.com/data-labelling/v1/jobs \
  -H "X-API-Key: $DATAPOINT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "edit-identity-preservation-v1",
    "instruction": "Do people, animals, or objects maintain their original identity and features after the edit?",
    "task_type": "rating",
    "response_options": {
      "scale": [1, 2, 3, 4, 5],
      "labels": { "1": "Not preserved", "3": "Partially preserved", "5": "Fully preserved" }
    },
    "max_responses_per_datapoint": 10,
    "datapoints": [
      {
        "media": {
          "reference": [
            { "url": "dp://e7d921ab3c45/shoe1.png", "type": "image" }
          ],
          "subject": [
            { "url": "dp://e7d921ab3c45/shoe2.png", "type": "image" }
          ]
        }
      }
    ]
  }'

Common errors

StatusCause
400Missing response_options.scale.
400scale has fewer than 2 values.
400media.subject has 2+ items (0 is allowed for text-only rating).
400media.reference has 2+ items, or a reference is sent without either a media subject or non-empty text context.
400A text rating with reference media has an instruction or dimension that does not contain {context}.
422Datapoint sent without a media value (send "media": {} for text-only rating).

Next