public class DefaultSequenceLabelerContextGenerator extends Object implements SequenceLabelerContextGenerator
| Constructor and Description |
|---|
DefaultSequenceLabelerContextGenerator(opennlp.tools.util.featuregen.AdaptiveFeatureGenerator... featureGenerators)
Creates a name context generator with the specified cache size.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFeatureGenerator(opennlp.tools.util.featuregen.AdaptiveFeatureGenerator generator)
Adds a feature generator to this set of feature generators.
|
void |
clearAdaptiveData()
Informs all the feature generators for a name finder that the context of
the adaptive data (typically a document) is no longer valid.
|
String[] |
getContext(int index,
String[] tokens,
String[] preds,
Object[] additionalContext)
Return the context for finding names at the specified index.
|
void |
updateAdaptiveData(String[] tokens,
String[] outcomes)
Informs all the feature generators for a sequence labeler that the
specified tokens have been classified with the corresponding set of
specified outcomes.
|
public DefaultSequenceLabelerContextGenerator(opennlp.tools.util.featuregen.AdaptiveFeatureGenerator... featureGenerators)
featureGenerators - the array of feature generatorspublic void addFeatureGenerator(opennlp.tools.util.featuregen.AdaptiveFeatureGenerator generator)
SequenceLabelerContextGeneratoraddFeatureGenerator in interface SequenceLabelerContextGeneratorgenerator - The feature generator to add.public void updateAdaptiveData(String[] tokens, String[] outcomes)
SequenceLabelerContextGeneratorupdateAdaptiveData in interface SequenceLabelerContextGeneratortokens - The tokens of the sentence or other text unit which has been
processed.outcomes - The outcomes associated with the specified tokens.public void clearAdaptiveData()
SequenceLabelerContextGeneratorclearAdaptiveData in interface SequenceLabelerContextGeneratorpublic String[] getContext(int index, String[] tokens, String[] preds, Object[] additionalContext)
getContext in interface opennlp.tools.util.BeamSearchContextGenerator<String>index - The index of the token in the specified toks array for which the
context should be constructed.tokens - The tokens of the sentence. The toString methods of
these objects should return the token text.preds - The previous decisions made in the tagging of this sequence. Only
indices less than i will be examined.additionalContext - Addition features which may be based on a context outside of the
sentence.Copyright © 2017 IXA pipes. All rights reserved.