Console ↗

Composite scoring

Break a quality judgment into individual dimensions. Combine them with weights appropriate to your application.

Input and workflow

Scale clarity into the same range as actionability. Save the inputs to the formula so a change in policy weights does not require new model calls.

Request

{
  "model": "ngila-judge",
  "state": "To reset the clock, hold Set for three seconds and select your time zone.",
  "questions": {
    "clarity": {
      "type": "score",
      "instructions": "Rate clarity.",
      "criteria": [
        "Vague",
        "Understandable",
        "Precise"
      ]
    },
    "actionable": {
      "type": "noul",
      "instructions": "Is there a concrete action the reader can take?"
    }
  }
}

Open request in Playground →

Run locally

Save ngila.py alongside your script and set NGILA_API_KEY. Save any linked input images in the same directory.

import json
from ngila import NgilaClient

state = 'To reset the clock, hold Set for three seconds and select your time zone.'
questions = {'clarity': {'type': 'score',
             'instructions': 'Rate clarity.',
             'criteria': ['Vague', 'Understandable', 'Precise']},
 'actionable': {'type': 'noul',
                'instructions': 'Is there a concrete action the reader can '
                                'take?'}}

response = NgilaClient().system_one(state, questions)
a = response["answers"]
print(json.dumps(a, indent=2, ensure_ascii=False))

Use the answers

The following application fragment uses a = response["answers"]. Supply any thresholds, lookup tables, or previous results from your workflow before applying it.

quality = .6 * a["clarity"]["score"] / 2 + .4 * a["actionable"]["noul"]

Browse cookbooks · System One request and response