Decisions and probabilities
Every capability returns a typed decision plus the numbers behind it: probability, confidence, score, and character offsets.
A capability never returns prose. It returns a decision your code can branch on, plus the numbers behind that decision. This page explains each number, and what it does not tell you.
The API rounds every probability and score to three decimals. Offsets and level stay integers.
The four numbers
scores accompanies classify (an object keyed by label name) and rate (an array in scale order). Both sum to 1.
Probability
probability measures how strongly the text supports one decision. The formula differs per capability.
Two booleans come straight from probability. yes-no sets answer to true at probability >= 0.5. verify sets matches the same way.
A real response, classify over a support ticket, three labels:
A yes-no probability without hints is an independent score, not a share of a pair. Do not compare it to a normalized classify probability on the same scale. Set a threshold per capability and per action.
Confidence
confidence is 1 − H(p) / ln(n). H is the Shannon entropy of the normalized scores, and n is the number of options. It measures the shape of the whole distribution, not the strength of the winner.
- Confidence near 1: one option dominates. The rest are near zero.
- Confidence near 0: the options split the mass. The winner won by very little.
confidencereturns1when fewer than two options exist.
Read probability and confidence together. A high probability with low confidence means two labels both scored high, and normalization gave one of them the lead.
yes-no, answer, entities, extract and verify do not return confidence. Use probability on those capabilities.
Score and level (rate)
rate returns two views of the same distribution. level is the index of the most likely level. score is Σ p_i · i, the probability-weighted position across the whole scale. rate returns no probability field.
A real response, scale ["Calm","Annoyed","Frustrated","Threatening to leave"]:
level is 2, but it beat level 1 by 0.001. score 1.585 sits between the two, and confidence 0.371 reports the ambiguity. Use score for trends and sorting. Use level only when confidence is high.
Spans
answer and entities return spans of your input text, never generated words. start and end are character offsets into the text you sent, so you can highlight or redact the exact characters.
A real response, answer over a batch of questions, including one the text cannot answer:
When nothing fits, answer, start and end are all null, and probability is 0. Check for null before you slice the text.
entities sorts its spans by start ascending. An entity always carries start and end, never null.
verify returns no offsets. It returns found, the raw spans the model read for that field. Compare found against your value when matches is false.
A real response, verify of the value 4417 against a text that says #4471:
Read the numbers in code
That call returns:
These numbers differ from the capture at the top of the page, because the label descriptions differ. Label wording moves every number.
No API key is required during the launch period.
What the numbers do not mean
- They are not measured accuracy. A probability of 0.94 is the model’s score for that decision. It is not a promise that 94 of 100 such decisions are correct. Measure your own rates on a labelled set.
- They do not transfer between capabilities. A 0.8 from
yes-noand a 0.8 fromclassifycome from different formulas. Tune each one separately. - They do not transfer between label sets. Change a label, a description, or a hint, and every number moves. Re-check your thresholds after any wording change.
confidenceis not correctness. It reports the shape of the distribution. A confident wrong label is still wrong, and usually means the label text describes the wrong case.- A high
classifyprobability with a tiny label set proves little. Normalization spreads the mass over the labels you sent, and nothing else. extractreturns no probabilities. It returnsdatawithnullfor any value the text does not carry. Use verify when a field must be trusted.
Next
- Thresholds and confidence routing turns these numbers into act, confirm, and escalate bands.
- Writing good statements and labels shows why label wording moves every number on this page.
- Golden sets gives you the labelled data to measure real accuracy.