2021:Labeling Behavior (Behavior): Difference between revisions
No edit summary Tag: Reverted |
Tag: Undo |
||
| Line 1: | Line 1: | ||
<!---NOTE TO SELF I would like to redo the "Label SEts and the Labeld Value Extractor Type" and "Additional Considerations When Using LAbeled VAlue with Label SEts" at some point to more closely align the content with the LMS content---> | <!---NOTE TO SELF I would like to redo the "Label SEts and the Labeld Value Extractor Type" and "Additional Considerations When Using LAbeled VAlue with Label SEts" at some point to more closely align the content with the LMS content---> | ||
<blockquote> | <blockquote> | ||
The '''''Labeling Behavior''''' is a '''Content Type''' '''''Behavior''''' designed to collect and utilize a document's field labels in a variety of ways. This includes functionality for classification and data extraction. | The '''''Labeling Behavior''''' is a '''Content Type''' '''''Behavior''''' designed to collect and utilize a document's field labels in a variety of ways. This includes functionality for classification and data extraction. | ||
</blockquote> | </blockquote> | ||
The '''''Labeling Behavior''''' functionality allows Grooper users to quickly onboard new '''Document Types''' for structured and semi-structured forms, utilizing labels as a thumbprint for classification and data extraction purposes. Once the '''''Labeling Behavior''''' is enabled, labels are identified and collected using the "Labels" tab of '''Document Types'''. These "Label Sets" can then be used for the following purposes: | The '''''Labeling Behavior''''' functionality allows Grooper users to quickly onboard new '''Document Types''' for structured and semi-structured forms, utilizing labels as a thumbprint for classification and data extraction purposes. Once the '''''Labeling Behavior''''' is enabled, labels are identified and collected using the "Labels" tab of '''Document Types'''. These "Label Sets" can then be used for the following purposes: | ||
| Line 37: | Line 19: | ||
== About == | == About == | ||
{|cellpadding="10" cellspacing="5" | |||
|- | |||
|style="font-size:14pt; color:#f89420; border: 2px solid #f89420; width:35px"|'''[[File:Asset 22@4x.png|link=Media:Labeling Behavior (v2021).zip]]''' | |||
|style="border: 2px solid #f89420"| | |||
You may download and import the file below into your own '''Grooper''' environment (version '''2021'''). This contains the '''Batch(es)''' with the example document(s) discussed in this article and the '''Content Model(s)''' configured according to the [[#How To|How To]] section's instructions. | |||
* [[Media:Labeling Behavior (v2021).zip]] | |||
|} | |||
[[File:Labeling-behavior-about-01.png|right]] | [[File:Labeling-behavior-about-01.png|right]] | ||
| Line 72: | Line 61: | ||
# Here, we have selected a '''Content Model''' in the Node Tree. | # Here, we have selected a '''Content Model''' in the Node Tree. | ||
# To add a '''''Behavior''''', select the '''''Behaviors''''' property and press the ellipsis button at the end. | # To add a '''''Behavior''''', select the '''''Behaviors''''' property and press the ellipsis button at the end. | ||
# This will bring up a dialogue window to add various behaviors to the '''Content Model''', including the '''''Labeling Behavior''''' | |||
# | |||
# Add the '''''Labeling Behavior''''' using the "Add" button. | # Add the '''''Labeling Behavior''''' using the "Add" button. | ||
# Select ''Labeling Behavior'' from the listed options. | # Select ''Labeling Behavior'' from the listed options. | ||
| | |||
[[File: | [[File:Labeling-behavior-about-04.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 88: | Line 73: | ||
#* By default, '''Grooper''' presumes you will want to use some fuzzy matching and enable constrained and vertical wrapping. These defaults work well for most use cases. However, you can adjust these properties here as needed. | #* By default, '''Grooper''' presumes you will want to use some fuzzy matching and enable constrained and vertical wrapping. These defaults work well for most use cases. However, you can adjust these properties here as needed. | ||
# Press the "OK" button to finish adding the '''''Labeling Behavior''''' and exit this window. | # Press the "OK" button to finish adding the '''''Labeling Behavior''''' and exit this window. | ||
| | |||
[[File: | [[File:Labeling-behavior-about-05.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 113: | Line 92: | ||
For more information on collecting label sets for the '''Document Types''' in your '''Content Model''' see the [[#Collect Label Sets|How To]] section of this article. | For more information on collecting label sets for the '''Document Types''' in your '''Content Model''' see the [[#Collect Label Sets|How To]] section of this article. | ||
| | |||
[[File:Labeling-behavior-about-06.png]] | |||
| | |||
[[File: | |||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 129: | Line 100: | ||
For example, labels were used in this case to: | For example, labels were used in this case to: | ||
# Classify the | # Classify the document, assigning it the "Factura" '''Document Type'''. | ||
# Extract all the '''Data Fields''' seen here, collecting field based data from the document. | # Extract all the '''Data Fields''' seen here, collecting field based data from the document. | ||
# Extract the "Line Items" '''Data Table''', collecting the tabular data seen here. | |||
# | |||
For more information on how to use labels for these purposes, see the [[#How To|How To section of this article]]. | For more information on how to use labels for these purposes, see the [[#How To|How To section of this article]]. | ||
| | | | ||
[[File: | [[File:Labeling-behavior-about-07.png]] | ||
|} | |} | ||
| Line 182: | Line 149: | ||
Collecting labels for the '''Document Types''' in your '''Content Model''' will be the first thing you want to do after enabling the '''''Labeling Behavior'''''. Labels for each '''Data Element''' in the '''Document Type's''' '''Data Model''' are defined using the "Labels" tab of the '''Content Model'''. | Collecting labels for the '''Document Types''' in your '''Content Model''' will be the first thing you want to do after enabling the '''''Labeling Behavior'''''. Labels for each '''Data Element''' in the '''Document Type's''' '''Data Model''' are defined using the "Labels" tab of the '''Content Model'''. | ||
# | # Navigate to the "Labels" tab of the '''Content Model'''. | ||
# With a '''Batch''' selected in the "Batch Selector" window panel, select a document folder. | |||
# With a '''Batch''' selected in the " | # Press the "Set Type..." button to set the '''Document Type''' whose labels you wish to collect. | ||
# This will bring up the "Set Content Type" window. | |||
# From this window, select the '''Document Type''' for the selected document folder whose labels you wish to collect. | |||
#* In this case, this document is an invoice from "Factura Technology Corp". We have selected the "Factura" '''Document Type'''. | |||
# Press "OK" to finish. | |||
# | |||
# | |||
# From | |||
# | |||
{|cellpadding="10" cellspacing="5" | {|cellpadding="10" cellspacing="5" | ||
|-style="background-color:#36b0a7; color:white" | |-style="background-color:#36b0a7; color:white" | ||
|style="font-size:14pt"|'''FYI'''||If you haven't added a '''Document Type''' for the selected document folder yet, you can | |style="font-size:14pt"|'''FYI'''||If you haven't added a '''Document Type''' for the selected document folder yet, you can use the "Create Type" button instead to both create a new '''Document Type''' and set it. | ||
|} | |} | ||
| | | | ||
[[File: | [[File:Labeling-behavior-about-08.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
# | # Upon setting the '''Document Type''' the document folder is assigned the selected '''Document Type''' | ||
#* Or in other words, this document is now classified as a "Factura" document. | |||
# Upon setting a '''Document Type''', that '''Document Type's''' '''Data Model''' and its child '''Data Elements''' will appear in the label collection UI. | |||
#* Labels are primarily collected as they correspond to '''Data Elements''' in a '''Data Model'''. However, we will see how to add custom labels that don't correlate to a '''Data Element''' as well by the end of this tutorial. Custom labels are often used as additional features for document classification. | |||
| | | | ||
[[File: | [[File:Labeling-behavior-about-09.png]] | ||
|} | |} | ||
| Line 248: | Line 195: | ||
# Select the '''Data Element''' whose label you wish to collect. | # Select the '''Data Element''' whose label you wish to collect. | ||
#* Here, we are selecting the "Invoice Number" '''Data Field'''. | #* Here, we are selecting the "Invoice Number" '''Data Field'''. | ||
# | # Press the "Select Region" button. | ||
# With your cursor, lasso around the text label on the document. | # With your cursor, lasso around the text label on the document. | ||
| | | | ||
[[File: | [[File:Labeling-behavior-about-10.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
# Upon lassoing the label in the Document Viewer, the OCR'd or native text behind the selected region will be used to populate the '''Data Element's''' label. | # Upon lassoing the label in the Document Viewer, the OCR'd or native text behind the selected region will be used to populate the '''Data Element's''' label. | ||
#* At this point, the label for the "Invoice Number" '''Data Field''' is now "Invoice Number" because that's the text data we selected. Whatever text characters you lasso with your cursor will be assigned as the label. | #* At this point, the label for the "Invoice Number" '''Data Field''' is now "Invoice Number" because that's the text data we selected. Whatever text characters you lasso with your cursor will be assigned as the label. | ||
# Notice this label also now appears in the '''''Header''''' tab below. That's because we had the '''''Header''''' tab selected when we lassoed the label. | |||
#* The text collected here ("Invoice Number") is the '''''Header''''' label for the "Invoice Number" '''Data Field'''. | |||
#* We'll talk about the difference between '''''Header''''', '''''Footer''''', and '''''Static''''' labels at later points. This will be important when using labels for data extraction purposes. | |||
#* However, think of the '''''Header''''' label as the "main" label identifying the '''Data Element's''' value. The '''''Header''''' label indicates where the data "starts" (If you're a human reading the document, you start looking for the corresponding data after you find and read the '''''Header''''' label. The same is true for '''Grooper'''). | |||
| | | | ||
[[File: | [[File:Labeling-behavior-about-11.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 265: | Line 216: | ||
# This will correspond to the label "PO Number" on the document itself. | # This will correspond to the label "PO Number" on the document itself. | ||
{|cellpadding="10" cellspacing="5" | |||
|-style="background-color:#f89420; color:white" | |||
|style="font-size:22pt"|'''⚠'''||Whether lassoing the text using the Document Viewer or manually typing into the textbox, you may collect a maximum of '''one''' '''''Header''''' label and '''one''' '''''Footer''''' label per '''Data Element''' (and '''one''' '''''Static''''' label for '''Data Fields''') per '''Document Type'''. | |||
|} | |||
| | | | ||
[[File: | [[File:Labeling-behavior-about-12.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
# | # Upon entering the label into the text box, just you'll see the label in the '''''Header''''' tab, just like we saw when we collected a label by lassoing the text on the Document Viewer. | ||
# Notice as well, there is a green checkmark next to the '''''Header''''' tab (and the box below is highlighted green). | |||
#* This means the text label is matching something on the document. If it did not, you would see a red "X" next to the '''''Header''''' tab and the box below would be highlighted red. | |||
# Also note, since this label is being returned on this document, we can verify it in the Document Viewer. The selected '''Data Field''' ("Purchase Order Number") and it's text label are highlighted green on the document, indicating 1) it was successfully located on the document and 2) where it was located. | |||
| | |||
[[File:Labeling-behavior-about-13.png]] | |||
| | |||
[[File: | |||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 284: | Line 235: | ||
# Next, we will focus on collecting labels from tables and table columns (the '''Data Table''' and '''Data Column''' elements in a '''Data Model'''). The process is essentially the same, but bears some extra explanation. | # Next, we will focus on collecting labels from tables and table columns (the '''Data Table''' and '''Data Column''' elements in a '''Data Model'''). The process is essentially the same, but bears some extra explanation. | ||
| | | | ||
[[File: | [[File:Labeling-behavior-about-14.png]] | ||
|} | |} | ||
| Line 305: | Line 256: | ||
* In particular if you are dealing with OCR text data containing inaccurate character recognition data, establishing the full header row for the table will boost the [[Fuzzy RegEx|fuzzy matching]] capabilities of the '''''Labeling Behavior'''''. | * In particular if you are dealing with OCR text data containing inaccurate character recognition data, establishing the full header row for the table will boost the [[Fuzzy RegEx|fuzzy matching]] capabilities of the '''''Labeling Behavior'''''. | ||
| | | | ||
[[File: | [[File:Labeling-behavior-about-15.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 314: | Line 265: | ||
#* Generally, you should collect the whole row of column headers, even if there are extra columns whose data you are ''not'' collecting. | #* Generally, you should collect the whole row of column headers, even if there are extra columns whose data you are ''not'' collecting. | ||
| | | | ||
[[File: | [[File:Labeling-behavior-about-16.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 322: | Line 273: | ||
#* Here, the stacked label, "Qty. Ord.". | #* Here, the stacked label, "Qty. Ord.". | ||
| | | | ||
[[File: | [[File:Labeling-behavior-about-17.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 328: | Line 279: | ||
# We have four '''Data Columns''' for this '''Data Table'''. Therefore, we collect four header labels from the document. | # We have four '''Data Columns''' for this '''Data Table'''. Therefore, we collect four header labels from the document. | ||
| | | | ||
[[File: | [[File:Labeling-behavior-about-18.png]] | ||
|} | |} | ||
| Line 345: | Line 296: | ||
# Press the "Auto Map" button to automatically assign previously collected labels, | # Press the "Auto Map" button to automatically assign previously collected labels, | ||
| | | | ||
[[File: | [[File:Labeling-behavior-about-19.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 359: | Line 310: | ||
As you keep collecting labels for more and more '''Document Types''', the Auto Map feature will pick up more and more labels, allowing you to quickly onboard new '''Document Types'''. | As you keep collecting labels for more and more '''Document Types''', the Auto Map feature will pick up more and more labels, allowing you to quickly onboard new '''Document Types'''. | ||
| | | | ||
[[File: | [[File:Labeling-behavior-about-20.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 371: | Line 322: | ||
#* The mapped label for the "Purchase Order Number" '''Data Field''' was "PO Number" (as it was collected for the "Factura" '''Document Type'''), but it is more specifically "PO Number:" on the "Lasku" documents. We can just add the colon at the end of the label manually. | #* The mapped label for the "Purchase Order Number" '''Data Field''' was "PO Number" (as it was collected for the "Factura" '''Document Type'''), but it is more specifically "PO Number:" on the "Lasku" documents. We can just add the colon at the end of the label manually. | ||
| | | | ||
[[File: | [[File:Labeling-behavior-about-21.png]] | ||
|} | |} | ||
| Line 394: | Line 345: | ||
# First select the '''Data Element''' in the '''Data Model's''' hierarchy to which you wish to add the label. | # First select the '''Data Element''' in the '''Data Model's''' hierarchy to which you wish to add the label. | ||
#* In our case, we're selecting the '''Data Model''' itself. | #* In our case, we're selecting the '''Data Model''' itself. | ||
# | # Right-click either the '''''Header''''' or '''''Footer''''' tab. | ||
# Press the "Add Custom Label..." button. | |||
# The following dialogue box will appear. | |||
# You may enter a name for the custom label, or use the default "Custom ##" naming convention. | |||
# Press the "OK" button when finished. | |||
# | |||
| | | | ||
[[File: | [[File:Labeling-behavior-about-22.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
# This will add a new label tab, named whatever you named it in the previous step. | # This will add a new label tab, named whatever you named it in the previous step. | ||
#* Here, we | #* Here, we kept with the default "Custom 01" name. | ||
#* Notice the red "X" next to the name "Custom 01" as well. This indicates the label is not matching anything on the document. Currently the label is "Custom 01", which doesn't appear anywhere on the document. We need to change that by collecting a new label. | |||
# Collect the custom label by either lassoing the text using the Document Viewer or manually typing in the label. | # Collect the custom label by either lassoing the text using the Document Viewer or manually typing in the label. | ||
#* For example, the word "Invoice" might be a useful label for classification purposes. This label isn't used to collect anything in our '''Data Model''', but might be helpful to identify this and other invoices from the Factura Technology Corp as "Factura" '''Document Types'''. Collecting the label "Invoice" as a Custom Label will allow us to use it as a feature of this '''Document Type''' for classification. | #* For example, the word "Invoice" might be a useful label for classification purposes. This label isn't used to collect anything in our '''Data Model''', but might be helpful to identify this and other invoices from the Factura Technology Corp as "Factura" '''Document Types'''. Collecting the label "Invoice" as a Custom Label will allow us to use it as a feature of this '''Document Type''' for classification. | ||
| | | | ||
[[File: | [[File:Labeling-behavior-about-23.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
You may add more Custom Labels to the selected '''Data Element''' by repeating the process described above. | You may add more Custom Labels to the selected '''Data Element''' by repeating the process described above. | ||
# | # Right-click any of the label tabs. | ||
# | # Add a new label with the "Add Custom Label..." button. | ||
| | | | ||
[[File: | [[File:Labeling-behavior-about-24.png]] | ||
|} | |} | ||
| Line 436: | Line 382: | ||
This can present a challenge for data extraction. The possibilities for false-positive results tend to crop up the more generic the label used to identify a desired value. There are three separate date values identified by the word "Date" (in full or in part) on this document. | This can present a challenge for data extraction. The possibilities for false-positive results tend to crop up the more generic the label used to identify a desired value. There are three separate date values identified by the word "Date" (in full or in part) on this document. | ||
| | | | ||
[[File: | [[File:Labeling-behavior-about-25.png]] | ||
|} | |} | ||
| Line 457: | Line 403: | ||
# In the case of the "Invoice Date" '''Data Field''' its direct parent '''Data Element''' is the '''Data Model''' itself. | # In the case of the "Invoice Date" '''Data Field''' its direct parent '''Data Element''' is the '''Data Model''' itself. | ||
# Right-click the "Header" or "Footer" tab and select "Add Custom Label..." to add the Custom Label. | |||
| | | | ||
[[File: | [[File:Labeling-behavior-about-26.png]] | ||
|- | |- | ||
| | |valgin=top| | ||
# | # The Custom Label we added was "Date Page". | ||
# | # This will provide the simple label "Date" some extra context. | ||
#* Which of the three results for the label "Date" do we want to accept? The one falling within this zone. | #* Which of the three results for the label "Date" do we want to accept? The one falling within this zone. | ||
| | | | ||
[[File: | [[File:Labeling-behavior-about-27.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
Now that we've added the label, we need to marry the Custom Label with the '''Data Field''' its giving extra context to. This is done with the '''''Parent''''' property of a '''Data Field''' label. | Now that we've added the label, we need to marry the Custom Label with the '''Data Field''' its giving extra context to. This is done with the '''''Parent''''' property of a '''Data Field''' label. | ||
# | # In our case, the Custom Label provides extra context for the "Invoice Date" '''Data Field's''' label. We've selected the "Invoice Date" '''Data Field'''. | ||
# Select the '''''Parent''''' property. | |||
#* Note: This property is ''only'' present for '''Data Field''' and '''Data Column''' labels. | |||
# | |||
# Using the drop down list, select the Custom Label you wish to use for the Context Label. | # Using the drop down list, select the Custom Label you wish to use for the Context Label. | ||
| | | | ||
[[File: | [[File:Labeling-behavior-about-28.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
# Notice with this Context Label added | # Notice with this Context Label added... | ||
# ...We only return a single result for the "Invoice Date" '''Data Field's''' label "Date". This is the label we want to associate with this '''Data Field.''' | |||
# The other two results do not fall within the Context Label, and are no longer returned. | # The other two results do not fall within the Context Label, and are no longer returned. | ||
| | | | ||
[[File: | [[File:Labeling-behavior-about-29.png]] | ||
|} | |} | ||
| Line 506: | Line 435: | ||
</tab> | </tab> | ||
</tabs> | </tabs> | ||
=== Label Sets & Classification === | === Label Sets & Classification === | ||
| Line 609: | Line 536: | ||
#* In this case the "A" '''Document Type'''. | #* In this case the "A" '''Document Type'''. | ||
| | | | ||
[[File: | [[File:Labeling-behavior-classification-how to-01.png]] | ||
|} | |} | ||
==== <span style="font-size:115%; color:#662d91">Configuring Labelset-Based Classification</span> ==== | ==== <span style="font-size:115%; color:#662d91">Configuring Labelset-Based Classification</span> ==== | ||
| Line 642: | Line 568: | ||
#* However, you will need to add the '''''Labeling Behavior''''' at some point in order to collect label sets for the '''Document Types''' and ultimately use the '''''Labelset-Based''''' method for document classification. Visit the [[#Collect Label Sets|tutorial above]] if you're unsure how to add the '''''Labeling Behavior''''' to the '''Content Model'''. | #* However, you will need to add the '''''Labeling Behavior''''' at some point in order to collect label sets for the '''Document Types''' and ultimately use the '''''Labelset-Based''''' method for document classification. Visit the [[#Collect Label Sets|tutorial above]] if you're unsure how to add the '''''Labeling Behavior''''' to the '''Content Model'''. | ||
| | | | ||
[[File: | [[File:Labeling-behavior-classification-how to-02.png]] | ||
|} | |} | ||
| Line 658: | Line 584: | ||
# Collect labels for each '''Document Type''' in the '''Data Model'''. | # Collect labels for each '''Document Type''' in the '''Data Model'''. | ||
|valign=top| | |valign=top| | ||
[[File: | [[File:Labeling-behavior-classification-how to-03.png]] | ||
|} | |} | ||
[[#Configuring Labelset-Based Classification|Click me to return to the top]] | {|cellpadding="10" cellspacing="5" | ||
|-style="background-color:#f89420; color:white" | |||
|style="font-size:22pt"|'''⚠''' | |||
| | |||
{|cellpadding=10 cellspacing=5 | |||
|valign=top style="width:40%"| | |||
'''Table Labels and Classification''' | |||
Table headers are often very useful for ''Labelset-Based'' classification, and it generally is the case you want to use them as a classification feature. Currently, if you want to use a '''Data Table''' object's labels for classification, you must set the '''Data Table's''' '''''Minimum Row Count''''' property to ''at least'' "1". This is a known issue in the current version of '''Grooper''' and likely will change. | |||
However, if you find '''Data Table''' and/or '''Data Column''' labels are not included in determining document similarity during classification, do the following: | |||
# Navigate to the '''Data Table''' object in the Node Tree. | |||
# Expand the '''''Row Count Range''''' property. | |||
# Select the '''''Minimum''''' property. | |||
# Enter ''1''. | |||
If you have multiple '''Data Table''' objects in your '''Data Model''', you will need to repeat these steps for each one. | |||
|valign=top| | |||
[[File:Labeling-behavior-classification-how to-26.png]] | |||
|} | |||
|} | |||
[[#Configuring Labelset-Based Classification|Click me to return to the top]] | |||
</tab> | </tab> | ||
<tab name="Test Classification" style="margin:20px"> | <tab name="Test Classification" style="margin:20px"> | ||
| Line 684: | Line 633: | ||
{|cellpadding=10 cellspacing=5 | {|cellpadding=10 cellspacing=5 | ||
|valign=top style="width:40%"| | |valign=top style="width:40%"| | ||
# | # The easiest way to test classification (for the ''Labelset-Based'' method or any other) is with the "Classification Testing" tab of the '''Content Model'''. | ||
# | # Select a test '''Batch''' with the "Batch Selector" dropdown window. | ||
# Select a '''Batch Folder''' and press the "Classify" button to classify a single document folder. | |||
# Select a '''Batch Folder''' and press the "Classify All" button to classify all document folders in the '''Batch'''. | |||
| | | | ||
[[File: | [[File:Labeling-behavior-classification-how to-04.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 705: | Line 649: | ||
#* This means a match has been found for all labels in the "Factura" '''Document Type's''' label set. | #* This means a match has been found for all labels in the "Factura" '''Document Type's''' label set. | ||
|valign=top| | |valign=top| | ||
[[File: | [[File:Labeling-behavior-classification-how to-05.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 711: | Line 655: | ||
#* The '''Batch Folder''' has been assigned the "Envoy" '''Document Type'''. | #* The '''Batch Folder''' has been assigned the "Envoy" '''Document Type'''. | ||
# It indeed should have been classified so. It is an invoice from Envoy Imaging Systems. | # It indeed should have been classified so. It is an invoice from Envoy Imaging Systems. | ||
# However, it's a mitigated success in that its similarity score is only | # However, it's a mitigated success in that its similarity score is only 85%. | ||
#* That means only | #* That means only 85% of the labels located on this document match the label set for the "Envoy" '''Document Type'''. | ||
# In this case, this is due to poor OCR data. While some labels may be present on the document, their OCR data is too garbled to match the label in the label set. | # In this case, this is due to poor OCR data. While some labels may be present on the document, their OCR data is too garbled to match the label in the label set. | ||
#* For example, the label <code>Invoice</code> was not matched because the text was OCR'd as "nvoice". | #* For example, the label <code>Invoice</code> was not matched because the text was OCR'd as "nvoice". | ||
#* But a win is a win! Part of the reason ''Labelset-Based'' can be an effective classification method is you can miss a few labels due to poor OCR and still end up classifying the document appropriately. It is the ''set as a whole'' which determines similarity. As long as the document is more similar to the correct '''Document Type''' than any of the other '''Document Types''', '''Grooper''' has made the right classification decision. | #* But a win is a win! Part of the reason ''Labelset-Based'' can be an effective classification method is you can miss a few labels due to poor OCR and still end up classifying the document appropriately. It is the ''set as a whole'' which determines similarity. As long as the document is more similar to the correct '''Document Type''' than any of the other '''Document Types''', '''Grooper''' has made the right classification decision. | ||
|valign=top| | |valign=top| | ||
[[File: | [[File:Labeling-behavior-classification-how to-06.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 729: | Line 673: | ||
#* But just because we don't have a '''Data Field''' for it doesn't mean it's not a useful label for classification. We will look at how to create custom labels for classification purposes in the next section, [[#Common Problems and Solutions|Common Problems and Solutions]]. | #* But just because we don't have a '''Data Field''' for it doesn't mean it's not a useful label for classification. We will look at how to create custom labels for classification purposes in the next section, [[#Common Problems and Solutions|Common Problems and Solutions]]. | ||
|valign=top| | |valign=top| | ||
[[File: | [[File:Labeling-behavior-classification-how to-07.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 740: | Line 684: | ||
#* Such is the case with invoices. There's lots of different invoice formats, often unique to each vendor. When you get one in a '''Batch''' you haven't seen before, you will need to add a new '''Document Type''' to account for the new variant. However, as we will see in the [[#Common Problems and Solutions|next section]], onboarding new '''Document Types''' with Label Sets is relatively quick and painless. | #* Such is the case with invoices. There's lots of different invoice formats, often unique to each vendor. When you get one in a '''Batch''' you haven't seen before, you will need to add a new '''Document Type''' to account for the new variant. However, as we will see in the [[#Common Problems and Solutions|next section]], onboarding new '''Document Types''' with Label Sets is relatively quick and painless. | ||
|valign=top| | |valign=top| | ||
[[File: | [[File:Labeling-behavior-classification-how to-08.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 748: | Line 692: | ||
# The only think we will need to watch out for is making sure once we do add a '''Document Type''' for the invoices from Standard Products, it classifies ''more'' confidently than the "Rechnung" '''Document Type''', beating out its similarity score and receiving the "Standard" '''Document Type'''. | # The only think we will need to watch out for is making sure once we do add a '''Document Type''' for the invoices from Standard Products, it classifies ''more'' confidently than the "Rechnung" '''Document Type''', beating out its similarity score and receiving the "Standard" '''Document Type'''. | ||
|valign=top| | |valign=top| | ||
[[File: | [[File:Labeling-behavior-classification-how to-09.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 754: | Line 698: | ||
#* The '''Batch Folder''' ''should'' have been assigned the "Envoy" '''Document Type''' but it was unclassified. | #* The '''Batch Folder''' ''should'' have been assigned the "Envoy" '''Document Type''' but it was unclassified. | ||
# The document is of poor enough quality to get near unusable OCR results. | # The document is of poor enough quality to get near unusable OCR results. | ||
# This resulted in a paltry similarity score of | # This resulted in a paltry similarity score of 23%. | ||
What can we do about this? | What can we do about this? | ||
| Line 762: | Line 706: | ||
You have to know when to leave well enough alone. Outliers like this are a good example of when to do just that. | You have to know when to leave well enough alone. Outliers like this are a good example of when to do just that. | ||
|valign=top| | |valign=top| | ||
[[File: | [[File:Labeling-behavior-classification-how to-10.png]] | ||
|} | |} | ||
| Line 769: | Line 713: | ||
</tab> | </tab> | ||
</tabs> | </tabs> | ||
==== <span style="font-size:115%; color:#662d91">Common Problems and Solutions</span> ==== | ==== <span style="font-size:115%; color:#662d91">Common Problems and Solutions</span> ==== | ||
| Line 790: | Line 733: | ||
That is one of the reasons for adding custom labels to a '''Document Type's''' Label Set. | That is one of the reasons for adding custom labels to a '''Document Type's''' Label Set. | ||
|valign=top| | |valign=top| | ||
[[File: | [[File:Labeling-behavior-classification-how to-07.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 796: | Line 739: | ||
# Either: | # Either: | ||
## Select a document folder in the '''Batch''' selector of the desired '''Document Type'''. | ## Select a document folder in the '''Batch''' selector of the desired '''Document Type'''. | ||
## Or | ## Or select a document folder and use the "Set Type..." button to assign it the desired '''Document Type'''. | ||
##* In our case we want to add a custom label to the "Envoy" '''Document Type'''. We have selected the document folder in the '''Batch''' and assigned it the "Envoy" '''Document Type'''. | ##* In our case we want to add a custom label to the "Envoy" '''Document Type'''. We have selected the document folder in the '''Batch''' and assigned it the "Envoy" '''Document Type'''. | ||
# Select a '''Data Element''' from the '''Data Model''' to which you wish to add the custom label. | |||
#* Most commonly, when adding a custom label for classification purposes, you'll just want to add it to the '''Data Model''' root itself, as we've selected here. | |||
# Right-click one of the label tabs, "Header" or "Footer". | |||
#* It doesn't matter which one, you just need to right click any label tab. | |||
# Select "Add Custom Label..." | |||
| | | | ||
[[File: | [[File:Labeling-behavior-classification-how to-11.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
# | # This will bring up the following "Add Custom Label" window. | ||
# | # Name the custom label whatever you like. | ||
# Press the "OK" button to add the label. | |||
# | |valign=top| | ||
[[File:Labeling-behavior-classification-how to-12.png]] | |||
| | |||
[[File: | |||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 815: | Line 761: | ||
# Using the text editor, collect the label (either typing it in or lassoing or double clicking it in the document viewer). | # Using the text editor, collect the label (either typing it in or lassoing or double clicking it in the document viewer). | ||
#* In this case, <code>Salesperson ID</code> | #* In this case, <code>Salesperson ID</code> | ||
#* FYI: '''Grooper''' will automatically enter whatever you title the custom label. So, in our case, all we actually did was change the custom label's name to "Salesperson ID" and the label <code>Salesperson ID</code> was automatically populated. | |||
# This will add the label "Salesperson ID" to the "Envoy" '''Document Type's''' Label Set. | |||
Now that this label is in the Label Set, it will be considered a label during classification. The label's there. It's part of the document, whether we're extracting the value or not. We "tell" '''Grooper''' labels like these should be considered features for classification by creating custom labels. | Now that this label is in the Label Set, it will be considered a label during classification. The label's there. It's part of the document, whether we're extracting the value or not. We "tell" '''Grooper''' labels like these should be considered features for classification by creating custom labels. | ||
| Line 825: | Line 773: | ||
|} | |} | ||
|valign=top| | |valign=top| | ||
[[File: | [[File:Labeling-behavior-classification-how to-13.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
When we re-classify this '''Batch''', we will see some different results. | When we re-classify this '''Batch''', we will see some different results. | ||
# Navigate to the "Classify" '''Batch | # Navigate to the "Classification Testing" tab to test classification with the custom label added. | ||
# Press the "Classify All" button to classify all document folders in the '''Batch'''. | |||
# Notice this document now classifies correctly as an "Envoy" '''Document Type'''! | # Notice this document now classifies correctly as an "Envoy" '''Document Type'''! | ||
# Before we added the custom label, this only achieved a similarity score of 59%, falling short of the 60% minimum similarity threshold. Now, it scores a 63% similarity. | # Before we added the custom label, this only achieved a similarity score of 59%, falling short of the 60% minimum similarity threshold. Now, it scores a 63% similarity. | ||
| Line 837: | Line 785: | ||
#* And that's with just one custom label added. There are tons more labels we could collect as custom labels on the document, likely further increasing the similarity score. | #* And that's with just one custom label added. There are tons more labels we could collect as custom labels on the document, likely further increasing the similarity score. | ||
|valign=top| | |valign=top| | ||
[[File: | [[File:Labeling-behavior-classification-how to-14.png]] | ||
|} | |} | ||
| Line 856: | Line 804: | ||
Luckily, the process of adding new '''Document Types''' and defining their label sets is quick and painless and actually can become easier the more '''Document Types''' you add to the '''Content Model'''. | Luckily, the process of adding new '''Document Types''' and defining their label sets is quick and painless and actually can become easier the more '''Document Types''' you add to the '''Content Model'''. | ||
|valign=top| | |valign=top| | ||
[[File: | [[File:Labeling-behavior-classification-how to-15.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 863: | Line 811: | ||
# Navigate to the "Labels" tab in the '''Content Model'''. | # Navigate to the "Labels" tab in the '''Content Model'''. | ||
# Select the unclassified document folder for which you want to create a new '''Document Type'''. | # Select the unclassified document folder for which you want to create a new '''Document Type'''. | ||
# | # Press the "Create Type..." button. | ||
# This will pop up the following window to add a '''Document Type'''. | |||
# Name the '''Document Type''' whatever you like. | |||
#* In our case we named it "Stuff and Things", for the invoice from the very real company, Stuff and Things, that sells stuff, as well as things. | |||
# Press the "OK" button to finish and add the '''Document Type'''. | |||
# | |||
#* In our case we named it "Stuff and Things", for the invoice | |||
# | |||
|valign=top| | |valign=top| | ||
[[File: | [[File:Labeling-behavior-classification-how to-16.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 882: | Line 827: | ||
* Keep in mind, as you add new '''Document Types''' to the '''Content Model''' you will want to perform regression testing to ensure your classification model is still accurate. | * Keep in mind, as you add new '''Document Types''' to the '''Content Model''' you will want to perform regression testing to ensure your classification model is still accurate. | ||
|valign=top| | |valign=top| | ||
[[File: | [[File:Labeling-behavior-classification-how to-23.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
As you keep adding more and more '''Document Types''' to the '''Content Model''', you will inevitably keep adding more and more labels for the '''Data Elements''' in your '''Data Model'''. Eventually, you will come across a new document variant that shares a lot of similarity with an already existing '''Document Type'''. | As you keep adding more and more '''Document Types''' to the '''Content Model''', you will inevitably keep adding more and more labels for the '''Data Elements''' in your '''Data Model'''. Eventually, you will come across a new document variant that shares a lot of similarity with an already existing '''Document Type'''. | ||
# Such was the case with these three documents. They were confidently classified as "Rechnung" '''Document Types'''. | # Such was the case with these three documents. They were confidently classified as "Rechnung" '''Document Types'''. | ||
# Their similarity is | # Their similarity is 85% - 87%. | ||
# However, these aren't invoices from the vendor Rechnung, they are from the vendor Standard Products. | # However, these aren't invoices from the vendor Rechnung, they are from the vendor Standard Products. | ||
#* They simply share ''a lot'' of the same labels. Interestingly, this "problem" is actually going to end up making our job even easier when adding the new '''Document Type'''. | #* They simply share ''a lot'' of the same labels. Interestingly, this "problem" is actually going to end up making our job even easier when adding the new '''Document Type'''. | ||
|valign=top| | |valign=top| | ||
[[File: | [[File:Labeling-behavior-classification-how to-17.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
| Line 907: | Line 844: | ||
# Add the new '''Document Type''' | # Add the new '''Document Type''' | ||
# Assign the right document folder (whose labels you want to collect) the new '''Document Type'''. | # Assign the right document folder (whose labels you want to collect) the new '''Document Type'''. | ||
# | # Press the "Auto-Map" button. | ||
'''Grooper''' will search for matching labels already collected in the Label Sets of other '''Document Types'''. | |||
# | #<li value=4> In this case, there was some kind of matching label from another '''Document Type''' for nearly every '''Data Element''' in the '''Data Model'''. | ||
# | # The only thing we have to do now is review the auto-mapped labels, collect any that were not mapped, and re-collect or edit any labels that are not accurate. | ||
# | #* For example, this header label for the "Line Items" '''Data Table''' is not quite right. It's red and not green because there's another column header label in the Standard invoices' line items table. | ||
|valign=top| | |valign=top| | ||
[[File: | [[File:Labeling-behavior-classification-how to-18.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
# | # Upon collecting the full header label for this table, everything matches! | ||
# | #* That's it! We've added a new '''Document Type''' and were able to auto-map all labels except one with the press of a button. | ||
# We can now press "Save", test our classification, and see if these documents classify correctly. | |||
|valign=top| | |valign=top| | ||
[[File: | [[File:Labeling-behavior-classification-how to-19.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
# We will test out our new '''Document Type''' using the "Classification Testing" tab. | |||
# Press the "Classify All" button. | |||
# With the '''Document Type''' for the Standard invoices, and its Label Set collected, these three document folder are now classified correctly. | |||
| | |||
[[File:Labeling-behavior-classification-how to-20.png]] | |||
|} | |||
# | [[#Common Problems and Solutions|Click me to return to the top]] | ||
</tab> | |||
<tab name="Volatile Labels for Optional Labels" style="margin:20px"> | |||
=== Volatile Labels === | |||
{|cellpadding=10 cellspacing=5 | |||
|valign=top style="width:40%"| | |||
Sometimes, you will collect a label you ''do not'' want to use for classification purposes. Most often, this is because the label may or may not be present depending on the document. | |||
For example, some of these invoices from Standard Products have the sales tax totaled on the document. However, some do not. | |||
This is called a "Volatile" label. Its presence on a document is unpredictable. Sometimes it's there. Sometimes it's not. It's an optional piece of information. However, because it's optional (or "volatile") we don't actually want to include this as a label for classification. It's going to decrease the similarity score for documents who do not contain the label. | |||
|valign=top| | |||
[[File:Labeling-behavior-classification-how to-21.png]] | |||
|- | |||
|valign=top| | |||
# For example, the selected document here does ''not'' have the tax listed on the document. | |||
# Since that label is not present, its similarity is lower than if it were present. | |||
#* It drops from 100% to 98% in this case. Now, this may not be a critical drop in similarity for this case, but very well could be for others depending on their OCR quality or presence of multiple volatile labels. | |||
|valign=top| | |||
[[File:Labeling-behavior-classification-how to-22.png]] | |||
|- | |- | ||
|valign=top| | |valign=top| | ||
You can indicate these kinds of labels are "volatile" and should not be considered for classification. Whether it's there or not, '''Grooper''' will not include it as a feature to measure the similarity between an unclassified document and the '''Document Type'''. | |||
# | # To do this, navigate to the "Labels" tab of the '''Content Model'''. | ||
# | # Select the '''Data Element''' whose label you wish to turn volatile. | ||
| | #* In our case, we wish to make the "Tax" '''Data Field's''' label volatile. As we've seen, sometimes its present on the document and sometimes it's not. | ||
[[File: | # Change the '''''Volatile''''' property from ''False'' to ''True''. | ||
|valign=top| | |||
[[File:Labeling-behavior-classification-how to-24.png]] | |||
|- | |||
|valign=top| | |||
# Now, when we classify this document folder... | |||
# ...even though the sales tax label is ''not'' present on the document... | |||
# ...its similarity is 100%! | |||
#* With the label, <code>Tax</code> set as a volatile label, it is no longer considered during the similarity calculation. With it missing from the document, it no longer negatively impacts the similarity score. | |||
|valign=top| | |||
[[File:Labeling-behavior-classification-how to-25.png]] | |||
|} | |} | ||
[[#Common Problems and Solutions|Click me to return to the top]] | [[#Common Problems and Solutions|Click me to return to the top]] | ||
</tab> | </tab> | ||
< | </tabs> | ||
{|cellpadding="10" cellspacing="5" | |||
|-style="background-color:#f89420; color:white" | |||
|style="font-size:22pt"|'''⚠''' | |||
| | |||
{|cellpadding=10 cellspacing=5 | {|cellpadding=10 cellspacing=5 | ||
|valign=top style="width:40%"| | |valign=top style="width:40%"| | ||
'''Table Labels and Classification''' | |||
Table headers are often very useful for ''Labelset-Based'' classification, and it generally is the case you want to use them as a classification feature. Currently, if you want to use a '''Data Table''' object's labels for classification, you must set the '''Data Table's''' '''''Minimum Row Count''''' property to ''at least'' "1". This is a known issue in the current version of '''Grooper''' and likely will change. | |||
However, if you find '''Data Table''' and/or '''Data Column''' labels are not included in determining document similarity during classification, do the following: | |||
# Navigate to the '''Data Table''' object in the Node Tree. | |||
# Expand the '''''Row Count Range''''' property. | |||
# Select the '''''Minimum''''' property. | |||
# Enter ''1''. | |||
# | |||
# | |||
If you have multiple '''Data Table''' objects in your '''Data Model''', you will need to repeat these steps for each one. | |||
| | |||
[[File:Labeling-behavior-classification-how to-26.png]] | |||
|} | |||
[[File: | |||
| | |||
|} | |} | ||
=== Use Label Sets for Field Based Extraction === | |||
</ | ==== <span style="font-size:115%; color:#662d91">Label Sets and the Labeled Value Extractor Type</span> ==== | ||
<tabs style="margin:20px"> | |||
<tab name="Intro to the Labeled Value Extractor" style="margin:20px"> | |||
=== Intro to The Labeled Value Extractor === | |||
For most static field based extraction, the '''''Labeling Behavior''''' leverages the '''''Labeled Value''''' Extractor Type. Let's first briefly examine how '''''Labeled Value''''' works outside of the '''''Labeling Behavior''''' functionality. | |||
''' | |||
As the name implies, '''''Labeled Value''''' extractor is designed to return labeled values. A common feature of structured forms is to divide information across a series of fields. But it's not as if you just have a bunch of data randomly strewn throughout the document. Typically, the field's value will be identified by some kind of label. These labels provide the critical context to what the data refers to. | |||
'''''Labeled Value''''' relies on the spatial relationship between the label and the value. Most often labels and their corresponding values are aligned in one of two ways. | |||
{|cellpadding=10 cellspacing=5 style="margin:20px" | |||
| | | | ||
1. The value will be to the right of the label. | |||
1. The value will be to the right of the label. | |||
| | | | ||
[[File:Value-reader-extractor-types-08.png]] | [[File:Value-reader-extractor-types-08.png]] | ||
| Line 1,159: | Line 1,060: | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
Configuring the '''''Labeled Value''''' extractor's '''''Value Extractor''''' also gives you the myriad of functionalities available to extractors. For example, ''Fuzzy RegEx'' is one of the main ways '''Grooper''' gets around poor OCR data at the time of extraction. When the text data is just a couple characters off of the extractor's regex pattern, ''Fuzzy RegEx'' can not only match the imperfect data but "swap" the wrong characters for the right ones, effectively cleansing your result. | Configuring the '''''Labeled Value''''' extractor's '''''Value Extractor''''' also gives you the myriad of functionalities available to extractors. For example, ''Fuzzy RegEx'' is one of the main ways '''Grooper''' gets around poor OCR data at the time of extraction. When the text data is just a couple characters off of the extractor's regex pattern, ''Fuzzy RegEx'' can not only match the imperfect data but "swap" the wrong characters for the right ones, effectively cleansing your result. | ||
# Take the "Invoice Amount" '''Data Field''' for example. | # Take the "Invoice Amount" '''Data Field''' for example. | ||
# Here, the '''Data Field's''' '''''Value Extractor''''' is set to '''''Labeled Value'''''. | # Here, the '''Data Field's''' '''''Value Extractor''''' is set to '''''Labeled Value'''''. | ||
# And, the '''''Labeled Value''''' extractor's '''''Value Extractor''''' is left unconfigured. | # And, the '''''Labeled Value''''' extractor's '''''Value Extractor''''' is left unconfigured. | ||
# The '''''Labeled Value''''' extractor first locates the collected label <code>Amount Due</code> and without a configured '''''Value Extractor''''' returns the nearest text segment (according to the '''''Maximum Distance''''' settings). | # The '''''Labeled Value''''' extractor first locates the collected label <code>Amount Due</code> and without a configured '''''Value Extractor''''' returns the nearest text segment (according to the '''''Maximum Distance''''' settings). | ||
# This is ''almost'' the result we want. | # This is ''almost'' the result we want. | ||
#* It's the "right" result in that, yes, that is the text segment that corresponds to the invoice amount due for this invoice. | #* It's the "right" result in that, yes, that is the text segment that corresponds to the invoice amount due for this invoice. | ||
#* But it's very much the wrong result in that the OCR text data is inaccurate. "54.954.00" is not a valid currency value. It should be "54,954.00" with the first period being a comma. | #* But it's very much the wrong result in that the OCR text data is inaccurate. "54.954.00" is not a valid currency value. It should be "54,954.00" with the first period being a comma. | ||
|valign=top| | |valign=top| | ||
[[File:Labeling-behavior-how-to-field-extraction-07.png]] | [[File:Labeling-behavior-how-to-field-extraction-07.png]] | ||
|- | |- | ||
|valign=top| | |valign=top| | ||
However, that's just a single character off from being the right result. We could build an extractor to return currency values looking to make fuzzy swaps like this, both matching text that is slightly off and reformatting the result to match a valid currency format. If we used that extractor as the '''''Labeled Value''''' extractor's '''''Value Extractor''''' it would not only find the segment but also reformat the result, swapping the mis-OCR'd period for what it should be, a comma. | However, that's just a single character off from being the right result. We could build an extractor to return currency values looking to make fuzzy swaps like this, both matching text that is slightly off and reformatting the result to match a valid currency format. If we used that extractor as the '''''Labeled Value''''' extractor's '''''Value Extractor''''' it would not only find the segment but also reformat the result, swapping the mis-OCR'd period for what it should be, a comma. | ||
And we've done just that. | And we've done just that. | ||
# Here, we've set the '''''Labeled Value''''' extractor's '''''Value Extractor''''' to reference a '''Data Type''' returning fuzzy matched currency values. | # Here, we've set the '''''Labeled Value''''' extractor's '''''Value Extractor''''' to reference a '''Data Type''' returning fuzzy matched currency values. | ||
# The '''''Value Extractor''''' matches the text we want, below the label <code>Amount Due</code> | # The '''''Value Extractor''''' matches the text we want, below the label <code>Amount Due</code> | ||
# And since the referenced extractor uses ''Fuzzy RegEx'' the returned result is now a valid currency value. | # And since the referenced extractor uses ''Fuzzy RegEx'' the returned result is now a valid currency value. | ||
#* The result is now "54,594.00" instead of "54.594.00". The first period was swapped for a comma. | #* The result is now "54,594.00" instead of "54.594.00". The first period was swapped for a comma. | ||
| | | | ||
[[File:Labeling-behavior-how-to-field-extraction-08.png]] | [[File:Labeling-behavior-how-to-field-extraction-08.png]] | ||
|} | |} | ||
[[#Label Sets and the Labeled Value Extractor Type|Click me to return to the top]] | |||
</tab> | |||
</tabs> | |||
==== <span style="font-size:115%; color:#662d91">Additional Considerations When Using Labeled Value with Label Sets</span> ==== | ==== <span style="font-size:115%; color:#662d91">Additional Considerations When Using Labeled Value with Label Sets</span> ==== | ||
| Line 1,881: | Line 1,782: | ||
--> | --> | ||
# To collect a '''''Footer''''' label, navigate to the "Footer" tab. | # To collect a '''''Footer''''' label, navigate to the "Footer" tab. | ||
# Collect the '''Data Table's''' '''''Footer''''' label. | # Collect the '''Data Table's''' '''''Footer''''' label. | ||
Revision as of 16:28, 2 October 2023
The Labeling Behavior is a Content Type Behavior designed to collect and utilize a document's field labels in a variety of ways. This includes functionality for classification and data extraction.
The Labeling Behavior functionality allows Grooper users to quickly onboard new Document Types for structured and semi-structured forms, utilizing labels as a thumbprint for classification and data extraction purposes. Once the Labeling Behavior is enabled, labels are identified and collected using the "Labels" tab of Document Types. These "Label Sets" can then be used for the following purposes:
- Document classification - Using the Labelset-Based Classification Method
- Field based data extraction - Primarily using the Labeled Value Extractor Type
- Tabular data extraction - Primarily using a Data Table object's Tabular Layout Extract Method
- Sectional data extraction - Primarily using a Data Section object's Transaction Detection Extract Method
| FYI | The Labeling Behavior and its functionality discussed in this article are often referred to as "Label Set Behavior" or simply "Label Sets". |
About
|
You may download and import the file below into your own Grooper environment (version 2021). This contains the Batch(es) with the example document(s) discussed in this article and the Content Model(s) configured according to the How To section's instructions. |

Labels serve an important function on documents. They give the reader critical context to understand where data is located and what it means. How do you know the difference between the date on an invoice document indicating when the invoice was sent and the date indicating when you should pay the invoice? It's the labels. The labels are what distinguishes one type of date from another. For example, "Invoice Date" for the date the invoice was sent and "Due Date" for the date you need to pay by.
Labels can be a way of classifying documents as well. What does one individual label tell you about a document? Well, maybe not much. However, if you take them all together, they can tell you quite a bit about the kind of document you're looking at. For example, a W-4 employee withholding form is going to use different labels than an employee healthcare enrollment form. These are two very different documents collecting very different information. The labels used to collect this information are thus different as well.
Furthermore, you can even tell the difference between two very closely related documents using labels as well. For example, two different invoices from two different vendors may share some similarity in the labels they use to detail information. But there will be some differences as well. These differences can be useful identifiers to distinguish one from the other. Put all together, labels can act as a thumbprint Grooper can use to classify a document as one Document Type or another.
The Labeling Behavior is built on these concepts, collecting and utilizing labels for Document Types in a Content Model for classification and data extraction purposes.
|
As a Behavior, the Labeling Behavior is enabled on a Content Type object in Grooper.
|
|||
|
|||
|
Once the Labeling Behavior is enabled, the next big step is collecting label sets for the various Document Types in your Content Model.
Each Document Type has its own set of labels used to define information on the document. For example, the "Factura" Document Type in this Content Model uses the label "PO Number" to call out the purchase order number on this invoice document. A different Document Type, corresponding to a different invoice format, might use a different label such as "Purchase Order Number" or "PO #".
For more information on collecting label sets for the Document Types in your Content Model see the How To section of this article. |
|||
|
Once label sets are collected for each Document Type, they can be used for classification and data extraction purposes. For example, labels were used in this case to:
For more information on how to use labels for these purposes, see the How To section of this article. |
How To
The Labeling Behavior (often referred to as "Label Set Behavior" or just "Label Sets") are well suited for structured and semi-structured document sets. Label Sets are particularly useful for situations where you have multiple variations for one kind of document or another. While the information you want to extract from the document set may be the same from variation to variation, how the data is laid out and labeled may be very different from one variation of the document to another. Label Sets allow you to quickly onboard new Document Types to capture new form structures.
|
We will use invoices for the document set in the following tutorials. In a perfect world, you'd create a Content Model with a single "Invoice" Document Type whose Data Model would successfully extract all Data Elements for all invoices from all vendors every time no matter what. This is often not the case. You may find you need to add multiple Document Types to account for variations of an invoice from multiple vendors. Label Sets give you a method of quickly adding to Document Types to model new variations. In our case, we will presume we need to create one Document Type for each vendor. We will start with five Document Types for invoices from five vendors.
|
Collect Label Sets
|
Collecting labels for the Document Types in your Content Model will be the first thing you want to do after enabling the Labeling Behavior. Labels for each Data Element in the Document Type's Data Model are defined using the "Labels" tab of the Content Model.
|
|||
|
Collect Field Labels
Now that this document has been classified (assigned a Document Type from our Content Model), we can collect labels for its Document Type. This can be done in one of three ways:
- Lassoing the label in the "Document Viewer".
- Double-clicking the label in the Document Viewer.
- Typing the label in manually.
| ‼ | Going forward, this tutorial presumes you have obtained machine readable text from these documents, either OCR'd text or native text, via the Recognize activity. |
|
Generally the quickest way is by simply lassoing the label in the "Document Viewer".
|
|||
|
|||
|
If you choose, you may also manually enter a label for a Data Element by simply typing it into the text box.
|
|||
|
|||
|
Collect Table and Column Labels
|
Table and column labels can be used for tabular data extraction as well, setting a Data Table object to use the Tabular Layout Extract Method. When collecting labels for this method of table extraction, keep in mind you must collect the individual column headers, and may optionally collect both the full row of column header labels as well. While it is optional, it is generally regarded as best practice to capture the full row of column header labels. This will generally increase the accuracy of your column label extraction. We will do both in this tutorial.
This may seem like you are duplicating your efforts but it is often critical to do both in order for the Tabular Layout Extract Method to map the table's structure and ultimately collect the table's data.
|
|
|
|
|
|
|
Auto Map Labels
|
As you add labels for each Document Type, you may find some documents have labels in common. For example, there are only so many ways to label an invoice number. It might be "Invoice Number", "Invoice No", "Invoice #" or even just "Invoice". Some invoices are going to use one label, others another. When collecting labels for multiple Document Types you can use the "Auto Map" feature to automatically add labels you've previously collected on another Document Type.
|
|
|
Grooper will search the document's text for labels matching those previously collected on other Document Types.
If a match is not found, the Data Element's label is left blank.
As you keep collecting labels for more and more Document Types, the Auto Map feature will pick up more and more labels, allowing you to quickly onboard new Document Types. |
|
|
Be aware, you may still need to validate the auto mapped values and make adjustments.
|
Collect Custom Labels
It's important to keep in mind labels are collected for corresponding Data Elements in a Data Model. You collect one label per Data Element (Data Field, Data Section, Data Table or Data Column). What if you want to collect a label that is distinct from a Data Element, one that doesn't necessarily have to do with a value collected by your Data Model? And why would you even want to?
That's what "Custom Labels" are for. Custom labels serve two primary functions:
- Providing additional labels for classification purposes.
- Providing context labels when a Data Element's label matches multiple points on a document
|
Custom Labels may only be added to Data Model, Data Section or Data Table objects' labels. Put another way, any Data Element in the Data Model's hierarchy that can have child Data Elements can have custom labels. When used for classification purposes, custom labels are typically added to the Data Model itself.
|
|
|
|
|
You may add more Custom Labels to the selected Data Element by repeating the process described above.
|
Custom Labels as Context Labels
|
Some labels are more specific than others. The label "Invoice Date" is more specific than the label "Date". If you see the label "Invoice Date" you know the date you're looking at is the date the invoice was generated. The label "Date" may refer to the invoice's generation date or it could be part of another label like "Due Date". However, some invoice formats will label the invoice date as simply "Date".
This can present a challenge for data extraction. The possibilities for false-positive results tend to crop up the more generic the label used to identify a desired value. There are three separate date values identified by the word "Date" (in full or in part) on this document. |
This is the second reason Custom Labels are typically added for a Document Type, to provide extra context for generic labels, especially when they produce multiple results on a document, leading to false-positive data extraction.
There are two steps to adding and using a Custom Label for this purpose:
- Add the Custom Label.
- Marry the Custom Label with the Data Element's label.
We will refer to this type of a Custom Label as a "Context Label" from here out.
|
The only "trick" to this is adding the Context Label to the appropriate level of the Data Model's hierarchy. Remember, a Custom Label may only be added to a Data Model, Data Section or Data Table object. We cannot add a Custom Label to a Data Field, such as the "Invoice Number" Data Field. To add a Context Label a Data Field can use, we must add the Custom Label to its direct parent Data Element.
|
|
|
|
|
Now that we've added the label, we need to marry the Custom Label with the Data Field its giving extra context to. This is done with the Parent property of a Data Field label.
|
|
|
Label Sets & Classification
About Labelset-Based Classification
Label Sets can be used for classifying documents using the Labelset-Based Classification Method. For structured and semi-structured forms labels end up being a way of identifying a document. Without the field data entered, the labels are really what define the document. You know what kind of document you're looking at based on what kind of information is presented and in the case of Labelset-Based classification how that data is labeled. Even when those labels are very similar from one variant to the next, they end up being a thumbprint of that variant. For example, you might use Labelset-Based classification to create Document Types for different variations of invoices from different vendors. The information presented on each variant from each vendor will be more or less the same, and some labels will be more commonly used by different vendors (such as "Invoice Number"). However, if there is enough variation in the set of labels, you can easily differentiate an invoice from one vendor verses another just based on the variation in labels.
|
Take these four "documents". Each one is collecting the same information:
So we might have five Data Fields in our Data Model, one for each piece of information. We'd also collect one label for each Data Field as well. While the data we want from these documents is the same, there is some variation in the labels used for each different document type. If we wanted to distinguish these four documents from each other by classifying using the Labelset-Based Classification Method. This is all done measuring the similarity between the collected label sets for each Document Type.
How is Document Type "C" different from Document Type "A"?
How is Document Type "D" different from Document Type "A"?
|
|
Using the Labelset-Based Classification Method unclassified documents are classified by assigning the document the Document Type whose labels are most similar. The basic concept is "similarity" is determined by how many labels are shared between the unclassified document and the label sets collected for the Document Types in your Content Model. The unclassified document is assigned the Document Type with the highest degree of similarity between matched labels and the Document Types' label sets.
|
The similarity calculation is very straightforward. Grooper searches for labels collected for every Document Type and measures the total character difference between all the labels matched on the document. If each of these five labels is collected for each Document Type's Label Set, you'd have the following character totals for the set.
How similar is Document Type "A" to Document Type "B"?
How similar is Document Type "A" to Document Type "C"?
How similar is Document Type "A" to Document Type "D"?
|
|
|
If we ran one of these "documents" into Grooper, we can see these results very clearly.
|
Configuring Labelset-Based Classification
Next, we will walk through the steps required to enable and configure the Labelset-Based Classification Method, using our example set of invoice documents.
The basic steps are as follows:
- Set the Content Model's Classification Method property to Labelset-Based
- Collect labels for each Document Type
- Test classification
- Reconfigure, updating existing Document Types' Label Sets and adding new Document Types as needed.
Assign the Labelset-Based Classification Method
|
Once you've figured out you want to use Label Sets to classify your documents, you need to tell your Content Model that's what you want to do! This is done by setting the Content Model's Classification Method property to Labelset-Based.
Next, we will collect labels for each Document Type in the Content Model.
|
Collect Labels
|
See the above how to (Collect Label Sets) for a full explanation of how to collect labels for Document Types in a Content Model. The rest of this tutorial will presume you have general familiarity with collecting labels.
|
| ⚠ |
|
Test Classification
In general, regardless of the Classification Method used, one of three things is going to happen to Batch Folders in a Batch during classification.
- The folder will be assigned the correct Document Type.
- The folder will be assigned the wrong Document Type.
- The folder will be assigned no Document Type at all.
The Labelset-Based method is no different. If all folders are classified correctly, that's great. However, testing is all about ensuring this is the case and figuring out where and why problems arise when folders are classified wrong or not classified at all.
We will look at a couple examples of how classification can go wrong using the Labelset-Based method, why that is the case, and what to do about it.
| FYI |
The example Batch in the rest of this tutorial is purposefully small to illustrate a few key points. In the real world, you will want to test using a much larger batch with several examples of each Document Type. |
|
|
|
Now we just need to evaluate the success or failure of our classification. Let's look at a few documents in our Batch before detailing what we will do to resolve any classification errors.
|
|
|
|
|
|
|
|
|
|
What can we do about this? Sometimes you have to know when to stop. Will it be worth it to reconfigure your Content Model and Label Sets to force Grooper to classify this document in one way or another? Probably not. This is more likely than not an extreme outlier, not representative of the larger document set. It may be easier to kick this document (and other outliers) out to human review, especially if reconfiguring the Content Model is going to negatively impact results in other ways. You have to know when to leave well enough alone. Outliers like this are a good example of when to do just that. |
Common Problems and Solutions
Custom Labels to Boost Similarity
Just because we don't have a Data Field for it doesn't mean it's not a useful label for classification. Even though we don't need to extract the salesperson's identification number, the fact that label "Salesperson ID" is present on these invoices could be important. It's another feature that makes up the "Envoy" Document Type. We just need a way of telling Grooper to use this label for classification, even though we can ignore it when it comes time to extract data from these documents. That is one of the reasons for adding custom labels to a Document Type's Label Set. |
|||
|
|||
|
|||
Now that this label is in the Label Set, it will be considered a label during classification. The label's there. It's part of the document, whether we're extracting the value or not. We "tell" Grooper labels like these should be considered features for classification by creating custom labels.
|
|||
|
When we re-classify this Batch, we will see some different results.
|
Adding New Document Types
|
The Labelset-Based classification method makes some assumptions about your document processing approach. It shines with structured and semi-structured forms. Labels, more or less, "stay put" on these kinds of documents. You'll see the same field labels over and over again even though the field values will change from document to document. This presumes your Document Types will be very regular (or rigid, with one Label Set very specifically corresponding to one Document Type). If you encounter a new form or variant of an existing form, you likely will need to account for it with a new Document Type.
Luckily, the process of adding new Document Types and defining their label sets is quick and painless and actually can become easier the more Document Types you add to the Content Model. |
|
|
You can do the whole thing in the "Labels" tab of the Content Model.
|
|
That's it! You've added a new Document Type and collected its Label Set.
|
|
|
As you keep adding more and more Document Types to the Content Model, you will inevitably keep adding more and more labels for the Data Elements in your Data Model. Eventually, you will come across a new document variant that shares a lot of similarity with an already existing Document Type.
|
|
|
This is where the label auto-map functionality comes in handy.
Grooper will search for matching labels already collected in the Label Sets of other Document Types.
|
|
|
|
|
Volatile Labels
|
Sometimes, you will collect a label you do not want to use for classification purposes. Most often, this is because the label may or may not be present depending on the document. For example, some of these invoices from Standard Products have the sales tax totaled on the document. However, some do not. This is called a "Volatile" label. Its presence on a document is unpredictable. Sometimes it's there. Sometimes it's not. It's an optional piece of information. However, because it's optional (or "volatile") we don't actually want to include this as a label for classification. It's going to decrease the similarity score for documents who do not contain the label. |
|
|
|
|
You can indicate these kinds of labels are "volatile" and should not be considered for classification. Whether it's there or not, Grooper will not include it as a feature to measure the similarity between an unclassified document and the Document Type.
|
|
|
| ⚠ |
|
Use Label Sets for Field Based Extraction
Label Sets and the Labeled Value Extractor Type
Intro to The Labeled Value Extractor
For most static field based extraction, the Labeling Behavior leverages the Labeled Value Extractor Type. Let's first briefly examine how Labeled Value works outside of the Labeling Behavior functionality.
As the name implies, Labeled Value extractor is designed to return labeled values. A common feature of structured forms is to divide information across a series of fields. But it's not as if you just have a bunch of data randomly strewn throughout the document. Typically, the field's value will be identified by some kind of label. These labels provide the critical context to what the data refers to.
Labeled Value relies on the spatial relationship between the label and the value. Most often labels and their corresponding values are aligned in one of two ways.
|
1. The value will be to the right of the label. |
|
|
2. The value will be below the label. |
Labeled Value uses two extractors itself, one to find the label and another for the value. If the two extractors results are aligned horizontally or vertically within a certain amount of space (according to how the Labeled Value extractor is configured), the value's result is returned.
|
However, the Labeled Value extractor's set up is a little different when combining it with the Labeling Behavior. The end result is a simpler configuration, utilizing collected labels for the Label Extractor.
Label Sets and Labeled Value
|
Since this Content Model utilizes the Labeling Behavior, at least part of the setup described in the previous tab was unnecessary. If you've collected a label for the Data Field and that Data Field's Value Extractor is set to Labeled Value, there is no need to configure a Label Extractor. Instead, Grooper will pass through the collected label to the Labeled Value extractor.
|
|
|
| ⚠ |
While you can get a result without configuring the Labeled Value extractor's Value Extractor, that doesn't mean you should. It is considered best practice to always configure the Value Extractor. |
Best Practice Considerations
While you can get a result without configuring the Labeled Value extractor's Value Extractor, that doesn't mean you should. It is considered best practice to always configure the Value Extractor.
So, why is it considered best practice to do so. The short answer is to increase the accuracy of your data extraction. A simple segment could be anything. If you know the data you're trying to extract has a certain pattern to it, you should target that data according to its pattern. Dates, for example, follow a few different patterns. Maybe it's "07/20/1969" or "07-20-69" or "July 20, 1969", but you know it's a date because it has a specific syntax or pattern to it. To increase the accuracy of your extraction, you should configure the Value Reader with an extractor that returns the kind of data you're attempting to return.
|
We can see fairly quickly why leaving the Labeled Value extractor's Value Extractor unconfigured is not ideal.
|
|
|
|
|
Configuring the Labeled Value extractor's Value Extractor also gives you the myriad of functionalities available to extractors. For example, Fuzzy RegEx is one of the main ways Grooper gets around poor OCR data at the time of extraction. When the text data is just a couple characters off of the extractor's regex pattern, Fuzzy RegEx can not only match the imperfect data but "swap" the wrong characters for the right ones, effectively cleansing your result.
|
|
|
However, that's just a single character off from being the right result. We could build an extractor to return currency values looking to make fuzzy swaps like this, both matching text that is slightly off and reformatting the result to match a valid currency format. If we used that extractor as the Labeled Value extractor's Value Extractor it would not only find the segment but also reformat the result, swapping the mis-OCR'd period for what it should be, a comma. And we've done just that.
|
Additional Considerations When Using Labeled Value with Label Sets
Custom Labels to Exclude Results
|
Continuing from the tutorial above's discussion of an unconfigured Labeled Value Value Extractor', let's examine the results of the "Purchase Order Number" Data Field.
This is obviously not what we want. We want the purchase order number listed below it. Ultimately, we will follow best practice and configure the Labeled Value extractor's Value Extractor property. However, before we do, this gives us an opportunity to demonstrate some additional functionality of the 'Labeling Behavior. This data "Order Date Customer No. Salesperson Order No. Ship Via" is itself comprised of labels pointing to various values on the document. Even though we haven't set up Data Fields in this Data Model to capture the values they point to, we know this is data we don't want. In general, you don't want to use Grooper to extract labels, you want to extract values. |
What's happening here is Grooper is returning all the text on this single line until a collected label in this Document Type's label set is located. In this case, the label Terms was collected for the "Payment Terms" Data Field. None of the text between the label PO Number and the label Terms have been collected in the label set. So, the Labeled Value extractor returns all the text to the right of the "PO Number" Data Field's label (PO Number) and the next encountered label (Terms), resulting in "Order Date Customer No. Salesperson Order Number Ship Via".
|
⚠ |
This is very specific functionality to the Labeled Value extractor and its interaction with label sets. It will only behave this way if you:
|
|
This may be clearer if we add a Custom Label to the label set.
|
|||
|
|||
|
If we were to go one step further and add a There is no text between the Data Field's label and another label in the label set, the Labeled Value extractor will return absolutely nothing at all.
|
|||
|
HOWEVER, this was not the right solution for this problem. This was only an educational exercise to make you aware of how labels in a label set interact with the Labeled Value extractor when its Value Extractor is left unconfigured.
However, there can be a reasonable solution if you cannot use a Value Extractor and must leave it unconfigured to capture a more generic text segment. This will require the use of "Data Element Overrides". For more information, visit the #Data Element Override Utility section of this article. |
Maximum Noise
|
The Maximum Noise property of the Labeled Value extractor controls the maximum number of "noise characters" allowed in the "bounding-region" of a label-value pair. Now, what does that mean? Let's look at an example, using the "Remit Address" Data Field of our example Data Model.
What gives? It has to do with these "noise characters" mentioned above. |
|
|
Noise characters are any letters and digits falling within the bounding region defined by a label value. For our example, the bounding region looks like this.
|
|
|
The noise characters are any letters or numbers within this rectangle other than the label or the value. The highlighted characters in the image would be the noise characters for our example. The Maximum Noise property allows you to configure how many of these non-label and non-value characters should exist in the bounding box. You don't typically expect to find a bunch of text between a label and a value. The Maximum Noise property acts as an additional filter to avoid returning results too far away from the label. Where the Maximum Distance filters out results that are physically a set distance from the label, the Maximum Noise filters results that have lots of text between them and the label. The default being 5, there can be a maximum of 5 letter or number characters between the label and value. However, in our case, we have more than 5. We have 15 ("FacturaTechnolo").
|
| FYI |
Noise characters are only letters and digits. Spaces, punctuation marks, and control characters are NOT considered noise characters, even if present in the bounding region. |
|
With this in mind, all we need to do to the "Remit Address" Data Field to successfully collect the result at time of extraction is increase the number of allowable noise characters.
|
For Data Field objects, you can collect both a "Header Label" as well as a "Footer Label". As we've seen the Header Label is the text label for whatever field you're trying to extract. Essentially, the text label marks the beginning of the field's content.
The Footer Label is an optional label used to mark the end of the field's content. The Footer Label is useful when leaving the Labeled Value extractor's Value Extractor unconfigured. While it is still always considered best practice to configure the Labeled Value extractor's Value Extractor, there are certain types of data that are difficult to match with regular expression. For example, a person's name. In these types of situations where you must run the Labeled Value extractor without a Value Extractor, a Footer Label can often aid you in throwing out false positive or "junk" data.
|
The following example is manufactured to demonstrate this concept. Let's say we're using Label Sets to extract the "Settlement Agent". We would create a Data Field and collect a label for In the case of this document, we would get the result we wanted. The Labeled Value extractor's Label Extractor would match the collected label (stroked in blue). If left unconfigured, its Value Extractor would return the nearest segment to that label's location (according to its layout settings and operation discussed previously in this tutorial). This is exactly what we want, the highlighted name "Jourdain Meardon". |
|
|
However, what if that value is not present on another document? Such is the case in this image. In that case, the extractor is still going to look for the nearest segment. Depending on the layout settings, you might return "Seller" or you might return "File #". Both of those are segments. However, they are both the wrong result. The correct value in this case is nothing at all. |
|
|
With a Footer Label, we can change how the Labeled Value operates when its Value Extractor is left unconfigured. If we collect |
|
|
Here, we've tested extraction with only the Header Label assigned for the "Settlement Agent" Data Field.
This is junk data. There is no settlement agent listed on the document. No value should be returned. |
|
|
We will add a Footer label to prevent this junk data from returning.
If present on the document, we expect the settlement agent's name to be between the label |
|
|
When we test extraction for the "Settlement Agent" Data Field now, we get very different results.
|
|
⚠ |
This is very specific functionality to the Labeled Value extractor and its interaction with Label Sets. It will only behave this way if you:
|
Using Static Labels for Data Field Extraction
Collecting Static Labels
|
The Data Field elements have a unique label option, the Static label. This label option is useful for situations where the label itself is what you want to extract.
|
|
|
What we really want to do is collect a piece of information that is the same for every single document of one Document Type. We expect the vendor's name "Factura Technology Corp" to be present for every document assigned the "Factura" Document Type during classification. Furthermore, we always expect it to be "Factura Technology Corp" and not something else. Therefore, the vendor's name is "static" for the Document Type. It's present on every Document Type and the same value for every Document Type. You know what else is static on structured and semi-structured forms? Labels! Just in this case the label "Factura Technology Corp" is itself the value we want to return. This is what a Static label is for.
|
Returning the Static Label
|
Now that the Static label is collected, how does Grooper know to return it during extraction when the Extract activity runs? The short answer is the Labeled Value extractor type will do this for us. With "Factura Technology Corp" collected as a Static label, and the "Vendor Name" Data Field configured to utilize the Labeled Value extractor, it will return the Static label itself as the result.
|
Label Sets and the Label Match Extractor Type
About Label Match
The Label Match extractor is extremely similar to the List Match extractor in that it matches one or more items in a defined list. However, it is designed specifically to work with the Labeling Behavior functionality. It will use the fuzzy extraction and vertical and constrained wrapping settings defined on the Content Model if a Labeling Behavior is enabled. This way, you can have a single, unified set of fuzzy match settings for multiple extractors. Rather than configuring these settings, including the confidence score threshold and fuzzy weighting, for multiple extractors, you can configure them just once when enabling the Labeling Behavior and all Label Match extractors will use them.
- For more information on fuzzy extraction, visit the Fuzzy RegEx article.
For the Label Match extractor to return a result, two conditions must be met.
- The document folder must be classified.
- In other words, it must have a Document Type assigned to it.
- That Document Type must have a Labeling Behavior enabled.
- Either on the Document Type or, more typically, its parent Content Model.
Label Match Example
|
Where are these Labeling Behavior settings again?
|
Use Label Sets for Tabular Extraction
Label Sets and the Tabular Layout Method
Label Sets and Tabular Layout
Many tables label the columns so the reader knows what the data in that column corresponds to. How do you know the unit price for an item on an invoice? Typically, that item is in a table and one of the columns of that table is labeled "Unit Price" or something similar. Once you read the labels for each column (also called "column headers"), you the reader know where the table begins (below the column headers) and can identify the data in each row (by understanding what the column headers refer to).
This is also the basic idea behind the Tabular Layout Extraction Method. It too utilizes column header labels to "read" tables on documents, or at least as the step number one in modeling the table's structure so that Grooper can extract data from each cell in the table.
Furthermore, using the Tabular Layout method, collected label sets using a Labeling Behavior can also be used to extract data from tables on documents. In this case, the labels collected for the Data Column children of a Data Table are utilized to help model the table's structure.
Once the column header locations are established, the next requirement is a way to understand how many rows are in the table. This is done by configuring at least one Data Column's Value Extractor property. Generally, there is at least one column in a table that is always present for every row in the table. If you can use an extractor to locate that data below its corresponding column header, that gives you a way of finding each row in the table.
And last there are a few other considerations you might need to make. Is every row in the table a single line or are the rows "multiline"? Do you need to clean up the data the Tabular Layout initially extracts for a column by normalizing it with an extractor? Do you need to establish a table "footer" to limit the number of rows extracted?
This tutorial will cover the basic configuration of the Tabular Layout Extraction Method using collected Label Sets and address a few of these considerations.
|
The basic steps will be as follows:
In a perfect world, you're done at that point. As you can see in this example, we've populated a table. Data is collected for all four Data Columns for each row on the document. However, the world is rarely perfect. We will discuss some further configuration considerations to help you get the most out of this table extraction method in the "Additional Considerations" section below. |
Collect Labels
See the above how to (Collect Label Sets) for a full explanation of how to collect labels for Document Types in a Content Model. The following tutorial will presume you have general familiarity with collecting labels.
|
As far as strict requirements for collecting labels for tabular data extraction goes, you must at minimum collect a label for each Data Column you wish to extract. For this "Stuff and Things" Document Type, one column header label has been collected for each of the four Data Column children of the "Line Items" Data Table.
|
|
|
You may optionally collect a label for the entire row of column header labels. This label is collected for the parent Data Table object's label.
It is generally considered best practice to capture a header row label for the Data Table. But if it's optional, why do it? What is the benefit of this label? |
The answer has to do with imperfect OCR text data and Fuzzy RegEx. Fuzzy RegEx provides a way for regular expression patterns to match in Grooper when the text data doesn't strictly match the pattern. The difference between the regex pattern Grooper and the character string "Gro0per" is just off by a single character. An OCR engine misreading an "o" character for a zero is not uncommon by any means, but a standard regex pattern of Grooper will not match the string "Gro0per". The pattern expects there to be an "o" where there is a zero.
Using Fuzzy RegEx instead of regular regex, Grooper will evaluate the difference between the regex pattern and the string. If it's similar enough (if it falls within a percentage similarity threshold) Grooper will return it as a match.
- FYI "similarity" may also be referred to as "confidence" when evaluating (or scoring) fuzzy match results. Grooper is more or less confident the result matches the regex pattern based on the fuzzy regex similarity between the pattern and the imperfect text data. A similarity of 90% and a confidence score of 90% are functionally the same thing (One could argue there is a difference between these two terms when Fuzzy Match Weightings come into play, but that's a whole different topic. And you may encounter Grooper users who use the terms "similarity" and "confidence" interchangeably regardless. Visit the Fuzzy RegEx article if you would like to learn more).
|
So how does this apply to the Data Table's column header row label? The short answer is it provides a way to increase the accuracy of Data Column column header labels by "boosting" the similarity of the label to imperfect OCR results.
As we will see, capturing the full row of column header labels will boost the similarity, allowing the label to match without altering the Label Behavior's fuzzy match settings. |
|
|
First, notice what's happened when we lassoed the row of column header labels.
|
|
Not magic. Just math. The Data Table's column header row label is much much longer than a single Data Column's column header label. There are just more characters in "Qty. Qty. Item Number Description Unit Price Extended Price\r\nOrd. Shp." than "Description" (70 vs 11). Where the "Description" Data Column's label is roughly 82% similar to the text data (9 out of 11 characters), the "Line Item" Data Table's label, comprised of the whole row of column labels, is roughly 96% similar to the text data (67 out of 70 characters). Utilizing a Data Table label allows you to hijack the whole row's similarity score when a single Data Column does not meet the similarity threshold. If the label can be matched as a part of the larger whole, its confidence score goes up much further than by itself. The Data Table's larger label of the full row of column labels gives extra context to the "Description" Data Column's label, providing more information about what is and is not an appropriate match. So why is it considered best practice to capture a label for the Data Table? OCR errors are unpredictable. The set of examples you worked with when architecting this solution may have been fairly clean with good OCR reads. That may not always be the case. Capturing a Data Table label for the column label row will act as a safety net to avoid unforeseen problems in the future. |
Assign a Data Column's Value Extractor
This step is all about row detection.
So far all we've done is established header column positions on each document. So, Grooper knows where the table "starts". But, that's not where the data is. The table's data is in the rows.
As it stands, Grooper doesn't know anything about the rows in the tables. It doesn't know the size of each row. It doesn't know what kind of data is supposed to be in the rows. Maybe most importantly, it doesn't know how many rows there are. Tables tend to be dynamic. They may have 3 rows on one document and 300 on the next. Grooper needs a way of detecting this.
|
Indeed, if we were to test extraction with just labels collected, we would not get any result whatsoever.
|
|
|
This is why we need a Data Column's Value Extractor property configured, to give the Extract activity an awareness of the rows beneath the column labels. The key thing to keep in mind is this data must be present on every row. You'll want to pick a column whos data is always present for every row, where it would be considered invalid if the information wasn't in that cell for a given row. In our case, we will choose the "Quantity" Data Column. We always expect there to be a quantity listed for the line item on the invoice, even if that quantity is just "1".
|
|
|
This is the pattern we will use for the "Quantity" Data Column's Value Extractor.
We get a bunch of other hits as well. This is a very generic extractor matching very generic numerical data.
|
For fairly simple table structures we now have the two things the Tabular Layout method needs to extract data.
So far, we have:
- Collected labels for the Data Column labels (and optionally the whole row of column labels for the Data Table)
- Configured at least one Data Column with its Value Extractor configured.
Now, all we need to do is tell the Data Table object we want to use the Tabular Layout method. We do this by setting its Extract Method property to Tabular Layout.
Set Extract Method to Tabular Layout and Test
|
A Data Table's extraction method is set using the Extract Method property. To enable the Tabular Layout method, do the following.
|
|
|
Now, let's test out what we have and see what we get!
For the Tabular Layout method, the Data Table is populated using primarily two pieces of information.
|
|
|
With these pieces of information, the Tabular Layout method can start to determine the table's structure. If you know where the columns are and how big they are, and you know how many rows there are, you pretty much know what the table looks like. This allows Grooper to create data instances for each cell in the table.
|
The basic setup is great for simple table structures. It is much easier to set up than previous table extraction methods, such as Header-Value. However, the biggest challenge in table extraction is the variety of ways in which table data can be formatted, organized into complicated row and column structures.
The Tabular Layout method offers a smorgasbord of configurability for more complicated or nuanced table structures. For more information on Tabular Layout's advanced setup, please visit the full #Tabular Layout article.
Label Sets and the Row Match Method
The Row Match table extraction method uses an extractor to pattern match each row of a table. For each result the extractor returns, the Data Table will collect one row. So, if the extractor returns forty results, you'll end up with a table with forty rows. Data Column results are then populated by filtering the data within each row to the proper column. Commonly, an array based collation method will be used to return the full row, then elements of that array will form the column results.
Label Sets can also be used in conjunction with the Row Match method. The Data Table's Header and/or Footer Labels can be leveraged to narrow where the Row Extractor executes on the document.
|
For example, take this Closing Disclosure form. This table structure could be targeted using the Tabular Layout method. However, it is more easily targeted and returned using the Row Match Method. The only potential problem is differentiating between the different sections of tables, such as "A. Origination Charges" and "B. Services Borrower Did Not Shop For" and "C. Services Borrower Did Shop For". The row structure of each of these highlighted tables is similar enough (or identical in the case of the "B" and "C" tables) that a single extractor could easily produce false positive matches. |
|
|
However, the labels on this document clearly define where each table begins and ends. How do you the reader know where the "B. Services Borrower Did Not Shop For" table starts? You read the label "B. Services Borrower Did Not Shop For". This is its header label. How do you the reader know where the "B. Services Borrower Did Not Shop For" table ends? Once you find the label "C. Services Borrower Did Shop For", you know you're looking at a different table. This is the "B" table's footer label. The Row Match method will utilize a Data Table's collected Header' and Footer labels to define the table's boundaries. The Row Extractor will only return row instances following the Header and/or before the Footer. |
Example Row Extractor
|
|
|
|
|
Collecting Labels For Row Match
Using Label Sets, you can assign a Header and/or Footer label for a Data Table. The Row Match method will utilize these labels in the place of its Header Extractor and Footer Extractor, respectively.
|
|
|
More importantly, in our case, we need a Footer label. The Footer label will determine where the table "stops" on the document. For the Row Match method, no row instances will be collected after this label is encountered on the document. Any matches from our Row Extractor will be discarded after the collected label.
That's it! That's all you need to do to establish the table's header and footer. There is no need to collect labels for the Data Columns. Collecting labels for Data Columns is only necessary for the Tabular Layout method. I will repeat. The Row Match method will only utilize the Data Table's labels. If you collect labels for the Data Columns and you're using the Row Match method, they will do nothing as far as table extraction goes. |
Enable Label Sets
|
The only thing left to do is "tell" the Row Match method you want to use the Header and Footer labels. This is done by enabling the Use Labelset property.
|
|
Test ResultsWith the labels collected and the Use Labelset property enabled, our Data Table will properly collect the rows we want from this table.
|
The Fluid Layout Method
The Fluid Layout table extraction method is designed to switch between the Tabular Layout method and the Row Match method, depending on how a Data Table's labels are configured. So, if you have a varied set of documents where Tabular Layout works well for some Document Types and Row Match works well for other Document Types, you may be able to use Fluid Layout for all of them, avoiding the need for Data Element Overrides.
| ⚠ | Label Sets must be collected to use the Fluid Layout method. Each Document Type will use either Tabular Layout or a Row Extractor to collect table data depending on how the labels for a Data Table are collected. Therefore, you cannot utilize the Fluid Layout method without a Labeling Behavior enabled.
The Fluid Layout table extraction method is not only "Label Set aware", it is Label Set dependent. |
|
For example, take these two versions of code descriptions from an EOB form. Version 1 is clearly a table. It uses the labels "CODE" and "DESCRIPTION" to delineate between each column. The Tabular Layout table extraction method would handily extract this information, returning everything in the "CODE" column to one Data Column and everything in the "DESCRIPTION" column to another.. |
|
|
Version 2 is not exactly a table, but a Data Table could still use the Row Extract method to form a table from this list of information. Each bulleted item in the list could be returned as a table row. The code could be filtered into one Data Column and the description could be filtered into another. You could not use the Tabular Layout method for this "table". There are no column labels present.
|
So, we have a situation where the Tabular Layout or the Row Match method is preferable, depending on the document's layout. Next, we will review how to configure the Fluid Layout table extraction method to target both table structures.
Collect Labels
The first thing you will want to do is collect labels for your Data Table for each document type. How the labels are collected will determine which table extraction method the Fluid Layout method executes.
- To execute the Tabular Layout method, the Data Table's Data Column Header labels must be collected.
- Optionally, you may choose to collect a Header and/or Footer label for the Data Table.
- To execute the Row Match method (also referred to as the Flow Layout), you must collect the Data Table's Header label. You may NOT collect labels for the Data Table's Data Column labels.
- This will be how Grooper checks to see which extraction method is used for each Document Type. If Data Column labels are present, the Tabular Layout configuration is used. If no Data Column labels are present, but the Data Table's Header label is present, it will use the Flow Layout (i.e. Row Match) configuration is used.
- Optionally, you may choose to collect a Footer label for the Data Table.
|
For Tabular Layout Document Types
The "V1" Document Type will utilize the Fluid Layout method's Tabular Layout configuration. To execute the Tabular Layout configuration, much like executing the Tabular Layout table extraction method in general, Data Column labels must be collected.
|
|||
|
For Flow Layout Document Types
The "V2" Document Type will utilize the Fluid Layout method's Flow Layout configuration. This will utilize the Row Match method to return table data. To execute the Flow Layout configuration ONLY the Data Table's label must be collected.
|
Configure Fluid Layout
|
Now that the labels are collected for our Document Types we can configure the Fluid Layout extraction method for our Data Table.
|
|
|
Expanding the Fluid Layout sub-properties, you can see there are two Layout configurations.
|
|
|
By expanding the Tabular Layout and Flow Layout properties, you can see their property panels are identical to the Tabular Layout and Row Match table extraction methods respectively.
All that's left is to configure extraction logic for each of the Layouts. |
Configure Flow Layout
|
The Flow Layout configuration extracts table data using the Row Match method. What do you need in order for Row Match to collect table data? A Row Extractor.
For our purposes, that's all we need to do. For the "V2 - Row Match" Document Types this extractor will properly return each row and collect each columns data. We have no need to configure any of the other Row Match properties. |
Configure Tabular Layout
|
The Tabular Layout configuration extracts table data using the Tabular Layout method. What do you need in order for Tabular Layout to collect table data? At least one Data Column's Value Extractor must be configured in order to detect each row in the table.
This is a fairly simple table with only two columns. Just configuring one Data Column's Value Extractor will be sufficient for our needs. |
|
|
Test Extraction
Now that extraction is configured for both the 'Tabular Layout and Flow Layout for our documents, Grooper will switch between the Tabular Layout table extraction method and the Row Match table extraction methods, depending on the Document Type.
|
For the "V1 - Tabular Layout" Document Type, Data Column labels were collected. Therefore Grooper extracts the table using the Tabular Layout configuration. |
|
|
For the "V2 - Row Match" Document Type, only the Data Table's Header label was collected, and no Data Column labels were collected. Therefore, Grooper extracts the table using the Flow Layout configuration (using the Row Match method). |
Use Label Sets for Sectional Extraction
There are two Label Set aware Extract Methods for Data Sections.
- Transaction Detection
- Nested Table
The Transaction Detection method will be most applicable to the majority of use cases wanting to use labels to produce section instances. If you simply want to produce a section starting at a header label and ending at a footer label, the Transaction Detection method is what you want. However, this configuration of Transaction Detection is quite different from how it normally produces sections. We will go over how Transaction Detection establishes section instances both with and without Label Sets.
The Nested Table method is a much more niche section extraction method. It produces section instances using repeating tables, nested within each section. This can be a highly effective way to target sections for certain use cases, such as medical EOB (explanation of benefits) forms.
Label Sets and the Transaction Detection Method
About Transaction Detection
|
The Transaction Detection section extraction method is useful for semi-structured documents which have multiple sections which are themselves very structured, repeating the same (or at least very similar) field or table data. For example, take this monthly tax reporting form from the Oklahoma Tax Commission. There are five sections of information on this document listed as "A" "B" "C" "D" and "E". Each of these sections collect the exact same set of data:
The Transaction Detection method looks for periodic similarity (also referred to as "periodicity") to sub-divide a document into multiple section instances. |
|||
|
For structured information like this, one way you can define where each section starts and stops is just by the patterns in the fields themselves. These values are periodic. They appear at set intervals, marking the boundaries of each section. For example,
The Transaction Detection method detects the periodic patterns in these values to divide up the document into sections, forming one section instance from each periodic pattern of data detected. Part of how the Transaction Detection detects these patterns is by using extractors configured in the Data Section's child Data Field objects. These are called Binding Fields. Grooper uses the results matched by these Data Fields to detect each periodic section. For example, you might have a "Production Unit Number" Data Field for these section that returns five results, one for each section. Once these five results are established, Grooper will look for other patterns around these results to establish the boundaries of each of the five sections. |
|||
|
The Transaction Detection method also analyzes a document's text line-by-line looking for repeated lines that are highly similar to each other. For example, each of the yellow highlighted lines are extremely similar. They are essentially identical except for the starting character on each line (either "A" "B" "C" "D" or "E"), this repeated pattern is a good indication that we have a set of repeated (or "periodic") sections of information. Furthermore, the next lines, highlighted in blue, are also similar as long as you normalize the data a bit. If you replace the specific number with just a "#" symbol, they too are nearly identical. The Transaction Detection method will further go line-by-line comparing the text on each one to subsequent lines, looking for repeating patterns. Such is the case for the rest of the green highlighted lines. Even accounting for OCR errors, each line is similar enough to detect a pattern. We have 5 sets of very similar lines of text. We have ultimately 5 section instances returned for the Data Section. Lastly, eventually Grooper will detect a line that does not fit the pattern. The red highlighted line is totally dissimilar from the set of similar lines detected previously. This is where Grooper "knows" to stop. Not fitting the periodic pattern, this marks a stopping point. This text is left out of the last section instance and with no further lines matching the detected periodic pattern, no further section instances are returned.
|
| FYI |
What does this have to do with Labeling Behavior and Label Sets? We're getting there. Ultimately, Transaction Detection is "Label Set aware" and can take advantage of collected Header and Footer labels for a Data Section object. However, collecting labels for the Data Section will quite dramatically change how Transaction Detection works. It is best to understand how this sectioning method works without Label Sets before we delve into how it works with them. |
Configuring Transaction Detection with Binding Fields
|
Without utilizing Label Sets, the Transaction Detection sectioning method must assign at least one Binding Field in order to detect the periodic similarity among lines of text in a document, ultimately forming the Data Section's section instances.
|
|||
|
Next, we will configure a the "Production Info" Data Section to create section instances using the Transaction Detection method.
|
|||
|
The Transaction Detection method will then go through the line-by-line comparison process around the Binding Fields to detect periodic similarities to produce section instances.
|
|||
|
Configuring Transaction Detection with Label Sets
Now that we understand the basics of the Transaction Detection method, we can look at how this sectioning method interacts with the Labeling Behavior. Its behavior is wildly different if a Header label is collected for the Data Section. Assuming you can collect a Header label for the Data Section, it is so different that a Binding Field is not even necessary to produce the section instances.
Establishing the section instances is almost as simple as...
- Start the section instance at the 'Header label.
- Stop the section instance at the next Header label (or Footer label)
- Repeat for every Header label found on the document.
|
For example, we have collected a Header label for the "Production Info" Data Section here.
|
|
|
Next, we will configure a the "Production Info" Data Section to create section instances using the Transaction Detection method.
|
Label Sets and the Nested Table Method

The Nested Table Data Section Extract Method was specifically designed for a particular combination of sectional and tabular data found on medical EOB (Explanation of Benefits) forms (However, it may have application in other areas). These documents will often be broken up into sections of claims with information like a claim number and a patient's name followed by a table of information pertaining to services rendered and ending with some kind of footer, usually a total line adding up amounts in the table.
One way you can often identify where these claim sections start and stop are by the table's themselves. Essentially you'll have one table per claim. Or in Grooper's case, one Data Table instance per Data Section instance.
The Nested Table sectioning method takes advantage of these kinds of structures, utilizing a Document Type's Label Set to do so.
|
The Nested Table method has two hard requirements:
|
Set Data Section's Extract Method to Nested Table
|
The Nested Table method is a little different in that it is a sectional extraction method but also involves tabular data. Ultimately, both a Data Section object and a Data Table object are required for it to work. However, it is primarily a method of breaking up a document into multiple sections for data extraction purposes. As such, it is a Data Section extraction method.
|
Configure the Data Table
The Data Table should be configured to collect all table rows for the full document. When configuring the Data Table and testing its results, just ensure the table accurately extracts the full document as a single table. The Data Section (using the Nested Table method) will take care of breaking out the rows into the appropriate sections.
| ⚠ | It is considered best practice for the child Data Table to use the Tabular Layout method.
The Nested Table method was designed specifically in mind with with a Data Table using the Tabular Layout table extraction method. While technically possible to use other table extraction methods, you will achieve the best results when the Data Table uses the Tabular Layout method. |
|
|||
|
In order for the Nested Table method to properly section out the document, you must assign a Footer label in the Document Type's Label Set for the Data Section. This will give Grooper an awareness of where the section should stop (ultimately allowing another section to start). In our case, we can use the text label "Totals". At the end of every table/section there is this "Totals" line totaling up various columns in the table. Since this label is present at the end of every section, we can collect it as the Data Section's Footer label, which the Nested Table method will then use to establish where each section instance ends.
|
Run Global Header Detection
|
If we are to test extraction at this point, we will see mixed results. The Data Section will correctly produce the three section instances for this document. However, the tabular data will not be collected.
|
|
|
As a side note, the "Inspector" tab can be very helpful when troubleshooting extraction in general, but particularly Data Section and Data Table extraction.
If you were to select each section instance, you could verify at this point all three sections where established successfully and the text data for each table is present. It just wasn't extracted. Why not? |
|
|
This has to do with where the sections instances are and where the Data Table and Data Column labels are.
This presents a challenge. The Tabular Layout table extraction method relies on these labels in order to extract the tabular data. As is, Grooper can't "see" outside of the section instances. If only Grooper could look up to the table and column labels, the table would extract with ease. |
|
|
Luckily, there is a way for the Tabular Layout method to do just that, using the Run Global property.
This will allow Grooper to detect Data Table and Data Column labels outside of the section instances. Perfect for what we're trying to do here. What's going to happen when we test extraction now? Find out in the next tab! |
Test For Success
|
With the child Data Table now using global header detection (by setting the Run Global property to True), it can look outside the section instances for the column header labels on the full document. Let's see how our sections extract now and if we get any table data populated.
Success! The Run Global property method is extremely beneficial when trying to extract table data from multiple sections. Without it, Tabular Layout would not have any way of referring to the column header labels collected in the Label Set. With this property enabled, Tabular Layout can do something very atypical for sectional data extraction. It can look beyond a section instance's text data and refer to the full document (in this case to locate the Data Table and Data Column labels in the Label Sets).
|
Bonus Info: Hierarchical Tables and Peer Parent Labels
Additional Information
Label Layout Options
As we've been collecting labels, you may have noticed the Layout property change from Simple to Tabbed or Wrapped. The Layout property determines how the label's text is presented on the document. The Layout can be one of the six following options:
- Simple
- Tabbed
- Substring
- Boxed
- Wrapped
- Ruled
When collecting labels in the Labels tab, Grooper will automatically detect the appropriate label layout. However, there may be some circumstances where you need to manually select the label's layout. Next, we will describe each of these Layout options.
Simple
The Simple Layout is by far the most common. Most fields on a document will utilize this layout. These labels consist of words that do not cross "segment boundaries", meaning the words themselves are not separated by large amounts of whitespace like tabs or by terminal characters like a colon (as a colon character often marks the end of a label).
|
Tabbed
The Tabbed Layout is used for situations where you do want to cross segment boundaries. Think about capturing a table's row of header labels. Often each column's label will be separated by large amounts of whitespace. The Simple Layout would not permit you to capture the table's header but Tabbed will.
|
Substring
The Substring Layout is intended for circumstances where a label is bookended between other portions of text. In other words, it is a "substring" of a larger string of text.
|
|
|
This is a situation where we would want to manually assign the label's Layout, if we want to collect substrings as labels.
|
Wrapped
The Wrapped Layout will return labels that wrap full lines of text on a document. So, if a label starts on one line, then continues on one or more lines after, this layout will successfully return it. The Wrapped Layout was also useful when we were collecting table labels for the entire header row. For those tables who had column headers on multiple lines, this layout was most appropriate to return the whole row of column headers.
- However, the Simple Layout will not work to capture this portion of text as a label.
- Normally, Grooper would capture this text as a Wrapped 'Label, but we manually assigned it the Simple Layout.
|
|
|
|
|
|
|
Ruled
Lines are used on documents to divide fields, sections, table columns or otherwise distinguish between one piece of information and another. Because of this, it is atypical to find a stacked label with a line between the first and second label. The Simple Layout respects this by preventing labels from returning if a horizontal line falls between any portion of the stacked label.
However, there may be rare circumstances where a horizontal line does fall between portions of the stacked label. In that case, you will want to use the Ruled Layout.
| ⚠ | Line location information must be present in the Layout Data in order for Grooper to determine if a line is present. A Line Detection or Line Removal command must have been previously executed by an IP Profile during Image Processing or Recognize to obtain this information. |
|
|
|
| ⚠ |
|
Boxed
The Boxed Layout is intended to capture labels that wrap inside a box, enclosed in lines on all four sides. You can use this Layout to distinguish between labels that fall inside a box and those that do not when the Vertical Wrap property is disabled.
| ⚠ | Line location information must be present in the Layout Data in order for Grooper to determine if a line is present. A Line Detection or Line Removal command must have been previously executed by an IP Profile during Image Processing or Recognize to obtain this information. |
|
|
|
You can differentiate between a label in a box and one outside a box by disabling the Vertical Wrap property.
|
|
|
|
|
| ⚠ |
|
Data Element Override Utility
Earlier in this article, we talked about using the Labeled Value Extractor Type without configuring its Value Extractor. Again, it is considered best practice to configure its Value Extractor. However, sometimes data is difficult to pattern match. For example, crafting an extractor to return people or company names can be difficult to craft. It is truly these cases why the option to leave a Labeled Value extractor's Value Extractor unconfigured is an option with Label Sets.
To make the best use of this functionality, Data Element Overrides are typically necessary. Indeed, because the Label Set approach is more templated in nature, Data Element Overrides can be a useful tool to fine tune extraction for one specific Document Type. In this section, we will use the "Purchase Order Number" Data Field of our "Labeling Behavior - Invoices - Model" Content Model to demonstrate this.
Revisiting the Problem
|
The problem arose due to how the Labeled Value extractor behaves when its Value Extractor is left unconfigured. For some of our invoices, this didn't really present a problem at all.
|
|
|
For certain document layouts, this approach works just fine.
|
|
|
However, this will not be the case for all document layouts, notably those whose labels are stacked vertically on top of their corresponding value.
|
|
|
However, we can easily get this extractor to return the actual purchase order number. All we have to do is tell it not to look to the right of the label.
|
|
|
But, what about our documents that did have the purchase order number laid out to the right of the label?
Data Element configurations are globally applied to all Document Types which inherit them. In our case, all our Document Types inherit the Content Model's Data Model (and its child Data Elements, such as our "Purchase Order Number" Data Field). Therefore, the changes we make to the "Purchase Order Number" Data Field's extractor will effect all documents of all Document Types. It's simply going to execute as we configure it, regardless which specific Document Type is extracted. We're really in a situation where we want one Document Type to use one configuration and another Document Type to use a slightly different configuration. This is exactly what "Data Element Overrides" are for. |
Data Element Override Basics
|
Before we get into setting up "Data Element Overrides", we will rewind a bit and set our Labeled Value extractor's Maximum Distance properties back to the default settings.
|
|
|
What we want to do here is change how these properties as configured for the "Purchase Order Number" Data Field are configured for the "Factura" Document Type and ONLY for the the "Factura" Document Type. "Data Element Overrides" allow us to do this by overriding a Data Element's property settings for a specific Document Type (in our case the "Purchase Order Number" Data Field for the "Factura" Document Type.). "Data Element Overrides" are configured using the Document Type object to which they will be applied. We will thus configure an override for the "Factura" Document Type.
|
|
|
|
|
Using the "Property Overrides" UI, any property configuration we edit will only apply to the selected Document Type (in our case, the "Factura" Document Type).
Now the "Purchase Order Number" Data Field will extract using these settings, only for the "Factura" Document Type.
|
|
|
|
Data Element Overrides can be an effective way of fine tuning extraction logic specific to an individual Document Type. Because the Label Set approach is more templated in nature, each Document Type corresponds to one specific format, meaning the document's layout will be consisted for each folder classified as that Document Type. Many users will take advantage of this and leverage Data Element Overrides for various fields on various Document Types, especially when utilizing Label Sets. There is a shortcut to configuring Data Element Overrides using the "Labels" collection UI, which we will demonstrate in the next tab. |
Overrides & the Labels UI
In the previous tab, we taught you the normal way to configure Data Element Overrides for a Document Type. You can configure overrides in this manner whether or not you're using a Labeling Behavior in your Content Model. If you are using a Labeling Behavior, there is a shortcut to edit overrides for a Data Element. You can do it directly from the "Labels" tab, using the same UI you use to collect labels.
|
|
|
So, we need an override for the "Purchase Order Number" Data Field for the "Envoy" Document Type, which we can do without leaving the Labels UI.
|
|
Furthermore, you can test the override directly from the Labels UI as well. You can actually test extraction for the whole Data Model!
|
|
|
Version Differences
2021
The Labeling Behavior is brand new functionality in Grooper version 2021. Prior to this version, its functionality may have been able to be approximated by other objects and their properties (For example, a Data Type using the Key-Value Pair collation is at least in some ways similar to how the Labeled Value Extractor Type works). However, creation of label sets using Document Types and their implementation described above was not available prior to version 2021.



















































































































































































