Skip to content

Instantly share code, notes, and snippets.

@HelgeSverre
Created May 15, 2023 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HelgeSverre/cea6cb9c9b3b9fa633e04079f0c1c5c2 to your computer and use it in GitHub Desktop.
Save HelgeSverre/cea6cb9c9b3b9fa633e04079f0c1c5c2 to your computer and use it in GitHub Desktop.
Receipt scanning with GPT-3 incl prompt
// Tokens: 371
// Characters: 833
BUNNPRIS BUNNPRIS LINDVIK Butikkdrift Akgeyik AS Foretaksregisteret ORG. NR. 813 499 002 MVA BEKKEVEIEN 14 5096. BERGEN TLF:55 29 78 67 SALGSKVITTERING Butikknr. 704 Butikknavn BUNNPRIS LINDVIK Kvitt. 1506131 23.02.2023 18:08:44 Operator 70445 Term. nr 7042 Herav mva 20.52 Ant. varer 5 *NIVEA ROLL-ON DRY COMFORT 50ML 20.93 *BLIW HANDSAPE MIKS 300ML 27.90 #MILK CHOCOLATE COOKIE AUNT MABEL 44.90 #KIMS POTETGULL PEPPER PUNCH 200G 32.90 3.00 *BAREPOSER TOTALT A BETALE 129.63 129.63 BANK MVA% Grunnlag MVA Totalt 41.46 10.37 51.83 *25.00 67.65 10.15 77.80 #15.00 Bax: 10309778-627085 23/02/2023 18:08 Overf.:400 BankAxent Contactless *******8867-7 AID: D5780000021010 Ref.: 999821 008352 KC1 TVR:8000008000 Resp.: 00 NOK KJOP 129,63 GODKJENT TAKK FOR HANDELEN Apent 09-22, lor 09-20 Besok OSS pa www.bunnpris.no B70470422302230150613
extract the following information:
- order Ref
- date (date): format with ISO-8601
- tax amount (taxAmount)
- shipping amount (shippingAmount)
- total amount (totalAmount)
- currency (currency)
- seller / store (name, vatId, address, city, zip, country, email, phone) (use "merchant" as key)
- line items (name, qty, price, sku) Format prices using period as decimal and remove the currency.
- If you don't find any suitable values use null
- the date should be formatted using the following template: YEAR-MONTH-DAY
- format phone number with E.164
RECEIPT
[REPLACE_TEXT]
OUTPUT IN JSON
// Tokens: 636
// Characters: 1053
{
"receipt": {
"orderRef": null,
"date": "2023-02-23",
"taxAmount": 51.83,
"shippingAmount": null,
"totalAmount": 129.63,
"currency": "NOK",
"merchant": {
"name": "BUNNPRIS LINDVIK",
"vatId": "813 499 002",
"address": "BEKKEVEIEN 14",
"city": "BERGEN",
"zip": "5096.",
"country": "NO",
"email": null,
"phone": "+4755297867"
},
"lineItems": [
{
"name": "NIVEA ROLL-ON DRY COMFORT 50ML",
"qty": 5,
"price": 20.93,
"sku": null
},
{
"name": "BLIW HANDSAPE MIKS 300ML",
"qty": 1,
"price": 27.9,
"sku": null
},
{
"name": "MILK CHOCOLATE COOKIE AUNT MABEL",
"qty": 1,
"price": 44.9,
"sku": null
},
{
"name": "KIMS POTETGULL PEPPER PUNCH 200G",
"qty": 1,
"price": 32.9,
"sku": null
},
{
"name": "BAREPOSER",
"qty": 1,
"price": 3,
"sku": null
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment