Class EmbeddingSimilarity

    • Constructor Detail

      • EmbeddingSimilarity

        public EmbeddingSimilarity​(@NonNull
                                   @NonNull Similarity measure)
        Instantiates a new EmbeddingSimilarity.
        measure - the similarity measure to use
    • Method Detail

      • calculate

        public double calculate​(@NonNull
                                @NonNull HString first,
                                @NonNull HString second)
        Description copied from interface: HStringSimilarity
        Calculates the similarity between the two given HString
        Specified by:
        calculate in interface HStringSimilarity
        first - the first HString
        second - the second HString
        the similarity between first and second
      • fit

        public void fit​(@NonNull
                        @NonNull DocumentCollection corpus)
        Description copied from interface: HStringSimilarity
        In certain cases a HStringSimilarity needs to collect corpus level statistics to determine similarity. The fit method allows implementations to perform this logic at a corpus level.
        Specified by:
        fit in interface HStringSimilarity
        corpus - the corpus to fit the similarity measure to