February 5, 2021

Those days are gone when analytics and artificial intelligence (AI) were nice-to-have components and were mostly used for reporting and empowering higher-level management to take quick business decisions. Today, people are leveraging the power of AI and analytics in every aspect of business to have an edge over the competitors.

We can take the example of source-to-pay applications, where AI could be the main driving force for each and every process within it. Adopting the power of AI within a procurement system can make it faster, automated and capable of protecting against the exceptions by generating prior notifications.

In recent times, AI has shown many promising facets to replace manual operations in procurement system with data-driven decisions; and still a lot of opportunities are there that can accelerate the company’s growth and transformation journey. Let’s discuss one such operational area of procurement where AI could increase the efficiency of automated invoice processing.

General ledger coding for non-PO based invoices

In any procurement system, the most important part is General Ledger coding, which helps to organize the expenses of a company. GL coding for purchase order (PO)-based invoices is easier as it is already given when the purchase requisition (PR) is created by the purchasing department. Selection of right GL code for the non-PO invoices is also extremely important in order to understand the company’s holistic view of the expenses or spends. It is, however, a difficult task to assign proper GL codes to non-PO invoices as suppliers directly send those without any PO reference. Mostly, free text item descriptions are present on the non-PO based invoices which makes it difficult for the invoice processors to guess or remember the proper GL codes to enter. As a result, the whole invoice processing takes extra time and results in delays to pay the supplier.

AI and machine learning (ML) techniques can be used to automate the GL code selection process for non-PO-based invoices in a procurement system.

AI algorithm for GL coding

An AI/ML model learns from the data and mines the underlying patterns to predict the outcome. For the GL coding use case, the AI/ML model is trained with two sets of past data – invoice data set and the corresponding GL codes (target field) data set. Post that, the trained model is used to predict the GL codes for the new or unseen invoices. This ML technique is known as supervised learning. There are further two types of supervised learning available – binary classification and multi-label classification. For GL coding, we have multiple segments of the GL codes to predict, so it is a multi-label classification problem. It has been observed that tree-based gradient boosting algorithms are very efficient for this kind of problem.

Once the model is trained, it can be integrated seamlessly with the procurement system to enable AI-based auto population of GL codes during invoice processing. AI/ML model will continue to learn and retrain itself over a period to increase its accuracy in making the right GL code predictions for new invoices.


One of the complex scenarios faced in the AI-based GL code is the multi-segment GL code prediction for invoices. Number of segments to be present in a GL code depends on the organizations’ business process. It is an extremely complex supervised AI/ML problem where we need to adopt a hierarchical classification approach to accurately narrow down the GL segment prediction. 

No AI/ML model can produce 100% accurate results.  The magnitude of error percentage depends on the existence of noise in the data, availability of historical data patterns and evolving AI techniques used. Improvement of AI model performance could be challenging at the beginning of the project. The error percentage can be reduced by applying more training data to the model and taking other strategies such as treatment of missing values, removal of outliers, parameter tuning etc. 

With proper strategies the accuracy can be achieved up to the range of 90-95%. For the instances having prediction outcomes with low confidence score, the human judgement would play a vital role to make the final decision. Artificial intelligence and human intelligence should go hand in hand to take faster decisions and make the solution reliable, consistent and trustworthy.


AI empowers procurement functions like invoice processing to work without interruptions due to tedious manual tasks, process failure, complex decision-making process, inefficient or slow reconciliations, etc. to experience frictionless procurement journey. 

Similar concept of GL code predictions can also be applied in other procurement areas, such as automation in generating the TAX codes and HSN codes during invoice processing. 

Democratization of AI within the procurement system can lead the organization to become an enterprise that is truly automated, intelligent and data driven. It could also help position them to the right place in the competition quadrant.

Biswanath Bal is a Machine Learning practitioner in Innovation and Product Engineering group within TCS Platform Solutions. He is responsible for building embedded cognitive intelligence and machine learning capabilities to the TCS Platform Solutions’ products for Human Resource and Accounts Payable. Prior to this, he worked on several strategic EDW and BI engagements for clients from different industries including Telecom, Banking etc. He holds a post-graduate degree in Computer Applications (MCA) from North Bengal University, West Bengal.