public class ContextFeatureExtractor extends FeatureCollection
To use this class, after creating the object, add other feature extractors using the
FeatureCollection.addFeatureExtractor(FeatureExtractor)
method. Then, for each neighboring word, the feature extractor will generate features using all
the extractors that have been added.
Note: This class only generates features from neighboring words. To go beyond words, new code needs to be written as required.
generators
Constructor and Description |
---|
ContextFeatureExtractor(int contextSize,
boolean specifyIndex,
boolean ignoreConstituent)
Create a new ContextFeatureExtractor.
|
ContextFeatureExtractor(int contextSize,
boolean specifyIndex,
boolean ignoreConstituent,
WordFeatureExtractor... fex) |
Modifier and Type | Method and Description |
---|---|
Set<Feature> |
getFeatures(Constituent c) |
String |
getName() |
addFeatureExtractor
public ContextFeatureExtractor(int contextSize, boolean specifyIndex, boolean ignoreConstituent)
contextSize
- The number of tokens to the left and right of the constituent from which
the features should be extracted.specifyIndex
- Should the feature mention the index (relative to the constituent)ignoreConstituent
- Should the tokens in the constituent itself be ignored while
generating the features.public ContextFeatureExtractor(int contextSize, boolean specifyIndex, boolean ignoreConstituent, WordFeatureExtractor... fex)
public Set<Feature> getFeatures(Constituent c) throws EdisonException
getFeatures
in interface FeatureExtractor
getFeatures
in class FeatureCollection
EdisonException
public String getName()
getName
in interface FeatureExtractor
getName
in class FeatureCollection
Copyright © 2017. All rights reserved.