public class WindowFeatureGenerator extends Object implements opennlp.tools.util.featuregen.AdaptiveFeatureGenerator
AdaptiveFeatureGenerator.
The window size can be specified.
Features:
Current token is always included unchanged
Previous tokens are prefixed with p distance
Next tokens are prefix with n distance| Modifier and Type | Field and Description |
|---|---|
static String |
NEXT_PREFIX |
static String |
PREV_PREFIX |
| Constructor and Description |
|---|
WindowFeatureGenerator(opennlp.tools.util.featuregen.AdaptiveFeatureGenerator... generators)
Initializes the current instance with the given parameters.
|
WindowFeatureGenerator(opennlp.tools.util.featuregen.AdaptiveFeatureGenerator generator)
Initializes the current instance.
|
WindowFeatureGenerator(opennlp.tools.util.featuregen.AdaptiveFeatureGenerator generator,
int prevWindowSize,
int nextWindowSize)
Initializes the current instance with the given parameters.
|
WindowFeatureGenerator(int prevWindowSize,
int nextWindowSize,
opennlp.tools.util.featuregen.AdaptiveFeatureGenerator... generators)
Initializes the current instance with the given parameters.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearAdaptiveData() |
void |
createFeatures(List<String> features,
String[] tokens,
int index,
String[] preds) |
String |
toString() |
void |
updateAdaptiveData(String[] tokens,
String[] outcomes) |
public static final String PREV_PREFIX
public static final String NEXT_PREFIX
public WindowFeatureGenerator(opennlp.tools.util.featuregen.AdaptiveFeatureGenerator generator,
int prevWindowSize,
int nextWindowSize)
generator - feature generator to apply to the window.prevWindowSize - size of the window to the left of the current token.nextWindowSize - size of the window to the right of the current token.public WindowFeatureGenerator(int prevWindowSize,
int nextWindowSize,
opennlp.tools.util.featuregen.AdaptiveFeatureGenerator... generators)
prevWindowSize - size of the window to the left of the current tokennextWindowSize - size of the window to the right of the current tokengenerators - the array of feature generatorspublic WindowFeatureGenerator(opennlp.tools.util.featuregen.AdaptiveFeatureGenerator generator)
generator - feature generatorpublic WindowFeatureGenerator(opennlp.tools.util.featuregen.AdaptiveFeatureGenerator... generators)
generators - array of feature generatorspublic void createFeatures(List<String> features, String[] tokens, int index, String[] preds)
createFeatures in interface opennlp.tools.util.featuregen.AdaptiveFeatureGeneratorpublic void updateAdaptiveData(String[] tokens, String[] outcomes)
updateAdaptiveData in interface opennlp.tools.util.featuregen.AdaptiveFeatureGeneratorpublic void clearAdaptiveData()
clearAdaptiveData in interface opennlp.tools.util.featuregen.AdaptiveFeatureGeneratorCopyright © 2016 IXA pipes. All rights reserved.