Package org.carrot2.clustering
Interface ClusteringAlgorithm
- All Superinterfaces:
AcceptingVisitor
- All Known Implementing Classes:
BisectingKMeansClusteringAlgorithm
,LingoClusteringAlgorithm
,STCClusteringAlgorithm
-
Method Summary
Modifier and TypeMethodDescriptioncluster
(Stream<? extends T> documents, LanguageComponents languageComponents) Cluster a set of documents.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 Details
-
requiredLanguageComponents
- Returns:
- A set of classes required to be present in the
LanguageComponents
instance provided for clustering.
-
optionalLanguageComponents
- Returns:
- A set of classes used by the algorithm, if present, but optional in
LanguageComponents
instance provided for clustering.
-
supports
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()
.
-