- Introducing ABBYY FlexiCapture
- Installing and running the program
- ABBYY FlexiCapture architecture
-
Program settings
- ABBYY FlexiCapture Setup
- Multitenancy
- Creating a project
-
Document Definitions
- Creating fixed Document Definitions
- Creating Document Definitions for semi-structured documents
- Document Definitions without automatic fields extraction
- Document sets
-
Document Definition fields
- Text entry fields
- Checkmarks
- Checkmark groups
- Barcodes
- Pictures
- Tables
- Field group
- Service fields
- Index fields
- Link to an existing field
- Fields without a region
- Creating a field with a non-rectangular region
- Fields with several instances
- Fields with several regions
- How to change a field name
- Copying, moving, deleting fields
- Exclusion of a region from recognition
- Document Definition Wizard
- Editing and publishing a Document Definition
- Creating Document Definitions
- Document Definition properties
- Properties of a Document Definition section
- Rule validation
- Export settings
- Configuring data presentation in the document window
- Testing Document Definitions
- Localizing a Document Definition
- Classification
- Field extraction training
- Operating a configured project
-
ABBYY FlexiCapture for Invoices
- Features of ABBYY FlexiCapture for Invoices
- How to capture invoices
-
How to set up an invoice capture project
- Country and language settings
- Connecting vendor and business unit databases
- Data export settings
- The status of documents in ABBYY FlexiCapture for Invoices projects
- Training ABBYY FlexiCapture for Invoices
- Rules
- Capturing additional invoice fields
- Purchase Order Matching
- Enabling additional program features for operators
- Using multiple Document Definitions
- Editing invoice processing settings in XML files
- Updating the Document Definition for invoices
- Tax systems
- Specifications
- Capturing receipts
- Capturing purchase orders
- Using NLP to process unstructured documents
- ABBYY FlexiCapture interface
-
Appendix
-
Using scripts in ABBYY FlexiCapture
- Specifics of scripts written in .Net languages
- External assemblies
- Object model
-
Scripts for customizing processing stages
-
Types of scripts
- Script rule
- Autocorrection script
- Export script
- User script (custom action)
- Document assembly script
- Custom recognition script
- Stage rule
- Processing scripts
- Data set update script
- Data set validation scripts
- Document classification script
-
Event handlers
- Batch created
- Batch deleted
- Batch parameter change
- Batch structure change (page added/page deleted/document added/document deleted)
- Pages moved
- Batch opened/closed
- Batch integrity check
- Document parameter changed
- Document state changed
- Export completed
- Script that is run after rule checks
- Before matching
- Field verification request
-
Objects
- IActionResult
- IAssemblingError
- IAssemblingErrors
- IBatch
- IBatchCheckResults
- IBatchItem
- IBatchItems
- IBatchTypeClassifier
- IBatchTypeClassifierResult
- IBinarizationParams
- IBoxedBoolean
- ICharacterParams
- ICharactersParams
- ICheckmarkGroupValue
- ICheckmarkValue
- IDataSet
- IDataSetQuery
- IDataSetRecord
- IDocument
- IDocuments
- IDocumentExportResults
- IDocumentsExportResults
- IDocumentDefinitionInfo
- IDocumentDefinitionInfoArray
- IEditablePictureObject
- IExportFieldsToRedact
- IExportImageSavingOptions
- IField
- IFieldRegion
- IFieldRegions
- IFields
- IFlexiCaptureTools
- ILocalContrastParams
- IMatchedSectionInfo
- IMatchingInfo
- IPage
- IPageClassificationResult
- IPages
- IPictureObject
- IPictureObjectsInfo
- IPrincipal
- IPrincipals
- IProcessingCallback
- IProject
- IProperties
- IProperty
- IPropertyModificationInfo
- IRecordCheckResult
- IRecordset
- IRect
- IRects
- IRoutingRuleResult
- IRuleContext
- IRuleError
- IRuleErrors
- IRuleTag
- IRuleTags
- IScriptBinaryAttributes
- IScriptDefinitionContext
- ISectionDefinitionInfo
- ISectionDefinitionInfoArray
- IShadowsHighlightsParams
- IStageInfo
- IUserAttachment
- IUserAttachments
- IUserSessionInfo
- IValue
- IVARIANTArray
- TAssemlingErrorType
- TBatchItemType
- TColorToFilter
- TExportFieldType
- TExportType
- TImageCompressionType
- TPageClassificationType
- TPdfAVersion
- TPdfDocumentInfoType
- TPdfTextSearchAreaType
- TPrincipalType
- TProcessingPriority
- TPropertyType
- TRuleErrorType
- TStateType
- Sample scripts
- Internal names of recognition languages
-
Types of scripts
-
Scripts for processing interface events
-
Event handlers
- On Document Closed
- On Project Closed
- On Activate Document
- On Field Control Activate
- On Return From Task
- On User Command
- On Field Control Deactivate
- On Closing Document
- On Task Close
- On Closing Project
- On Region Change
- On Task Window Mode Changed
- On Open Document
- On Task Window Create
- On Task Reject
- On Region Control Draw
- On Task Send To Stage
- On Text Field Validating
-
Objects
- IBoolean
- IBoxedFieldControl
- IDocumentEditor
- IDocumentItem
- IDocumentItems
- IDocumentsCollection
- IDocumentsWindow
- IDrawContext
- IErrorControl
- IErrorControls
- IErrorsWindow
- IFieldControl
- IFieldRegionControl
- IFieldRegionControls
- IFormWindow
- IImageWindow
- IMainMenu
- IMainWindow
- IMenu
- IMenuItem
- IPageControl
- IPageItem
- IPageItems
- IPagesCollection
- IPoint
- ISelection
- IShellRational
- IShellRect
- IShellRects
- ITaskWindow
- ITextEditor
- IToolbar
- IToolbarButton
- IToolbars
- TCommandBarType
- TCommandID
- TDockingType
- TDocumentState
- TErrorType
- TSelectionType
- TTaskWindowMode
- TTextSize
- TUserRole
- TWorkWindowType
-
Event handlers
- User scripts for the Web Verification Station
- Creating a machine-readable form
- Hot keys
- Additional options
- Description of Processing Server commands
- ABBYY FlexiCapture sample projects
- Supported recognition languages
- Supported classifier languages
- Fonts for correct characters rendering
- Supported text types
- Supported barcode types
- Supported input formats
- Processing PDF files
- Export file formats
- Date formats
- Alphabet used in regular expressions
- Patents
- Third-party technologies
- Glossary
- Technical support
- How to buy ABBYY FlexiCapture
- End-User License Agreement (EULA)
-
Using scripts in ABBYY FlexiCapture
Document classification script
An ABBYY FlexiCapture classifier processes submitted documents and determines their class. This lets you choose a document definition to be used for field extraction.
Each classifier corresponds to a specific classification training batch.
If you want to use several classifiers for a single batch, you need to set up a classification script. This can be useful when there are documents that need to undergo additional classification. In this case, the first classifier will be used to classify the documents according to their class, and then, an additional classifier will be selected from the script depending on the classification results. For example, documents can be first classified into "invoices" and "contracts", then the invoices can be further classified according to company name.
Note: This script can only be set up for an already existing classification training batch and cannot be set up when creating a new batch.
To set up a classification script:
- Open Project → Project Properties....
- Go to the Recognition tab found in the project properties window.
- Open the classification script Editor by clicking Set... to the right of Use script in the Classification section.
- In the dialog box, select an appropriate classifier by clicking Add... and choosing a classification batch from the list.
- Now, you can change a classifier's Alias Name. This allows you to not have to rewrite a script if a classifier's name has been changed during processing. The script will refer to the particular name specified in the Alias Name column.
- Open the script editor window by clicking Edit Script....
Parameters
Name | Type | Access | Description |
BatchTypeClassifier | IBatchTypeClassifier | Read-only | A classifier in the batch type. |
IsConfident | bool | Read-only |
Classification confidence. Unlike working with automatic classifiers, when working with the script this parameter must be manually specified in page properties. ExampleIClassificationResult result = Classifiers[0].ClassifyPage( Page ); Page.ResultClassName = result.ClassName; Page.IsResultClassConfident = result.IsConfident; |
Page | IPage | Read/write | Document page. |
Processing | IProcessingCallback | Read/write | The object for logging the information about processing. |
Sample scripts
This script classifies pages and adds the name of a class to their properties:
IBatchTypeClassifierResult classifierResult = BatchTypeClassifier.ClassifyPage( Page, null );
Page.ResultClassName = classifierResult.ClassName;
The sample script below allows you to get classification confidence levels:
IClassificationResult result = Classifiers[0].ClassifyPage( Page ); FCTools.ShowMessage( "Class: " + result.ClassName ); Page.ResultClassName = result.ClassName; FCTools.ShowMessage( "IsConfident: " + result.IsConfident ); Page.IsResultClassConfident = result.IsConfident;
Sample script that combines multiple classifiers for cascade classification
var res0 = Classifiers.Get ( "Batch" ).ClassifyPage( Page ); IClassConfidences classVars = res0.Classes; foreach( IClassConfidence c in classVars ) { FCTools.ShowMessage( c.Name + " --> " + c.Confidence.ToString() ); } FCTools.ShowMessage( "Class res0: " + res0.ClassName); if (res0.ClassName == "Invoice") { var res1 = Classifiers.Get ( "Batch2" ).ClassifyPage( Page ); IClassConfidences classVars1 = res1.Classes; foreach( IClassConfidence d in classVars1 ) { FCTools.ShowMessage( d.Name + " --> " + d.Confidence.ToString() ); } FCTools.ShowMessage( "Class res1: " + res1.ClassName); Page.ResultClassName = res1.ClassName; } else { Page.ResultClassName = res0.ClassName; } FCTools.ShowMessage( "Page.ResultClassName: " +Page.ResultClassName);
Sample script that assigns the Unknown class to documents, whose classification confidence turns out to be lower than the specified value
The following script can be used if your scenario does not require documents with a low confidence level to be assigned a class (even if a class has already been specified for them). Such documents should be classified manually by an operator.
Important! For the script to work, a new class should be created beforehand — for example, “Unknown”. Then, it should be linked to the document definition in the Class Mapping... dialog. For more information, see Mapping classes to Document Definition sections.
using System; IClassificationResult result = Classifiers.Get ( "ClassifierBatch" ).ClassifyPage(Page); Page.ResultClassName = result.ClassName; IClassConfidences classVars = result.Classes; Page.Comment = ""; foreach( IClassConfidence c in classVars ) { //FCTools.ShowMessage( c.Name + " -- " + c.Confidence.ToString() ); // records the classification confidence value in the event log Page.Comment = Page.Comment + c.Name + "-" + c.Confidence.ToString() + "; "; // records the classification confidence value in the page comments } if (classVars.Count>0) { if (classVars[0].Confidence<80) Page.IsResultClassConfident=false; // confidence threshold below which a document will be classified as uncertainly classified else Page.IsResultClassConfident=true; if (classVars[0].Confidence<20) Page.ResultClassName="Unknown"; // confidence threshold below which a document will be assigned the "Unknown" class if (classVars.Count>1) { int classesToShow = Math.Min(classVars.Count, 3); for(int i=0; i<classesToShow; i++) { Page.Comment = Page.Comment + classVars[i].Name + "-" + classVars[i].Confidence.ToString() + "; "; } } } FCTools.ShowMessage( "Class: " + Page.ResultClassName );
Note: The confidence threshold values in this script are only for demonstration purposes and can be modified by the user depending on a particular workflow.
3/2/2021 8:10:42 AM