Package org.carrot2.clustering
Interface ClusteringAlgorithm
-
- All Superinterfaces:
AcceptingVisitor
- All Known Implementing Classes:
BisectingKMeansClusteringAlgorithm
,LingoClusteringAlgorithm
,STCClusteringAlgorithm
public interface ClusteringAlgorithm extends AcceptingVisitor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <T extends Document>
List<Cluster<T>>cluster(Stream<? extends T> documents, LanguageComponents languageComponents)
Cluster a set of documents.default Set<Class<?>>
optionalLanguageComponents()
Set<Class<?>>
requiredLanguageComponents()
default boolean
supports(LanguageComponents languageComponents)
Verify whether a givenLanguageComponents
instance contains all the required components for the algorithm to run.-
Methods inherited from interface org.carrot2.attrs.AcceptingVisitor
accept
-
-
-
-
Method Detail
-
requiredLanguageComponents
Set<Class<?>> requiredLanguageComponents()
- Returns:
- A set of classes required to be present in the
LanguageComponents
instance provided for clustering.
-
optionalLanguageComponents
default Set<Class<?>> optionalLanguageComponents()
- Returns:
- A set of classes used by the algorithm, if present, but optional in
LanguageComponents
instance provided for clustering.
-
supports
default boolean supports(LanguageComponents languageComponents)
Verify whether a givenLanguageComponents
instance contains all the required components for the algorithm to run.- Parameters:
languageComponents
-LanguageComponents
to check against.- Returns:
true
if the providedLanguageComponents
instance is sufficient for clustering.
-
cluster
<T extends Document> List<Cluster<T>> cluster(Stream<? extends T> documents, LanguageComponents languageComponents)
Cluster a set of documents.- Type Parameters:
T
- Any subclass ofDocument
. Clusters of objects of the same type are returned.- Parameters:
documents
- A stream ofdocuments
for clustering.languageComponents
-LanguageComponents
with a set of suppliers for the required language-specific components.- Returns:
- A list of top-level clusters (clusters can form a hierarchy via
Cluster.getClusters()
.
-
-