Class TemplateClassifier.Builder
- Namespace
- Apryse.TemplateExtraction
- Assembly
- Apryse.TemplateExtraction.dll
Provides a builder for configuring and creating an instance of TemplateClassifier.
public class TemplateClassifier.Builder
- Inheritance
-
objectTemplateClassifier.Builder
Methods
Build()
Builds and returns the configured TemplateClassifier instance.
public TemplateClassifier Build()
Returns
EnableCacheLookup(bool)
Enables or disables automatic cache lookup. When cache folder is found inside a disk-based templates collection source, it will be automatically used unless this is set to false.
public TemplateClassifier.Builder EnableCacheLookup(bool enabled)
Parameters
enabledboolA value indicating whether to enable cache lookup.
Returns
- TemplateClassifier.Builder
The TemplateClassifier.Builder instance for method chaining.
SetImmediateMatchThreshold(int)
Sets the immediate match threshold score to select a result as soon as it is reached. Once the score exceeds this threshold, the search process will stop, and the result will be selected immediately
public TemplateClassifier.Builder SetImmediateMatchThreshold(int score)
Parameters
scoreintThe immediate match threshold score.
Returns
- TemplateClassifier.Builder
The TemplateClassifier.Builder instance for method chaining.
SetLanguages(string)
comma separated list of languages expected for the classified template usually set from templates' repository as it should have a single language mixing more than one language can impact accuracy
public TemplateClassifier.Builder SetLanguages(string lang)
Parameters
langstringA comma-separated list of languages. example 1: "en,es,fr,it,de" example 2: "english,spanish,french,italian,german,dutch"
Returns
- TemplateClassifier.Builder
The TemplateClassifier.Builder instance for method chaining.
Remarks
mixing more than one language is allowed but may impact accuracy
SetLicense(string[])
Sets the runtime license for the classifier.
public TemplateClassifier.Builder SetLicense(string[] license)
Parameters
licensestring[]The runtime license as an array of strings.
Returns
- TemplateClassifier.Builder
The TemplateClassifier.Builder instance for method chaining.
SetMatchThreshold(int)
Sets the minimum confidence score to accept a template as a possible match.
public TemplateClassifier.Builder SetMatchThreshold(int score)
Parameters
scoreintThe confidence score threshold.
Returns
- TemplateClassifier.Builder
The TemplateClassifier.Builder instance for method chaining.
SetOcrRuntimeFolder(string)
Sets the OCR runtime folder path for required binaries and resources.
public TemplateClassifier.Builder SetOcrRuntimeFolder(string ocrRuntimeFolder)
Parameters
ocrRuntimeFolderstringThe OCR runtime folder path.
Returns
- TemplateClassifier.Builder
The TemplateClassifier.Builder instance for method chaining.
SetRuntimeFolder(string)
Sets the runtime folder path for required binaries and resources.
public TemplateClassifier.Builder SetRuntimeFolder(string runtimeFolder)
Parameters
runtimeFolderstringThe runtime folder path.
Returns
- TemplateClassifier.Builder
The TemplateClassifier.Builder instance for method chaining.
SetTemplatesSource(TemplatesCollection)
(required) Sets the templates collection source for classification. Used for looking up and matching the appropriate document classes.
public TemplateClassifier.Builder SetTemplatesSource(TemplatesCollection source)
Parameters
sourceTemplatesCollectionThe templates collection source.
Returns
- TemplateClassifier.Builder
The TemplateClassifier.Builder instance for method chaining.
SetUseCacheFrom(string)
Sets the cache folder path for disk-based caching.
public TemplateClassifier.Builder SetUseCacheFrom(string folder)
Parameters
folderstringThe path to the cache folder.
Returns
- TemplateClassifier.Builder
The TemplateClassifier.Builder instance for method chaining.
SetUseOCR(bool)
Enables or disables OCR processing.
public TemplateClassifier.Builder SetUseOCR(bool useOcr)
Parameters
useOcrboolA value indicating whether to use OCR.
Returns
- TemplateClassifier.Builder
The TemplateClassifier.Builder instance for method chaining.