Turn candidate questions into measurable features and test them on held-out examples.
Input and workflow
Build one numeric feature column per question. Split by author or document before evaluating which features improve the downstream classifier.
Request
{
"model": "ngila-judge",
"state": "Could you please confirm the shipment date when you have a moment?",
"questions": {
"polite": {
"type": "noul",
"instructions": "Does the writer use a courtesy phrase?"
},
"urgent": {
"type": "noul",
"instructions": "Does the writer require an immediate reply?"
}
}
}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 = 'Could you please confirm the shipment date when you have a moment?'
questions = {'polite': {'type': 'noul',
'instructions': 'Does the writer use a courtesy phrase?'},
'urgent': {'type': 'noul',
'instructions': 'Does the writer require an immediate reply?'}}
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.
features = [a[k]["noul"] for k in ("polite","urgent")]