Skip to content

Receipt OCR


OCR (Optical Character Recognition) is a technology that recognizes text within images to obtain structured text information. We will use DataInterpreter for OCR information extraction from various types of receipts.

Example: Shopping Receipt Recognition


Use DataInterpreter to perform OCR recognition on the following receipt, extract and save the total amount.


Note: You need to install Paddle-related dependencies to run this example, execute pip install metagpt[ocr]

python examples/di/
python examples/di/

Execution Results

DataInterpreter will save a csv file containing the total amount under current working directory.

Mechanism Explained

Use DataInterpreter to first generate a plan, then generate tool code based on paddle OCR, execute OCR processing to recognize text information in the image of the catering invoice, extract relevant data, and organize these data into a table file.

Released under the MIT License.