T - determines what kinds of elements to perform feature extraction onpublic interface FeatureExtractor<T extends Element>
FeatureExtractor interface represents the component that performs feature extraction. It accept document for processing and
element to perform feature extraction on. Implementation of that interface can have some lifecycle methods annotated by follow
annotations:
OnInit - method annotated by this annotation will be invoked after constructor
OnDocumentStart - method annotated by this annotation will be invoked after constructor and init methods, but before feature
extraction. It will be invoked one time for one Document.
OnDocumentComplete - method annotated by this annotation will be invoked once for one Document after all features extraction.
OnDocumentStart and OnDocumentComplete executed once for one document in one thread. Both these annotations used on
methods to prepare/finalize some data from Document. extract(Document, Element) method executed besides this 2 steps and can be
multi threaded. All data prepared in OnDocumentStart step should be read-only in extract method.
OnDestroy - method annotated by this annotation will be invoked once for one class instance after all another events.
The method annotated with Destroy is typically used to release resources that it has been holding.
Also feature extractors support follow TYPE annotations:
DependsOn - to predefine array of element types that need to be defined in document before feature extraction usage.
FeatureName - to define feature name.
Indexes - to define indexes for performance optimization.
| Modifier and Type | Method and Description |
|---|---|
Collection<Feature> |
extract(Document document,
T element)
Analyze giving document structure and extract feature for specified element.
|
Collection<Feature> extract(Document document, T element)
document - document to proceedelement - annotated element in document that need to be analyzed for feature extractionCopyright © 2020. All rights reserved.