Posts

Stretchy templates 1

Stretchy templates

Reading Time: 3 minutes
Stretchy templates 2
What is a template in the world of CloudTrade automated data capture?

What is a template in the world of CloudTrade automated data capture? In this blog post, Richard Develyn, CloudTrade CTO, explains how a template is something much more flexible than you might imagine. Secondly, he describes how adaptable templates form the core strength of the CloudTrade solution.

If you check out the definition for the word “template” in any dictionary, online or otherwise, the first answer that you’re likely to encounter will probably read something like this:

“A preset, shaped piece of rigid material used as a pattern for processes such as cutting out, shaping, or drilling.”

If someone then tells you about a company that uses templates as a means of reading information from a document then you will probably imagine that, in some sort of IT-equivalent way, they cover a document with a piece of metal which (a), has square holes cut into it to allow parts of the document to be “extracted” from below and, (b), has words scratched into it somehow which have to line up exactly with the words that are written underneath.

The problem with mental images like this is that they’re (a) easy to imagine, (b) easy to understand, (c) easy to remember and (d), in the majority of cases, quite wrong. Go beyond the first dictionary definition for “template” and you will discover that in the field of computing a template generally means:

“A preset format for a document or file.”

Investigate that word “format” further and you will find terms like “arrangements” and “patterns” suggesting a much more fluid interpretation than the image of piece of metal with holes in it might suggest.

Why a set of rules does not need to be rigid

Ultimately a template is just a set of rules. The “metal with holes in it” example is only a very specific, and rigid, case of what those rules could be – e.g. “this piece of writing must occur here on the page” or” that bit of information that we need to extract has to occur there on the page”.

A set of rules and a template are really just the same thing, however, unfortunately, it’s far too easy to think “rigid” when you read “template” and so jump to the erroneous conclusion that a system which works using a set of rules must be working in a very rigid way.

This sort of semantic mix up is a nuisance, particularly for us. It has caused us to stop using the word “template” when explaining how CloudTrade works. Our data-extraction solution is indeed based on writing natural-language style rules. Yes, you could call that a template. No, this is not the equivalent of using a rectangular piece of metal with holes in it stuck over the top of a piece of paper!

If we’re going to be stuck with this mental image however (mental images like this being so hard to shift) then we need to imagine that our templates are not made from a rigid material like metal but rather are created from some sort of stretchy flexible substance that automatically aligns itself to the document that we’re trying to examine – a bit like intelligent rubber. Our stretchy-templates may well have holes in them which allow us to read the data that we’re looking for, but these holes can grow and shrink and move around. Our stretchy-templates might stipulate data which has to be present in the document “below” them, but that data can have different values and locations depending on whatever else the document has in it.

Flexibility is key to the CloudTrade solution

This is what gives our system its power. We program our stretchy-templates to deform themselves in the necessary and particular ways which match the variations in the document that we’re trying to examine. It doesn’t matter how the information on a document moves around, we can set up our stretchy-templates to accommodate it and always pick up the right data wherever it happens to be.

Much though we’d like to, it’s difficult to avoid using the word “template” when we describe what we do. Many people in our industry use it. Unfortunately, the temptation is to think that “rules system” equals “template” and that “template” equals “rigid piece of metal with a load of holes cut into it”. If you find yourself thinking rather along these lines, then, at least try to imagine that our templates are rubbery and stretchy rather than rigid and metallic. It might be an odd sort of mental image to carry in your head, but at least it’s much closer to the truth than the alternative.