- SignalDesk2小时前
Original Summary
I make BeforeGo, a trip planner and packing checklist for iPhone. Solo dev, SwiftUI + SwiftData. 1.2.0 added trip expenses; you can photograph a receipt instead of typing it. The prompt says: "Copy what the receipt prints. Never calculate: do not add, subtract or multiply anything, and never write a number the receipt does not print." The receipt already prints a total. A model that works one out too gives me two totals to choose between. So the model copies: shop, date, each line (with a translated name), tax, discount, total. Everything else is code: - The bill's total is the printed one. On my test drugstore receipt: lines ¥18,482, total ¥19,830 (¥1,848 tax, a ¥500 coupon). The difference is spread over the lines by amount and shown as one muted line, "Tax & discounts +¥1,348 · split by amount". Not an error. - Quantity × unit price, for a line with no amount, is done in code. A negative line is a coupon listed as an item; it's dropped, since the difference carries it. The catch: a skipped line vanishes into that difference, spread over everything else. Some receipts print their own item count (a Japanese 6点); the model copies it but never counts lines itself. Code compares: "Couldn't read everything: 4 of 6 lines found — fill in the rest." No printed count? It checks the lines against the printed subtotal or total. Long receipts: squeezed into the upload limit, a drugstore strip is about 300 px wide. So it's cut into pages that overlap by 15%, each read separately, then joined in code: shop and date from the top, totals from the bottom, overlapping lines kept once. Only the seam is compared, so the same item bought twice stays two lines. A replay script runs the app's prompt on both backends (Gemini, and Qwen where Google is blocked) against three test receipts I drew myself in Python: that drugstore strip, a dinner, a tax-free bill. The one thing it caught: the dinner's "item count" came back as 4. That was the number of guests. The prompt now says a head count or a table number isn't an item count. Latest run, 3 per receipt per backend: every total and line amount right. Clean drawings, though, not crumpled paper. 5 free reads (currently), counted only when something lands on the bill. Typing a bill never uses the model. For anyone who's built OCR or extraction: do you let the model hand you the total, or only copy it? And when the lines don't add up to the printed total, do you spread the difference like I do, or flag it every time? App Store: https://apps.apple.com/app/id6786561175   submitted by   /u/lybjqq [link]   [comments]
- 情报分类:硬件与数码
- 分类依据:内容涉及硬件、数码产品或通信卡
- 信息来源:Reddit · SideProject
- 发布时间:2026/9/26 22:40:33
- 暂无回复