Pass both the claim and the quoted passage as state. Route unsupported or ambiguous claims to an editor.
Input and workflow
Keep the source identifier with the result. Distinguish insufficient evidence from a contradiction when you show a reviewer why a citation was flagged.
Request
{
"model": "ngila-judge",
"state": {
"claim": "The museum opens on Monday.",
"source": "Open Tuesday to Sunday, 10 am to 6 pm."
},
"questions": {
"support": {
"type": "choice",
"instructions": "How does the source relate to the claim?",
"criteria": {
"Supports": "",
"Contradicts": "",
"Insufficient information": ""
}
}
}
}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 = {'claim': 'The museum opens on Monday.',
'source': 'Open Tuesday to Sunday, 10 am to 6 pm.'}
questions = {'support': {'type': 'choice',
'instructions': 'How does the source relate to the claim?',
'criteria': {'Supports': '',
'Contradicts': '',
'Insufficient information': ''}}}
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.
label = a["support"]["choice"]
requires_review = label != "Supports"