|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object opennlp.tools.namefind.DefaultNameContextGenerator
public class DefaultNameContextGenerator
Class for determining contextual features for a tag/chunk style named-entity recognizer.
Constructor Summary | |
---|---|
DefaultNameContextGenerator()
Creates a name context generator. |
|
DefaultNameContextGenerator(AdaptiveFeatureGenerator... featureGenerators)
Creates a name context generator with the specified cache size. |
Method Summary | |
---|---|
void |
addFeatureGenerator(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 name finder that the specified tokens have been classified with the coorisponds set of specified outcomes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultNameContextGenerator()
public DefaultNameContextGenerator(AdaptiveFeatureGenerator... featureGenerators)
Method Detail |
---|
public void addFeatureGenerator(AdaptiveFeatureGenerator generator)
NameContextGenerator
addFeatureGenerator
in interface NameContextGenerator
generator
- The feature generator to add.public void updateAdaptiveData(String[] tokens, String[] outcomes)
NameContextGenerator
updateAdaptiveData
in interface NameContextGenerator
tokens
- The tokens of the sentence or other text unit which has been processed.outcomes
- The outcomes associated with the specified tokens.public void clearAdaptiveData()
NameContextGenerator
clearAdaptiveData
in interface NameContextGenerator
public String[] getContext(int index, String[] tokens, String[] preds, Object[] additionalContext)
getContext
in interface BeamSearchContextGenerator<String>
index
- The index of the token in the specified toks array for which the context should be constructed.toks
- 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |