public class CleartkExtractor<FOCUS_T extends Annotation,SEARCH_T extends Annotation> extends Object implements FeatureExtractor1<FOCUS_T>, FeatureExtractor2<FOCUS_T,FOCUS_T>
Annotations in the context of a focus annotation and
extracts features from these. It can be used, for example, to:
| Modifier and Type | Class and Description |
|---|---|
static class |
CleartkExtractor.Bag
A
CleartkExtractor.Context that aggregates the features of other contexts into a "bag" where position
information of each individual feature is no longer maintained. |
static interface |
CleartkExtractor.Bounds
A class representing the bounds within which a
CleartkExtractor should look for
annotations. |
static interface |
CleartkExtractor.Context
A class representing a location that a
CleartkExtractor should look for annotations. |
static class |
CleartkExtractor.Count
A
CleartkExtractor.Context that aggregates the features of other contexts into a bag of counts where
only the count of occurrence of each feature value is maintained. |
static class |
CleartkExtractor.Covered
A
CleartkExtractor.Context for extracting all annotations within the focus annotation. |
static class |
CleartkExtractor.FirstCovered
A
CleartkExtractor.Context for extracting the first annotations within the focus annotation. |
static class |
CleartkExtractor.Focus
A
CleartkExtractor.Context for extracting the focus annotation. |
static class |
CleartkExtractor.Following
A
CleartkExtractor.Context for extracting annotations appearing after the focus annotation. |
static class |
CleartkExtractor.LastCovered
A
CleartkExtractor.Context for extracting the last annotations within the focus annotation. |
static class |
CleartkExtractor.NestedCountFeature |
static class |
CleartkExtractor.Ngram
A
CleartkExtractor.Context that aggregates the features of other contexts into a single "ngram" feature,
where the feature values are concatenated together in order to form a single value. |
static class |
CleartkExtractor.Ngrams
A
CleartkExtractor.Context that aggregates the features of other contexts into several "ngrams"
features, where sub-sequences of the feature values are concatenated together in order to form
single values. |
static class |
CleartkExtractor.Preceding
A
CleartkExtractor.Context for extracting annotations appearing before the focus annotation. |
| Constructor and Description |
|---|
CleartkExtractor(Class<SEARCH_T> annotationClass,
FeatureExtractor1<SEARCH_T> extractor,
CleartkExtractor.Context... contexts)
Create an extractor that finds
Annotations of the given type at the specified
CleartkExtractor.Contexts and applies the given feature extractor to the annotations. |
| Modifier and Type | Method and Description |
|---|---|
List<Feature> |
extract(JCas view,
FOCUS_T focusAnnotation)
Some feature extractors will require some specific number of annotations that is greater than
one.
|
List<Feature> |
extract(JCas view,
FOCUS_T annotation1,
FOCUS_T annotation2) |
List<Feature> |
extractBetween(JCas view,
FOCUS_T annotation1,
FOCUS_T annotation2) |
List<Feature> |
extractWithin(JCas view,
FOCUS_T focusAnnotation,
Annotation boundsAnnotation)
Extract features from the annotations around the focus annotation and within the given bounds.
|
public CleartkExtractor(Class<SEARCH_T> annotationClass, FeatureExtractor1<SEARCH_T> extractor, CleartkExtractor.Context... contexts)
Annotations of the given type at the specified
CleartkExtractor.Contexts and applies the given feature extractor to the annotations.annotationClass - The type of annotation which should be searched for in the context.extractor - The feature extractor to apply to each annotation found.contexts - The contexts where the extractor should look for annotations.public List<Feature> extract(JCas view, FOCUS_T focusAnnotation) throws CleartkExtractorException
FeatureExtractor1extract in interface FeatureExtractor1<FOCUS_T extends Annotation>view - the current view of the document.focusAnnotation - the annotation for which to collect features.CleartkExtractorExceptionpublic List<Feature> extract(JCas view, FOCUS_T annotation1, FOCUS_T annotation2) throws CleartkExtractorException
extract in interface FeatureExtractor2<FOCUS_T extends Annotation,FOCUS_T extends Annotation>CleartkExtractorExceptionpublic List<Feature> extractBetween(JCas view, FOCUS_T annotation1, FOCUS_T annotation2) throws CleartkExtractorException
CleartkExtractorExceptionpublic List<Feature> extractWithin(JCas view, FOCUS_T focusAnnotation, Annotation boundsAnnotation) throws CleartkExtractorException
view - The JCas containing the focus annotation.focusAnnotation - The annotation whose context is to be searched.boundsAnnotation - The boundary within which context annotations may be identified.CleartkExtractorExceptionCopyright © 2014. All rights reserved.