First of all, I am fairly new to the ML world. I have researched quite a lot on the different use cases that ML have, both in regards to working with text and images.
I am trying to build a "pipeline", that can extract a few data points from various supplier invoices:
- Invoice number
- Line items (that resides in tables)
- For each line item, I would need: quantity and line amount
My first thought was to just use a classic OCR parsing tool such as DocParser (which is basically a template-based OCR parsing tool, where you can create parsing rules for each different type of invoice layout). However, I took a look at my suppliers, and I have a lot of different layouts (with new ones being added regularly).
I was thinking if ML can be used to accomplish this task?
My idea for a pipeline:
- All supplier invoices are converted from PDF to an image file (.jpg) and then resized so all have the same width and height.
- Train a custom model to extract invoice number using named entity recognization (NER)
- Train a custom computer vision model to identify tables that contain line items (product information)
- For each table found, extract that as an image and train another model to identify the entities that I need for each line: quantity and line amount
I am not sure if this is a good approach to this problem? Does it make sense to ultimately end off with three models to extract the information that I need? Is there an easier way to detect the quantity and line amount, than by first locating the table on the PDF file?
Does anyone have any experience with a similar process?