Building Production-Grade spaCy Text Classification Pipelines for Business Data
Unlock the full potential of spaCy with this guide to building production-grade text classification pipelines for business data.
Three-way invoice matching is such a crucial internal control of procure-to-pay workflows in every industry. Sadly, most businesses and their accountants still wade through it manually, not because they like to but because decades of mediocre automation have only replaced one set of problems with another.
It’s only in the last two years or so that smart, fully automated 3-way invoice matching has become practical, thanks to advances in deep learning and natural language understanding. There’s a revolution happening in accounting automation with tremendous business benefits.
We have explored general invoice matching in the past. In this article, you’ll dive deep into the popular 3-way invoice matching, learn about the severe problems around doing it manually, find out the enormous benefits for your business by replacing it with a fully automated solution, and finally explore the mechanics of how such a system works.
The illustration shows a typical procure-to-pay workflow used in most businesses and organizations along with the departments involved and the documents they issue:
Three-way matching is an internal control of the bookkeeping process to ensure there are no mismatches between the goods, quantities, and terms mentioned in the purchase order, goods-received note, and invoice.
In practice, there are always some mismatches due to unavoidable factors like minor damages, weather conditions, or currency fluctuations. So the three-way matching process is done flexibly as long as the deviations are within accepted tolerances.
Its biggest benefit is in avoiding financial losses in the procure-to-pay workflow. Losses may stem from invoicing mistakes, vendor fraud, or internal fraud. Or they may come as penalties by suppliers for late payments. Invoice matching is a vital control tool to help your organization avoid all that and safeguard its bottom line.
Plus, accounting and auditing standards like the International Financial Reporting Standards and the Generally Accepted Accounting Practices require organizations to do invoice matching.
Depending on the set of documents you reconcile, invoice matching can be 2-way, 3-way, or even 4-way. Let’s compare 3-way and 2-way matching:
If you’re in an industry like precision manufacturing with high quality thresholds, you’ll want to match inspection reports too with the other documents. That’s called 4-way matching.
If you’re using a manual matching process, you’re not the only one. Most businesses still follow manual matching because they have grown wary of automated matching after getting burned by the unreliability and inconvenience of semi-automated approaches like template matching.
But manual matching of the three documents brings some severe problems:
Automated 3-way matching overcomes many problems of manual matching by automating information extraction from purchase orders, invoices, and receipts and matching them using software.
However, the semi-automated approaches that the industry’s seen so far are unreliable and introduce new inconveniences. They expect you to manually create a large number of brittle “invoice templates” to extract data. Sometimes you have to transfer the data to spreadsheets first before automation kicks in. You may also have to verify the extracted data manually.
In contrast, a fully automated system understands invoices and other documents like people do. It can handle all the variations in layouts, terminologies, languages, currencies, and more. To achieve that level of smartness, it uses state-of-the-art computer vision, deep learning, and natural language processing.
Let’s explore all the benefits of fully automated 3-way invoice matching.
Accurate 3-way matching for a purchase takes just a few seconds, not hours. These systems are highly scalable, matching millions of invoices with other documents every day. Their inherent speed and scalability result in additional business benefits as we’ll see.
Fully automated matching understands documents semantically just as we do. When it sees text laid out roughly in a row, it recognizes it as a line item in a list of products. When it sees what looks like a column of information, it identifies them as item descriptions or amounts. It doesn’t need any manual templates, pre-processing, or verification.
Compared to manual and semi-automated approaches, a fully automated system achieves error-free, accurate data extraction and semantically sound 3-way matching.
Fully automated invoice matching dramatically lowers your operating and capital expenses. The capital spent on the software and infrastructure is much lower compared to hiring and training skilled people. The operating expenses for cloud resources are far lower than employment costs. The per-invoice cost reduces by about 75%.
Every discrepancy that’s automatically detected is filed in a database. A fraud monitoring component continuously aggregates them by vendor and time to look for anomalous patterns and other evidence of systematic long-term fraud.
Fast and accurate extraction and matching enable your business intelligence teams to get accurate real-time cash flow and expense data. Real-time data extraction from goods-received notes enables production lines to track part inventories accurately and run smoothly.
Fast matching leads to expedited invoice approvals that help avoid late payments and perhaps even get you early payment discounts.
Error-free 3-way matching enables accurate bookkeeping at all times and keeps your auditors happy.
In this section, we explore details of how a fully automated 3-way invoice matching works.
Fully automated 3-way invoice matching has little choice but to handle all the varieties of invoices, purchase orders, and goods-received notes found in the real world. Otherwise, it suffers the same problems as manual and semi-automated approaches.
These documents vary widely in aspects like:
Regardless of the format or medium, one norm that most businesses follow is arranging the list of goods and their quantities in a table. Identifying tables, or rather, information arranged in tables is an essential step in 3-way matching.
At this stage, we just want the locations of areas where text is spatially arranged in the form of tables. We also want to identify vertical arrangements of text as probable columns and horizontal arrangements of text as probable rows of the table.
We use convolutional deep neural networks (DNN), trained for either object detection or segmentation, for these table/row/column localization tasks. Techniques like clustering and non-maximal suppression are used to identify columns and rows with even higher probability.
With probable rows and columns identified, we use a second DNN for text extraction. Text extraction combines simple character recognition and natural language models to accurately identify entire fragments of text without suffering the typical problems we see with only optical recognition of text characters.
Every text fragment is then run through a named entity recognition (NER) neural network to classify it as a product title, description, serial number, column header, quantity, price, total amount, and so on.
A PO contains a lot of other information necessary for matching. It contains a PO number, vendor name, authorizing employee, receiving department, specification identifier, date of issue, dates of expected delivery, and more.
All these details are also extracted and labeled by the NER network. The named entity labels and values are stored in a structured, queryable data format like JSON in a database or routed to the central ERP system.
Similarly, invoices contain details like invoice number, date of issue, vendor name and identifier, terms of payment (like “Net 30”), and other important information that’s necessary for matching. These too are extracted and labeled by the NER network before storing them.
Receipt notes contain details of goods and quantities that were received and of those that were rejected. This information is extracted by the same NER network and transmitted to the database or ERP.
Matching products and services across invoices, goods receipts, and purchase orders is not simple:
That’s why fully automated 3-way invoice matching has to use smart data matching. Titles, descriptions, and information like SKU numbers are matched using large language models like GPT-3 to achieve human-level understanding.
Quantities of respective line items are matched while honoring tolerance settings, unit conversions, and locale formats.
For example, a PO specifies quantities in units of thousands but the invoice includes full values. Or a purchase order issued in the U.S. uses pounds while the vendor uses kilograms for the benefit of their local logistics partner or customs authorities.
Such smart matching is handled by customization plugins that are configured with tolerance settings and unit conversion rules.
Similarly, the system matches prices while honoring currency conversions and locale formats. For example, some countries use the decimal point while others use the comma. You can set the tolerance levels for matching prices using price outlier detection.
The above steps result in three sets of data:
All these data are stored in a database or ERP. Plus, reports are generated for manual review by senior accountants and management.
The match reports are reviewed regularly by senior accountants in the AP team. The data are also used by automated workflows for putting invoices on hold, releasing them for payments, or forwarding them to senior management for budget approvals.
In this article, you learned about the benefits and mechanics of a fully automated 3-way invoice matching that uses deep learning. With Width.ai’s fully AP automation solution, you can process millions of invoices and 3-way (or even 4-way!) match them in seconds. Contact us for a demo.
Unlock the full potential of spaCy with this guide to building production-grade text classification pipelines for business data.
We compare 12 AI text summarization models through a series of tests to see how BART text summarization holds up against GPT-3, PEGASUS, and more.
Let’s take a look at what intent classification is in conversational ai and how you can build a GPT-3 intent classification model for conversational ai and chatbot pipelines.
Discover the capabilities of zero-shot object detection, which enables anyone to use a model out-of-the-box without any training and generate production-grade results.
What is facial expression recognition and what SOTA models are being used today in production
Get a simple TensorFlow facial recognition model up & running quickly with this tutorial aimed at using it in your personal spaces on smartphones & IoT devices.
Explore accurate classification algorithms using the latest innovations in deep learning, computer vision, and natural language processing.
Learn what human activity recognition means, how it works, and how it’s implemented in various industries using the latest advances in artificial intelligence.
What is the the SetFit architecture and how does it outperform GPT-3 and other few shot large language models
What is image classification and how we build production level TensorFlow image classification systems for recognizing various products on a retail shelf.
Explore the application of intelligent document processing (IDP) in different industries and dive in-depth on intelligent document pipelines.
How to build an image classification model in PyTorch with a real world use case. How you can perform product recognition with image classification
Let's build a custom CTA generator that you'll actually want to use for your website copy
We’re going to look at how we built a state of the art NLP pipeline for blended summarization and NER to process master service agreements (MDAs) that vary the outputs based on the input document and what is deemed important information.
Get a comprehensive overview of a purchase order vs. invoice, including when businesses use each, what information goes in them, and more.
Learn what Google Shopping categories are used for and how you can automate fitting products to this taxonomy using ai.
Automatically categorize your Shopify store products to the Shopify Product Taxonomy instantly with ai based PIM software
Smart farming using computer vision and deep learning provides the most promising path forward in the slow-moving industry of agriculture.
How we leveraged large language models to build a legal clause rewriting pipeline that generates stronger language and more clarity in legal clauses
Using ai for document information extraction to automate various parts of the loan process.
Apply AI to your favorite sport with this guide. Learn how automated ball tracking can change the game for coaches and players.
Categorize your ecommerce products to the 2021 google product taxonomy tree instantly with our Ai software
Surveying the current landscape of ecommerce automation and how you can use ai to automate huge chunks of your product management.
Classify your product data against an existing product category database or generate categories and tags in seconds using artificial intelligence
Warehouse automation plays a crucial role across your supply chain. Learn about how machine learning and ai software can be integrated into your warehouse automation stack.
4 different NLP methods of summarizing longer input text into different methods such as extractive, abstractive, and blended summarization
iscover an invoice OCR tool that will revolutionize the way you handle invoices. There’s no human intervention needed & a dramatically lower per-invoice cost.
Instead of invoice matching taking upwards of a week, it could take mere seconds with the proper automation solution. Learn more here.
Manual and template-based invoicing are riddled with low accuracy and required human intervention. Learn how to systematically eliminate these issues with the right invoice data capture software.
A complete walkthrough guide on how to use visual search in ecommerce stores to create more sales and real examples of companies already using it.
Automating the extraction of data from invoices can reduce the stress of your accountants by finding inaccuracies, digitizing paper invoices, and more.
How you can use machine learning based data matching to compare data features in a scalable architecture for deduping, record merging, and operational efficiency
Learn how lifetime value or LTV prediction can improve your marketing strategies. Then, discover the best statistical & machine learning models for your predictions.
A deep understanding of how we use gpt-3 and other NLP processes to build flexible chatbot architectures that can handle negotiation, multiple conversation turns, and multiple sales tactics to increase conversions.
The popular HR company O.C. Tanner, which has been in business since 1927 and has over 1500 employees, was looking to research and design two GPT-3 software products to be used as internal tools with their clients. GPT-3 based products can be difficult to outline and design given the sheer lack of publicly available information around optimizing and improving these systems to a production level.
We’ll compare Tableau vs QlikView in terms of popularity, integrations, ease of use, performance, security, customization, and more.
With a context-aware recommender system, you can plan ways to recreate some of the contextual conditions that persuade them to buy more from you.
We’re going to walk through building a production level twitter sentiment analysis classifier using GPT-3 with the popular tweet dataset Sentiment140.
Find out how machine learning in medical imaging is transforming the healthcare world and making it more efficient with three use cases.
Discover ways that machine learning in health care informatics has become indispensable. Review the results of two case studies and consider two key challenges.
Accelerate your growth by pivoting key areas of your business to AI. Your business outcomes will be achieved quicker & you’ll see benefits you didn’t plan for.
We built a GPT-3 based software solution to automate raw data processing and data classification. Our model handles keyword extraction, named entity recognition, text classification | Case Study
We built a custom GPT-3 pipeline for key topic extraction for an asset management company that can be used across the financial domain | Case Study
How you can use GPT-3 to create higher order product categorization and product tagging from your ecommerce listings, and how you can create a powerful product taxonomy system with ai.
5 ways you can use product matching software in ecommerce to create real value that raises your sales metrics and improves your workflow operations.
Data mining and machine learning in cybersecurity enable businesses to ensure an acceptable level of data security 24/7 in highly dynamic IT environments. Learn how data security is getting increasingly automated.
Product recognition software has tremendous potential to improve your profits and slash your costs in your retail business. Find out just how useful it is.
Big data has evolved from hype to a crucial part of scaling your organization in every modern industry. Learn more about how big data is transforming organizations and providing business impacts.
Learn how natural language processing can benefit everybody involved in education from individual students and teachers to entire universities and mass testing agencies.
Here’s how automated data capture systems can benefit your business in some key ways and some real-life examples of what it looks like in practice.
Use these power ai and machine learning tools to create business intelligence in your marketing that pushes your business understanding and analytics past your competition.
We built a custom ML pipeline to automate information extraction and fine tuned it for the legal document domain.
In this practical guide, you'll get to know the principles, architectures, and technologies used for building a data lake implementation.
Find out how machine learning in biology is accelerating research and innovation in the areas of cancer treatment, medical devices, and more.
An enterprise data warehouse (EDW) is a repository of big data for an enterprise. It’s almost exclusive to business and houses a very specific type of data.
Dlib is a versatile and well-diffused facial recognition library, with perhaps an ideal balance of resource usage, accuracy and latency, suited for real-time face recognition in mobile app development. It's becoming a common and possibly even essential library in the facial recognition landscape, and, even in the face of more recent contenders, is a strong candidate for your computer vision and facial recognition or detection framework.
Learn how to utilize machine learning to get a higher customer retention rate with this step-by-step guide to a churn prediction model.
Machine learning algorithms are helping the oil and gas industry cut costs and improve efficiency. We'll show you how.
We’ll show you the difference between machine learning vs. data mining so you know how to implement them in your organization.
Here’s why you should use deep learning algorithms in your business, along with some real-world examples to help you see the potential.
Beam search is an algorithm used in many NLP and speech recognition models as a final decision making layer to choose the best output given target variables like maximum probability or next output character.
Best Place For was looking for an image recognition based software solution that could be used to detect and identify different food dishes, drinks, and menu items in images sourced from blogs and Instagram. The images would be pulled from restaurant locations on Instagram and different menu items would be identified in the images. This software solution has to be able to handle high and low quality images and still perform at the highest production level, while accounting for runtime as well as accuracy.
Deep learning recommendation system architectures make use of multiple simpler approaches in order to remediate the shortcomings of any single approach to extracting, transforming and vectorizing a large corpus of data into a useful recommendation for an end user.
Let's take a look at the architecture used to build neural collaborative filtering algorithms for recommendation systems
GPT-3 is one of the most versatile and transformative components that you can include in your framework, application or service. However, sensational headlines have obscured its wide range of capabilities since its launch. Let’s take a look at the ways that companies and researchers are achieving real-world results with GPT-3, and examine the untapped potential of this 'celebrity AI'.
How to get started with machine learning based dynamic pricing algorithms for price optimization and revenue management
Let's take a look at how you can use spaCy, a state of the art natural language processing tool, to build custom software tools for your business that increase ROI and give you data insights your competitors wish they had.
The landscape for AI in ecommerce has changed a lot recently. Some of the most popular products and approaches have been compromised or undermined in a very short time by a new global impetus for privacy reform, and by the way that the COVID-19 pandemic has transformed the nature of retail.
Extremely High ROI Computer Vision Applications Examples Across Different Industries
Building Data Capture Services To Collect High ROI Business Data With Machine Learning and AI
Software packages and Inventory Data tools that you definitely need for all automated warehouse solutions
Inventory automation with computer vision - how to use computer vision in online retail to automate backend inventory processes