Compare structured product records, including size and model numbers. Ambiguous matches should be reviewed before merging.
Input and workflow
Keep identifier and variant differences visible to the reviewer. Only automatic matches should enter a separate merge workflow.
Request
{
"model": "ngila-judge",
"state": {
"left": "Aster mug 350 ml, blue",
"right": "Aster blue coffee mug 250 ml"
},
"questions": {
"match": {
"type": "choice",
"instructions": "Are these the same product variant?",
"criteria": {
"Exact match": "",
"Different variant": "",
"Unclear": ""
}
}
}
}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 = {'left': 'Aster mug 350 ml, blue', 'right': 'Aster blue coffee mug 250 ml'}
questions = {'match': {'type': 'choice',
'instructions': 'Are these the same product variant?',
'criteria': {'Exact match': '',
'Different variant': '',
'Unclear': ''}}}
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.
match = a["match"]
review = match["choice"] != "Exact match" or match["confidence"] < threshold