How it works
Code reads the numbers.
The model picks a product.
A clear match becomes a ready row. An uncertain match becomes one short question, with a suggestion when available.
From slip to ledger
A small, deliberate pipeline
Parse
Code reads quantity, unit, price and pack size, normalising supported digits and spellings.
Match the text
Fuzzy matching needs a score ≥ 0.5 and a lead ≥ 0.08 over the next candidate.
Ask the model if needed
If fuzzy cannot name the product, the local model picks from the top 8 candidates or abstains.
Check every pick
All 16 rules must pass for Ready. Otherwise the row is Needs you.
Greetings and notes can become grey, ignored rows. “Treat as item” overrides this.
A boundary learned by testing
The model never owns a number
In the first trial, the model changed petti (carton) to packet in 3 of 4 lines, despite the prompt’s definition.
Now code supplies every number. The model returns only product evidence, a catalogue SKU and a status.
Source: Design D2–D5. Trial on synthetic development examples, not shop orders.
S1–S16
What stops a row becoming green
The first failed rule supplies the question. Examples are synthetic data.
| Rule | Check | Example caught | Operator question |
|---|---|---|---|
| S1 | An unsure decision needs review. | lays 10 wala has no flavour. | Is it …? / Which product is “…”? |
| S2 | The product must exist in the catalogue. | The model invents PRLG-50. | Which product is “…”? |
| S3 | The model must pick from its shortlist. | A pick outside the candidates it was shown. | Which product is “…”? |
| S4 | A product must be chosen. | No confident match. | Which product is “…”? |
| S5 | Written price must match MRP; conflicting prices ask. | parleg 10 wala matched to a ₹5 pack. | Which ₹10 item? / Which price? |
| S6 | Written size and dimension must match a known variant; conflicts ask. | fortune 5 litre matched to a 1 L pouch. | Which 5000 ml item? / Which pack size? |
| S7 | With two different number + unit pairs, drop a pair only if its number and unit occur in a product name/alias. Exactly one pair must remain. | maggi 4 pack 1 petti → 1 carton; maggi 4 ctn 1 pkt stays unresolved. | Which quantity: 4 packet or 1 carton? |
| S8 | Model quantity/unit must agree with code. Price/size cannot fill a missing quantity. | Model changes petti to packet. | Is it carton? / How many? |
| S9 | All model evidence words must occur in the order. | The model quotes words that were never written. | Is it …? |
| S10 | The order’s words must score the model pick ahead of every candidate by ≥ 0.08. | lays 10 wala picks Classic Salted due to a shorter alias. | Is it Lay’s Classic Salted (₹10 pack)? |
| S11 | Quantity must be present, whole and between 1 and 10000. | maggi bhej dena | How many? |
| S12 | Never guess an unknown unit, even if the proposal supplies a known one. | 10 jodi or 2 ladi | What is “jodi”? packet or carton? |
| S13 | Fill a missing unit only for an item sold in exactly one unit. | aashirvaad 5kg 2 can use bag; items with multiple selling units ask. | packet or carton? |
| S14 | The unit must be one the item is sold in. | fortune 5 litre 1 petti | … is sold by piece. Which one? |
| S15 | Cartons need a known carton size. | clinic plus 2 petti | How many in one carton of …? |
| S16 | A comma between digits that isn't a proper grouping is never read as a number. | maggi 1,5 pkt (1.5? 15? 1 and 5?) | What does “1,5” mean? |
Source: Safety rules. Product names are examples in a synthetic catalogue; no affiliation.
L1–L5
Remember a name, keep the checks
A correction is saved in a local CSV; no training.
| Rule | Boundary | Why it matters |
|---|---|---|
| L1 | Only unknown names can be learned; UI and server both enforce it. | tata tea premium needs its size resolved. |
| L2 | Names refer to products across variants. | lais peela learned at ₹10 must still find the ₹20 pack. |
| L3 | Written price or size selects the variant. If neither resolves it, ask. | lais peela 3 ctn stays amber, with a suggestion. |
| L4 | Learned names pass every safety rule. | Price, size, quantity and unit checks still apply. |
| L5 | Save only an explicitly confirmed row with “Remember” ticked. | Skipped and automatic rows never teach a name. |