Intelligent Document Extraction for Logistics and Supply Chain

Intelligent Document Extraction for Logistics and Supply Chain

MAY 31ST, 2023

In today’s hyper-connected, globally competitive business environment, effective and efficient supply chain management has become a strategic necessity. At the heart of this complex web of goods and information flows lies document processing, an often overlooked yet vital aspect of supply chain operations.


Supply chain document processing involves the acquisition, organization, and management of various forms of documents such as invoices, packing slips, bill of ladings, purchase orders, delivery notes, and many others. The accuracy, speed, and efficiency with which these documents are processed can have a profound impact on the overall performance of the supply chain.


Document processing serves as the nerve center of the supply chain, facilitating communication and coordination between various stakeholders. It ensures seamless data exchange, reduces errors, accelerates delivery times, and ultimately improves customer satisfaction. Moreover, it aids in compliance with regulatory standards, reducing the risk of financial penalties and reputational damage.


With the rise of document AI, it is becoming clear that companies that do not embrace this new technology will become obsolete by the competitors who do. Although current Intelligent Document Processing (IDP) do offer some vertical specific pre-trained models, more often than not thy are not accurate or complete enough to work on company specific data at scale.


The alternative is for each company to build their own custom AI model and host it, but that is easier said than done. Creating custom AI models and setting up the infrastructure around is a very challenging task that require a large team of experts in machine learning and devops infrastructure which most middle size companies cannot afford or don’t even know how to start.


In this tutorial, we will show how to train a custom AI model on logistics documents, host it and integrate it in a workflow without any coding required or extensive AI knowledge. Let’s dive in!

Training Custom Model for Logistics

Logistics companies such as freight forwarders usually deal with a large variety of unstructured document coming from many importers importers across the world, each with their own invoice and bill structure. As such, each logistic company might be dealing with different type of documents that require a custom trained AI model to be able to ingest it and understand it.

The process of training the model involves creating a custom training dataset on the company’s data and feeding the data to the model to get train on. For this tutorial, we are going to train an Named Entity Recognition (NER) model on over 110 labels that are relevant to the logistic domain, here are some of them:


Here is an example of a bill of lading:

Intelligent Document Extraction for Logistics and Supply Chain

Bill of lading example

As shown in the template above, the invoice contains unstructured text and semi-structured section in the form of tables. To extract relevant entities from the tables, we label both the description of the item such as the storage_description and storage_charges and later on link them together during the extraction process.

To label the data and train the model, we use UBIAI Text Annotation Tool which provides easy-to-use labeling interface as well as model training capabilities of state-of-the-art models with just few clicks. Here is an example of a labeled logistic invoice:

Intelligent Document Extraction for Logistics and Supply Chain

Logistic invoice labeling in UBIAI

The dataset contain about 7 different template type from each vendor. Using model training feature in UBIAI, we can create 7 smaller template models that require only 5 labeled documents per template. Once the models are trained, we will use the compose option in UBIAI to aggregate them into one single model.

Using this approach, we save a significant labeling time as we don’t need to train a full on deep learning model that requires hundreds or thousands of labeled documents.

Deploying Custom Model in AI Builder

To deploy the model in production, we are going use the newly launched tool called AI Builder where we can deploy our model and connect to a business workflow with just few clicks.

Deploying the model can be done with few click: Simply drag and drop the Form Recognizer module and select our trained composed model from the list. Then we integrate the Form Recognizer node into a workflow:

  1. Import PDF and images
  2. OCR
  3. Form Recognizer: Extraction using our new custom AI model
Intelligent Document Extraction for Logistics and Supply Chain

AI Builder workflow creation dashboard

Document Processing Using Custom Logistic Model

Once the model is trained, we run a test on a new invoice:

Intelligent Document Extraction for Logistics and Supply Chain

Predictions review in AI Builder

The model predictions are mostly correct, although there are some missing entities such as the packaging description.

AI Builder offers comprehensive Human-in-the loop review process to correct model prediction and re-train the model on the corrected dataset to improve its performance.


The role of document processing in supply chain management is not to be understated. Despite the perceived challenges in adopting document AI, this technology offers transformative potential. The integration of custom AI models for document processing can substantially optimize supply chain operations by enhancing accuracy, reducing errors, and facilitating faster deliveries, thus leading to improved customer satisfaction. Furthermore, this adoption is not limited to corporations with extensive resources or sophisticated AI knowledge. As demonstrated in this tutorial, it’s entirely possible to train, host, and integrate a custom AI model for logistics documents without the need for extensive coding or AI expertise.

Embracing this innovative technology today will prepare companies for a more competitive, efficient, and digitally advanced future in supply chain management.


If you are looking to automate data extraction from logistics documents, please schedule a demo today!