AI multi-label classsification for recognizing individual products

Viewed 30

I'm working on an AI-project for recognizing text from PDF-docs. I want to label the examples to train the AI-model, but I am standing on a cross road and don't know what method to choose. Here is some background about the use case.

The PDF-docs exists out of multiple pages, from now on called a packet. These individual pages represent the products that exists in the packet. The layout of these products is always the same, but the labels (how and which data is saved in source system) can differ a lot. Example: the product house, car, motor, scooter, and boat can exist in one packet. The information that needs to be saved for each product is different. Like license number for car, motor and scooter, but m2 for house, for example.

There exist over 350 different products. So there are too many possible combinations. For this project I just want to recognize 7 different products. So is it better to label the packets as a whole and train the model on this. Or is it better to split the packet into the individual product first, and then offer the individual product to the corresponding model.

  • A = Don't split the packet into the individual product. Train model as a whole packet.
  • B = Split the packet into individual products. Each product will get it's individual model.

There is an image to help clarify the text above:

Option A or Option B visualization

enter image description here

1 Answers

I would approach this problem differently.

I assume similar product pages have similar ways of how to parse them, for example: cars always have the registration year at this spot (be it after some keyword or (x, y) coordinates).

First, write for each product page the corresponding parsing rules to get the information you need. There are libraries for parsing text out of pdf, here is the python example.

Then, split packets into individual pages, and train one machine learning model to be able to classify "what product is it?".

The full pipeline will look like, 1. split the packet into pages 2. classify each product page into its category 3. apply the corresponding parsers 4. combine back (I that's what you intend)


For the classifier I would choose something simple as a decision tree/ random forest on keywords or something complex as a text-based neural network.

Related