Track which talking points have already been covered in a transcript.
Input and workflow
Merge new coverage into a persistent set. Process overlapping transcript windows so sentences split between chunks can still satisfy a note.
Request
{
"model": "ngila-judge",
"state": {
"transcript": "Service will resume at noon. Keep your ticket for the replacement bus.",
"notes": [
"restart time",
"replacement transport",
"refund process"
]
},
"questions": {
"time": {
"type": "noul",
"instructions": "Was the restart time covered?"
},
"transport": {
"type": "noul",
"instructions": "Was replacement transport mentioned?"
},
"refund": {
"type": "noul",
"instructions": "Were refund steps explained?"
}
}
}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 = {'transcript': 'Service will resume at noon. Keep your ticket for the '
'replacement bus.',
'notes': ['restart time', 'replacement transport', 'refund process']}
questions = {'time': {'type': 'noul', 'instructions': 'Was the restart time covered?'},
'transport': {'type': 'noul',
'instructions': 'Was replacement transport mentioned?'},
'refund': {'type': 'noul', 'instructions': 'Were refund steps explained?'}}
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.
covered.update(k for k,v in a.items() if v["noul"] >= threshold)