Refine vision field candidate classification

This commit is contained in:
Sean McElwain 2026-05-30 22:26:32 -05:00
parent d542bcfdf8
commit 8d3f7d3013
1 changed files with 9 additions and 2 deletions

View File

@ -649,7 +649,14 @@ def build_vision_candidate_fields(classification: dict[str, Any]) -> list[dict[s
lower = text.lower()
if "cvs" in lower or "pharmacy" in lower:
if any(token in lower for token in ["extracare", "member", "coupon", "survey", "rewards"]):
fields.append({
**base,
"candidate_type": "receipt_message",
"value": text,
"confidence": 0.45 if (conf or 0) >= 60 else 0.25,
})
elif "cvs" in lower or "pharmacy" in lower:
fields.append({
**base,
"candidate_type": "merchant_or_header",
@ -721,7 +728,7 @@ def build_vision_field_suggestions(
for field in candidate_fields or []:
candidate_type = field.get("candidate_type")
if candidate_type == "symbol_or_noise":
if candidate_type in {"symbol_or_noise", "receipt_message"}:
continue
confidence = float(field.get("confidence") or 0)