Summary
To automate uptake of the extensive data collected on COAs, we use a process called Zoning: Capturing pre-defined fields of information from a document as attributes for the relevant Item/Supplier COA. The process of Optical Character Recognition (OCR) guided by Zoning is the most-used method of data acquisition from documents such as PDF, DOC, DOCX, and TIF/TIFF files. Our Zone Editor uses the latest technologies to accelerate and streamline data acquisition.
Example of In-Process Zone Editor:
AI Zoning Editor Walkthrough
Creating a New OCR Template
For this article, we will be starting with a New OCR Template.
Steps:
Step 1: Hover your cursor over the Configuration icon at upper right and click 'Import Templates'.
Step 2: Check whether there's already an existing OCR Template for the Supplier/Item combination using the Filters:
Step 3:
- If you find a result, click the edit icon at far left on that Template's grid row and select 'OCR Templates'. On the next page, select a template from the 'Current Templates' dropdown to load a template.
- If NO results appear, click the blue New button at upper right and select OCR Template.
Step 4: Set the following configurations fields as needed.
Fields with an asterisk* are required.
- Template Name* - For easier recognition, include both the Supplier ID and the Item ID in the Name of each Template. If you have more than one Template for the same Item, adding the Template version number to it will also help in identification: Example: Supplier ID - Item ID - v1. You can use any identifier you want, but something similar to this pattern will be easiest to work with in the long run.
- Process Type* - Choose COA, CAR, or PO Data. (You must complete this step every time you create a new OCR Template.)
- Attach entire Source File - Click this if you have a COA that is more than one page, and you'd like those additional pages to be available in the COA record. The additional pages will not be Zoned or scanned for data.
- Multi-Lot - Toggle this ON if you have an OCR-able COA which has multiple lots on one page. This will allow you to create multiple Zone files linked to the one OCR Template to capture the data on the various lots recorded on that single COA document. For more information on this, go to "Creating & Editing Multi-Lot OCR Templates".
- Document type - Does not apply to OCR Templates. You may skip this every time.
- Email FROM Address or Domain - If the COAs arrive from a single email address, then enter that full email address here. If multiple people at the Supplier company send in these COAs, then simply enter their email domain. Domain Example: @FiveStarSupplier.com
-
Supplier ID* - Enter part of your Supplier's ID and select it from the drop-down list that emerges. (You must select the Supplier ID from the drop-down in order for Tracegains to link the exact Supplier ID to this template). If no Supplier IDs appear, then the Supplier does not yet exist in your system, you have mistyped the Supplier ID, or the Supplier is Inactive. You cannot create a Template when the Supplier is Inactive, so you'll need to Activate the Supplier and Item:
- Go to the Supplier Management > Suppliers sub-tab.
- Filter either the Supplier Name or ID column to find the desired Supplier row.
- Checkmark the box at the far-left end of that Supplier's row.
- Click the blue hamburger menu at top right.
- Click 'Activate' in the drop-down list.
- Item ID* - Enter part of the Item ID and select it from the drop-down that appears. (As above, you must select the Item ID from the drop-down). If no Item ID appears, then the Item does not yet exist in your system, you have mistyped the Item ID, or the Item is Inactive. You cannot create Templates when the Supplier and/or Item is Inactive; you'll need to Activate the Supplier and Item. See instructions for Supplier ID, above.
Step 5: Now you have a choice to make. You can either:
- (Recommended) Click the "Zone File Editor" button on the right side of the page to open the Editor. Here you can load an image of your COA for reference and add the Key Phrases AND Zone the Attributes. Don't worry about saving your new template just yet- templates cannot be saved until the they contain Key Phrases and Zoned Attributes.
- Or you can stay on the New OCR Template page and add your Mapped Attributes and Key Phrases here by clicking the appropriate tabs near the bottom of the page. You'll need to have a copy of the COA handy, to read from while creating the Key Phrases.
Zone File Editor
Use the 'Browse' button at top center of the Editor to upload a COA document you want to Zone. Loading may take a few seconds.
In the top right area of the Editor page, notice the 'Page' box has been set to "1". This indicates that you're viewing page 1 of your COA document. The 'Zone File' box will have ** Create New ** as its default and only entry for the moment.
On the upper left side of the Editor page, you'll see a list of configuration sections you'll need to complete.
- 'General' holds the Name of this OCR Template, the Supplier ID, and the Item ID. It also includes the 'Attach source file' and 'Multi-Lot' settings from the initial OCR Template page.
- 'Key Phrases' contains words or phrases used to uniquely identify this COA from others.
- 'Email Attributes' captures data from the email this COA came in on, but not available in the COA itself.
- 'Zoned Attributes' will list the names and Zones of the Item Attributes whose values you'll be capturing.
Key Phrases
"Key Phrases" uniquely identify COAs from a specific Supplier for a particular Item they provide. These can be any words, numbers, or phrases on the COA that remain consistent over time for that Supplier/Item combination. All COAs received for the same Supplier/Item must contain identical Key Phrases in order to match the OCR template.
Adding Key Phrases
Step 1: Click the 'Key Phrases' dropdown to reveal the "add phrase..." box.
Step 2: Click 'Text' at the top center of the page to analyze the uploaded document and generate a text-based image containing all detected words.
Step 3: Copy the EXACT TEXT you want to use as a Key Phrase. Try not to include any spaces at the beginning or end of your marked phrases/words. Partial words or numbers are OK to use.
Step 4: Paste your copied word/phrase into the "add phrase..." box and click 'Add' or hit Enter to add the string to your Key Phrases list.
- Notice that the phrases selected above WILL NOT CHANGE with the next COAs that come in for this specific Supplier/Item combination. That's why they can act as Key Phrases.
- These Phrases are intended to identify COAs for this Supplier/Item ONLY - try not to use common strings or strings you would find on another Supplier/Item's COAs.
- Key Phrases MUST NOT be a value that you want to capture (or "Zone") on the COA - those values are expected to change frequently.
- If you're Zoning a Multi-Page COA, all the identical Phrases MUST be present on EVERY page.
- Key Phrases themselves do not need Zoning because the system scans each entire document page looking for them.
You must provide at least two Key Phrases, but the more the better for quick, accurate searching by the system. Three or four Phrases are typical and effective.
Mapping Attributes
Email Attributes
In some cases, you may want to capture data that's in the email your Supplier sent this COA on, but not in the COA itself. You can get that data by setting up Attributes to receive any (or all) of the four main types of email data: 'To', 'From', 'Subject', and 'Body'. You must create these Attributes and set them all to 'Applies to All Items' before attempting to set up your Email Attributes. We suggest you use Names like 'COA Email To', 'COA Email From', etc. for clarity.
Steps:
Step 1: Click the "Email Attributes" dropdown.
Step 2: Select 'To', 'From', 'Subject', or 'Body' and select the appropriate attribute from the drop-down list to assign this Email attribute to.
Step 3: If you only want to capture a certain part of any of these Email attributes, then you'll need to use a Normalization Script using the gear icon to the right of the field.
Zoned Attributes
COAs are all about a Supplier's compliance with your needs. TraceGains read the text values that are defined by drawing "Zone boxes". Drawing a Zone adds a new drop-down menu to the Zoned Attributes list where it can be assigned to an Attribute.
Steps:
Step 1: Select the 'Draw' tool near the top left.
Step 2: Draw a box around a value you would like to capture (NOT its name/title). Make the Zone box as large as possible to leave room for error or longer values. If you need to adjust the size or placement of a box, click the box once to show re-sizing handles.
Step 3: If the COA happens to have very small text, blocks of text that are tightly packed, or is very close to the lines of a table, you'll find Zoom buttons and a small drop-down of options at the upper-right.
Step 4: Each new Zone Box will have a corresponding option in the 'Zoned Attributes' dropdown on the left, matching the Zone Box created in step 2. Select the Attribute that this Zone should represent.
The list will only contain Attributes that are set to "Applies to all Items". If you do not see your expected Attribute in the drop-down, go to Configuration > Attributes and set that Attribute to Apply to All.
Step 5: Continue drawing Zones and linking them to Attributes until you've covered all the values you want to capture.
You can also apply multiple Attributes to a single Zone using the green '+' icon. This means that the data captured from that one Zone will be used to fill in ALL of the Attributes you list under it. A Normalization Script is no longer required to accomplish this. Be sure to review our new Lasso feature, detailed below! It's another tool to make Zoning easier.
In the above example, Zone 2 is being assigned to attributes PH and Acidity.
Artificial Intelligence
In TraceGains, we use Artificial Intelligence (AI) it to automatically make Zone suggestions for any COA document. It starts out making its best guess based on its original programming. Over time, as you create more OCR templates using the Zone File Editor, it learns your Zoning patterns and refines its suggestions accordingly.
Let's say you have a Multi-Lot COA like the following. Each column to the right of the Reference/Sublots column is a list of data for the Sublot identified by the number at the top of the column ("12" through "17"). You would need to create six Zone files to gather all these Sublots of data. If done manually, this would be a lengthy and error-prone process. This is where TraceGains zAI comes in.
Steps:
Step 1: At top center above the COA image, click the 'Show AI Suggestions' checkbox.
- You must be in either the "Draw" or "Lasso" tool, at upper left to see this checkbox.
- You will need to adjust the size or placement of any Zone that includes part of a vertical table-line.
After a brief moment, your COA image will look something like this:
Each of the orange-outlined boxes is a potential Zone suggested by the AI. As you can probably see, some of the potentials are not cells that you would want to Zone, such as the Specification and Reference columns. Remember, since you've never used this AI before, this is its "first-guess" based on its initial programming.
Step 2: Pick the first Zone you want to use by clicking inside its orange box.
- The box will turn light blue, and a label-number will pop up beside it. When you move your cursor out of the Zone-box, the number will drop down into the box.
- If you need to adjust the size or placement of the box, click the box once to show re-sizing handles.
- An Attribute drop-down will appear below the Zoned Attributes heading, on the left. Note that it has the same label-number as the Zone box. If there's an Attribute that looks like a match for the Zone, the AI will automatically select that attribute for you. Otherwise, it will be left blank for manual selection.
Step 3: Continue selecting Zones in the same column. Do NOT select Zones from any other column. Very shortly, your COA image and Zoned Attributes list would look like this.
Step 4: Now add the Attribute Names in the Zoned Attributes list. Open each drop-down and select the Attribute Name that corresponds to its Zone number.
Rather than picking directly from the drop-down, you can type the first letter/number of the Attribute Name you're looking for into the box to narrow , and with each further press of that letter or number, the system will run through the entire subset of Attribute Names beginning with it. When you get to the right name, simply click on the drop-down box containing it to lock it in.
Step 5: When each of your Zones has been related to an Attribute Name, Save your work. If anything is lacking or incorrect, you'll get an error-list. Simply fix the errors and click 'Save' once more.
Each time you use these AI features, it learns from your adjustments, refining its future suggestions based on your preferences. The more examples it has, the smarter and more accurate it become.
Lasso Tool
As mentioned above, our current example is a Multi-Lot COA, and you will need to create six Zone Files for it in total. At this point, you've created Zone File "1" for Sublot column "12" - now you need to produce Zone File "2" for the next Sublot, "13", and so on. Here's where our Lasso tool becomes invaluable. It can "grab" a whole group of Zones in the COA image and allow you to copy or move them to:
- Another spot on the COA,
- Another page in a Multi-Page COA
- Or in this case, a brand-new Zone File
This is especially nice when you're Zoning Multi-Lot COAs where the data is arranged in tables. You might want to review the article "Creating & Editing Multi-Lot OCR Templates" for more details.
Steps:
Step 1: Click the blue drop-down beside the Save button at upper right. The "Copy to New File" option will be active. Click it to create Zone File "2" using the initial positions of the Zones you've created. You'll be asked to confirm, then the Zone File box will change to "2".
Step 2: Click the "Lasso" button at top center of your page. Nothing will change appearance, but the Lasso is now ready to use.
Step 3: Click-and-drag to draw a box that completely surrounds any Zones you want to copy to a new position. In this case, that's ALL the current Zones. You don't have to be exact with the box - just make sure it completely contains all the Zones you want to copy (and in this case, vertical lines do not matter). As you stretch the Lasso box, note that each of the Zones gets an animated outline to show that it's selected.
Step 4: When you release the cursor, the Lasso box will disappear, but all the selected Zones will still be animated and showing their numbers.
- At this point, DO NOT CLICK OUTSIDE any of the selected Zones, or the Lasso function will assume you want to start a NEW grouping and the current grouping indicators (the animated outlines and ID numbers) will disappear, undoing your group.
- You can, however, click-and-hold INSIDE any of the grouped Zones to move the entire group with your mouse/touchpad (but see Pro Tip, below). As you move over the grouped Zones, any selected Zone will display the "plus-shaped-arrows" cursor; any other box will show the "hand" cursor and a tag saying "Add Suggestion".
Move lassoed zones around with arrow keys. These will give you much more precision in positioning the group.
If you do want to add any of the "Add Suggestion" cells to the data you'll be capturing, just click on that cell. The box will gain an ID number and a new drop-down will be added to the Zoned Attributes list - but since you've changed the group contents you'll have to re-Lasso the desired Zones again.
Step 5: Now you have seven Zones selected. It will look like the image above, but without the Lasso box.
Use arrow keys to move the group to the right until they line up with the same cells in Sublot column "13". Be as accurate as possible - you may want to Zoom in before doing this. Each press of an Arrow Key will move the group just one pixel. You can hold the Arrow Key down to move more quickly, and you can also use Shift-Arrow to move the group a larger distance with each press.
Step 6: Click Save. This will Save your Zone File "2" with the positions to which you moved the Zones. It will not alter anything about Zone File "1".
Step 7: So here are the steps:
- Copy to New File
- Lasso your Zones
- Move them to the new location
- Save
Continue with this procedure until all six Sublot data columns have their own Zone File. Do a final verification by loading each Zone File to review its configuration and position.