I am trying to build an OCR feature in my Flutter app that can read hotel bills in multiple formats. The challenge is that these bills do not follow a fixed layout. From each bill, I need to extract structured fields such as:

  • Hotel name

  • Bill number

  • Guest name

  • Address

  • Check-in date/time

  • Check-out date/time

  • Total amount

I have tried several Flutter OCR packages such as:

  • google_mlkit_text_recognition

  • flutter_native_ocr

  • Others…

The issue is that these packages return raw/unformatted text, and because the bill formats vary a lot, it's difficult to extract fields reliably.

Currently, my workaround is:

  1. Extract text using flutter_native_ocr

  2. Send the raw text to ChatGPT Text API

  3. Ask ChatGPT to parse and extract the required fields

This works around 90% correctly, but the API cost is high and the response time increases.

My Questions:

  1. What is the best way to build an OCR system that can handle multiple bill formats and still extract structured data reliably?

  2. Is there any open-source approach, ML model, or architecture commonly used for this (e.g., text classification + regex + ML models)?

  3. Are there any articles, examples, or libraries for invoice/bill parsing in Flutter or using a backend service?

  4. How can I reduce dependency on expensive LLM APIs while still getting clean structured data?

1 Reply 1

Yes a very practical and cost-effective approach is to use PaddleOCR for text extraction and then send only the cleaned raw text to a small LLM like GPT-4o-mini just for structuring the data into JSON. PaddleOCR has excellent accuracy for printed hotel bills and invoices, and using GPT only for semantic parsing cuts both cost and latency significantly. You can further reduce LLM usage by applying basic regex or rule-based extraction first and falling back to GPT only when fields are unclear. This hybrid pipeline is what many production systems use today.

Your Reply

By clicking “Post Your Reply”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.