Class EmojiFeatureGenerator

java.lang.Object
opennlp.tools.doccat.EmojiFeatureGenerator
All Implemented Interfaces:
opennlp.tools.doccat.FeatureGenerator

public class EmojiFeatureGenerator extends Object implements opennlp.tools.doccat.FeatureGenerator
Generates document features from the emoji annotation layer: for every annotated token the project-authored coarse sentiment score (emojiSentiment=2), the entity type (emojiType=HEART), the document category hint (emojiCategory=SMILEYS_AND_EMOTION), and for flags the ISO 3166 region (emojiRegion=DE). Tokens that are not annotated symbols contribute nothing.

Strictly opt-in: pass it alongside the defaults, for example new DoccatFactory(new FeatureGenerator[] {new BagOfWordsFeatureGenerator(), new EmojiFeatureGenerator()}); the default factory configuration is unchanged. The no-argument constructor is required so a trained model can re-instantiate the generator from its manifest.

See Also:
  • Constructor Details

    • EmojiFeatureGenerator

      public EmojiFeatureGenerator()
      Instantiates a generator over the bundled and derived annotation layers.
    • EmojiFeatureGenerator

      public EmojiFeatureGenerator(EmojiAnnotator annotator)
      Instantiates a generator over a configured annotator, for example one with a gazetteer join.
      Parameters:
      annotator - The annotator to use. Must not be null.
      Throws:
      IllegalArgumentException - if annotator is null.
  • Method Details