Klasse DefaultNameContextGenerator

java.lang.Object
opennlp.tools.namefind.DefaultNameContextGenerator
Alle implementierten Schnittstellen:
NameContextGenerator, BeamSearchContextGenerator<String>

public class DefaultNameContextGenerator extends Object implements NameContextGenerator
A NameContextGenerator implementation for determining contextual features for a tag-chunk style named-entity recognizer.
  • Konstruktordetails

  • Methodendetails

    • addFeatureGenerator

      public void addFeatureGenerator(AdaptiveFeatureGenerator generator)
      Beschreibung aus Schnittstelle kopiert: NameContextGenerator
      Adds a feature generator.
      Angegeben von:
      addFeatureGenerator in Schnittstelle NameContextGenerator
      Parameter:
      generator - The feature generator to add.
    • updateAdaptiveData

      public void updateAdaptiveData(String[] tokens, String[] outcomes)
      Beschreibung aus Schnittstelle kopiert: NameContextGenerator
      Informs all the feature generators that the specified tokens have been classified with the corresponds set of specified outcomes.
      Angegeben von:
      updateAdaptiveData in Schnittstelle NameContextGenerator
      Parameter:
      tokens - The tokens of a sentence or another text unit which has been processed.
      outcomes - The outcomes associated with the specified tokens.
    • clearAdaptiveData

      public void clearAdaptiveData()
      Beschreibung aus Schnittstelle kopiert: NameContextGenerator
      Informs all the feature generators that the context of the adaptive data (typically a document) is no longer valid and should be cleared.
      Angegeben von:
      clearAdaptiveData in Schnittstelle NameContextGenerator
    • getContext

      public String[] getContext(int index, String[] tokens, String[] preds, Object[] additionalContext)
      Finds the context for finding names at the specified index.
      Angegeben von:
      getContext in Schnittstelle BeamSearchContextGenerator<String>
      Parameter:
      index - The index of the token in the specified tokens 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 index will 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.