gnes.indexer.chunk.annoy module

class gnes.indexer.chunk.annoy.AnnoyIndexer(num_dim: int, data_path: str, metric: str = 'angular', n_trees=10, *args, **kwargs)[source]

Bases: gnes.indexer.base.BaseChunkIndexer

add(keys: List[Tuple[int, Any]], vectors: numpy.ndarray, weights: List[float], *args, **kwargs)[source]

adding new chunks and their vector representations :param keys: list of (doc_id, offset) tuple :param vectors: vector representations :param weights: weight of the chunks


Declare class attributes/members that can not be serialized in standard way

train(*args, **kwargs)

Train the model, need to be overrided