Class Word2VecSynonymFilter

All Implemented Interfaces:
Closeable, AutoCloseable, Unwrappable<TokenStream>

public final class Word2VecSynonymFilter extends TokenFilter
Applies single-token synonyms from a Word2Vec trained network to an incoming TokenStream.
WARNING: This API is experimental and might change in incompatible ways in the next release.
  • Constructor Details

    • Word2VecSynonymFilter

      public Word2VecSynonymFilter(TokenStream input, Word2VecSynonymProvider synonymProvider, int maxSynonymsPerTerm, float minAcceptedSimilarity)
      Apply previously built synonymProvider to incoming tokens.
      Parameters:
      input - input tokenstream
      synonymProvider - synonym provider
      maxSynonymsPerTerm - maximum number of result returned by the synonym search
      minAcceptedSimilarity - minimal value of cosine similarity between the searched vector and the retrieved ones
  • Method Details