Class DistributionalLexiconGenerator<T extends Tag>

  • Type Parameters:
    T - the tag type parameter
    All Implemented Interfaces:
    LexiconGenerator<T>

    public class DistributionalLexiconGenerator<T extends Tag>
    extends Object
    implements LexiconGenerator<T>
    Generates a lexicon based on similarity in an embedding space where positive and negative examples can be given per tag category.
    Author:
    David B. Bracewell
    • Constructor Detail

      • DistributionalLexiconGenerator

        public DistributionalLexiconGenerator​(@NonNull
                                              @NonNull WordEmbedding wordEmbeddings)
        Instantiates a new DistributionalLexiconGenerator
        Parameters:
        wordEmbeddings - the word embeddings
      • DistributionalLexiconGenerator

        public DistributionalLexiconGenerator​(@NonNull
                                              @NonNull WordEmbedding wordEmbeddings,
                                              @NonNull
                                              @NonNull Multimap<T,​String> seedTerms)
        Instantiates a DistributionalLexiconGenerator
        Parameters:
        wordEmbeddings - the word embeddings
        seedTerms - the seed terms
      • DistributionalLexiconGenerator

        public DistributionalLexiconGenerator​(@NonNull
                                              @NonNull WordEmbedding wordEmbeddings,
                                              @NonNull
                                              @NonNull Multimap<T,​String> seedTerms,
                                              double threshold)
        Instantiates a new DistributionalLexiconGenerator
        Parameters:
        wordEmbeddings - the word embeddings
        seedTerms - the seed terms
        threshold - the threshold
    • Method Detail

      • addNegativeSeeds

        public void addNegativeSeeds​(@NonNull
                                     T tag,
                                     @NonNull
                                     @NonNull String... phrases)
        Adds a negative example for the given tag
        Parameters:
        tag - the tag
        phrases - the phrases representing a negative examples
      • addPositiveSeeds

        public void addPositiveSeeds​(@NonNull
                                     T tag,
                                     @NonNull
                                     @NonNull String... phrases)
        Adds a positive example for the given tag
        Parameters:
        tag - the tag
        phrases - the phrase representing a positive example