# Score

A numeric score on a scale whose levels you describe in words.

Source: https://shvydko.ai/en/docs/primitives/score

## Define an ordered scale

criteria is an array of 1–255 descriptions ordered from the first level to the last. Indices start at 0. With three criteria, the result is between 0 and 2.

Describe an observable difference between levels. For urgency, this could be the impact on work and the availability of a workaround; for relevance, how well something matches a specific request.

### Score in a complete request

```json
{
  "state": "Card payment is not working. Cash on delivery is available. The customer asks for help placing an order.",
  "questions": {
    "urgency": {
      "type": "score",
      "instructions": "Rate the urgency of the request using the levels provided.",
      "criteria": [
        "An informational question; nothing is blocked",
        "There is an inconvenience, but another way to complete the action is available",
        "The action is completely blocked; prompt assistance is needed"
      ]
    }
  }
}
```

## Score can be fractional

score estimates a position on the scale; it is not a text label for a level. probabilities uses string index keys: “0”, “1”, “2”. confidence is returned separately. The service also returns legend: level descriptions keyed by their indices.

Decide in your code whether you need a continuous score, a rounded level, or a threshold decision. Do not convert score to a probability percentage: your criteria define the scale.

### Illustration of answers.urgency; not a run result

```json
{
  "type": "score",
  "score": 1.1,
  "probabilities": {
    "0": 0.05,
    "1": 0.8,
    "2": 0.15
  },
  "legend": {
    "0": "An informational question; nothing is blocked",
    "1": "There is an inconvenience, but another way to complete the action is available",
    "2": "The action is completely blocked; prompt assistance is needed"
  },
  "confidence": 0.7
}
```

## Compare using the same scale

Use the same instructions and criteria to rank multiple records. If you change the number or meaning of levels, old and new scores will no longer be directly comparable.

Check not only average error, but also cases where a one-level error has different consequences. Critical thresholds need a separate evaluation of false negatives and false positives.

## Related documentation

- [Choice](https://shvydko.ai/en/docs-markdown/primitives/choice.md)
- [Decision confidence](https://shvydko.ai/en/docs-markdown/confidence.md)
- [How to evaluate the model](https://shvydko.ai/en/docs-markdown/evaluation.md)
