Member-only story
Build a Receipt Parser with GPT-3
2 min readSep 12, 2022
In this tutorial, I would like to walk through how you can build a receipt parser with Tesseract.JS and GPT-3.
The idea here is we take the scanned receipt image, do an OCR with Tesseract.js and call GPT-3 to extract the receipt number, date and amount.
Receipt number: MGA480000366
Date: 11/08/2022
Amount: $31.36
We will see if GPT-3 is able to extract the right information.
Create NodeJS App
We will create a NodeJS app to perform an OCR on the scanned receipt image.
Install the following libraries:
npm install openai fs
Register an account with OpenAI and get the API key.
Play around with OpenAI Playground to test and check the result.
If you are satisfied with the result, let’s continue to create the NodeJS app.