Package opennlp.tools.namefind
Klasse DefaultNameContextGenerator
java.lang.Object
opennlp.tools.namefind.DefaultNameContextGenerator
- Alle implementierten Schnittstellen:
NameContextGenerator,BeamSearchContextGenerator<String>
A
NameContextGenerator implementation for determining contextual features
for a tag-chunk style named-entity recognizer.-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungDefaultNameContextGenerator(AdaptiveFeatureGenerator... featureGenerators) Creates a name context generator with the specifiedfeature generators. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidaddFeatureGenerator(AdaptiveFeatureGenerator generator) Adds a feature generator.voidInforms all the feature generators that the context of the adaptive data (typically a document) is no longer valid and should be cleared.String[]getContext(int index, String[] tokens, String[] preds, Object[] additionalContext) Finds the context for finding names at the specified index.voidupdateAdaptiveData(String[] tokens, String[] outcomes) Informs all the feature generators that the specifiedtokenshave been classified with the corresponds set of specifiedoutcomes.
-
Konstruktordetails
-
DefaultNameContextGenerator
Creates a name context generator with the specifiedfeature generators.- Parameter:
featureGenerators- One or morefeature generators.
-
-
Methodendetails
-
addFeatureGenerator
Beschreibung aus Schnittstelle kopiert:NameContextGeneratorAdds a feature generator.- Angegeben von:
addFeatureGeneratorin SchnittstelleNameContextGenerator- Parameter:
generator- Thefeature generatorto add.
-
updateAdaptiveData
Beschreibung aus Schnittstelle kopiert:NameContextGeneratorInforms all the feature generators that the specifiedtokenshave been classified with the corresponds set of specifiedoutcomes.- Angegeben von:
updateAdaptiveDatain SchnittstelleNameContextGenerator- Parameter:
tokens- The tokens of a sentence or another text unit which has been processed.outcomes- The outcomes associated with the specifiedtokens.
-
clearAdaptiveData
public void clearAdaptiveData()Beschreibung aus Schnittstelle kopiert:NameContextGeneratorInforms all the feature generators that the context of the adaptive data (typically a document) is no longer valid and should be cleared.- Angegeben von:
clearAdaptiveDatain SchnittstelleNameContextGenerator
-
getContext
Finds the context for finding names at the specified index.- Angegeben von:
getContextin SchnittstelleBeamSearchContextGenerator<String>- Parameter:
index- The index of the token in the specifiedtokensfor which the context should be constructed.tokens- The tokens of the sentence. ThetoString()methods of these objects should return the token text.preds- The previous decisions made in the tagging of this sequence. Only indices less thanindexwill be examined.additionalContext- Addition features which may be based on a context outside the sentence.- Gibt zurück:
- The context for finding names at the specified
index.
-