relevanceai.operations_new.cluster.models.sentence_transformers.community_detection#

Port over the community detection algorithm

Module Contents#

class relevanceai.operations_new.cluster.models.sentence_transformers.community_detection.CommunityDetection(threshold: float = 0.75, min_community_size: int = 10, init_max_size: int = 1000, gpu=False)#

Helper class that provides a standard way to create an ABC using inheritance.

fit_predict(self, vectors, **kwargs)#
cosine(self, embeddings)#

effecient cosine sim

topk(self, embeddings, k)#

numpy topk

community_detection_cpu(self, embeddings)#
community_detection_gpu(self, embeddings)#
property name(self)#

It returns the name of the model class in lowercase

Return type

The name of the model.

predict(self, *args, **kwargs)#
relevanceai.operations_new.cluster.models.sentence_transformers.community_detection.CommunityDetectionModel#