Choice, score and noul questions

A request carries one state (the text to judge) and up to 32 questions. Each question has one of three types. Every question is answered independently against the same state, in a single forward pass, so adding one more question never changes the others.

Explore the three types

Pick a type to see how Laya reaches its answer, what you send, and what comes back. Then run it on your own text.

choice: pick one label

Like a multiple-choice quiz. Laya scores every option against the text, the scores add up to 100%, and the most likely one becomes the answer.

Example answer

What does the customer want?

Free demo, no key, processed in Switzerland.

You send (in questions)

choice questionjson
{
  "intent": {
    "type": "choice",
    "instructions": "What does the customer want?",
    "criteria": {
      "refund": "money back or a duplicate charge reversed",
      "technical_help": "a bug or integration problem",
      "cancellation": "wants to cancel",
      "other": "anything else"
    }
  }
}

You get back (answers.intent)

answer shapejson
{
  "type": "choice",
  "choice": "refund",                 // the most probable label
  "probabilities": { "refund": 0.9466, "technical_help": 0.0071, ... },
  "confidence": 0.7899,               // 1 − normalised entropy
  "action": { "act_probability": 1.0 }
}

Tips for choice

  • Describe each label in criteria (a short phrase each). Bare names give the model less to work with.
  • Always include an "other" option so unrelated text has somewhere to go.
  • Keep it small. Accuracy drops on big taxonomies (Banking77, 77 labels: 0.425), so split into a coarse and a fine question.

Reference: the three question types

choice — pick one label

choicejson
"intent": {
  "type": "choice",
  "instructions": "What does the customer want?",
  "criteria": {
    "refund": "money back or a duplicate charge reversed",
    "tracking": "where is my parcel",
    "other": "anything else"
  }
}
// criteria may also be a plain list: ["refund", "tracking", "other"]

score — ordinal levels

scorejson
"frustration": {
  "type": "score",
  "instructions": "How frustrated does the customer sound?",
  "criteria": ["calm", "concerned", "annoyed", "very angry"]
}
// answer.score is the expected level index (0-3 here), answer.probabilities the distribution

noul — is this statement true?

nouljson
"urgent": {
  "type": "noul",
  "instructions": "Does the message communicate time pressure?",
  "criteria": { "true": "a deadline or 'today/now' is stated", "false": "no time pressure" }
}
// criteria is optional; answer.noul is P(true)

Request fields

FieldDescription
statestring | object | arrayWhat to decide about. Objects are serialised to JSON. Only the first 512 (English) or 1,024 (multilingual) tokens per question are read — put the decisive text first.
questionsrequiredobjectMap of your question ids to definitions. Max 32 per request, max 64 options per question.
model"english" | "multilingual" | "typed-decision…Pin a checkpoint. Omitted (or an unknown id such as a Jev model name) → automatic routing.
langstringLanguage hint ("en", "de", "pt-BR"). Beats automatic detection, which can mistake short non-English Latin-script text for English.

Choosing thresholds

Laya's checkpoints ship over-confident before per-task calibration (the model card reports mean ECE falling from 0.466 to 0.081 after temperature fitting). Treat confidence as a ranking signal: collect a few hundred labelled examples, find the confidence above which accuracy meets your bar, automate above it and send the rest to a human. See calibrated probabilities and act/escalate routing.

Tips for writing good questions

  • Describe each label in criteria; bare label names give the model less to work with.
  • Keep label sets small. Accuracy drops on large taxonomies (Banking77, 77 labels: 0.425) — split into a coarse question and a fine one.
  • Ask one thing per question. Each question reads the state once and is billed its input tokens, so ask only what you act on; five focused questions answer better than one compound one.
  • If a noul answer seems to follow its own true/false wording rather than the text, rephrase it as a two-option choice with neutral keys.
  • For the four typed-decision workflows (customer service, invoices, security incidents, agent traces), pass "model": "typed-decisions".