Package com.gengoai.hermes.similarity
Interface HStringSimilarity
-
- All Known Implementing Classes:
EmbeddingSimilarity
,ExtractorBasedSimilarity
public interface HStringSimilarity
Interface defining a methodology for computing the similarity between twoHString
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description double
calculate(@NonNull HString first, @NonNull HString second)
Calculates the similarity between the two givenHString
void
fit(@NonNull DocumentCollection corpus)
In certain cases a HStringSimilarity needs to collect corpus level statistics to determine similarity.
-
-
-
Method Detail
-
calculate
double calculate(@NonNull @NonNull HString first, @NonNull @NonNull HString second)
Calculates the similarity between the two givenHString
- Parameters:
first
- the first HStringsecond
- the second HString- Returns:
- the similarity between
first
andsecond
-
fit
void fit(@NonNull @NonNull DocumentCollection corpus)
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.- Parameters:
corpus
- the corpus to fit the similarity measure to
-
-